Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.GetColor C# (CSharp) Method

GetColor() protected method

protected GetColor ( ISceneChildEntity part, int face ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
part ISceneChildEntity
face int
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
        protected LSL_Vector GetColor(ISceneChildEntity part, int face)
        {
            Primitive.TextureEntry tex = part.Shape.Textures;
            Color4 texcolor;
            LSL_Vector rgb = new LSL_Vector();
            int ns = GetNumberOfSides(part);
            if (face == ScriptBaseClass.ALL_SIDES)
            {
                int i;

                for (i = 0; i < ns; i++)
                {
                    texcolor = tex.GetFace((uint)i).RGBA;
                    rgb.x += texcolor.R;
                    rgb.y += texcolor.G;
                    rgb.z += texcolor.B;
                }

                float tmp = 1f / ns;
                rgb.x *= tmp;
                rgb.y *= tmp;
                rgb.z *= tmp;

                return rgb;
            }
            if (face >= 0 && face < ns)
            {
                texcolor = tex.GetFace((uint)face).RGBA;
                rgb.x = texcolor.R;
                rgb.y = texcolor.G;
                rgb.z = texcolor.B;
                return rgb;
            }
            return new LSL_Vector();
        }
LSL_Api