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

RotateTexture() protected method

protected RotateTexture ( ISceneChildEntity part, double rotation, int face ) : void
part ISceneChildEntity
rotation double
face int
return void
        protected void RotateTexture(ISceneChildEntity part, double rotation, int face)
        {
            Primitive.TextureEntry tex = part.Shape.Textures;
            int ns = GetNumberOfSides(part);
            if (face >= 0 && face < ns)
            {
                Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
                texface.Rotation = (float)rotation;
                tex.FaceTextures[face] = texface;
                part.UpdateTexture(tex, false);
                return;
            }
            if (face == ScriptBaseClass.ALL_SIDES)
            {
                for (int i = 0; i < ns; i++)
                {
                    if (tex.FaceTextures[i] != null)
                    {
                        tex.FaceTextures[i].Rotation = (float)rotation;
                    }
                }
                tex.DefaultTexture.Rotation = (float)rotation;
                part.UpdateTexture(tex, false);
                return;
            }
        }
LSL_Api