OpenMetaverse.ObjectManager.SetRotation C# (CSharp) Method

SetRotation() public method

Change the rotation of an object
public SetRotation ( Simulator simulator, uint localID, Quaternion rotation ) : void
simulator Simulator A reference to the object where the object resides
localID uint The objects ID which is local to the simulator the object is in
rotation Quaternion The new rotation of the object
return void
        public void SetRotation(Simulator simulator, uint localID, Quaternion rotation)
        {
            ObjectRotationPacket objRotPacket = new ObjectRotationPacket();
            objRotPacket.AgentData.AgentID = Client.Self.AgentID;
            objRotPacket.AgentData.SessionID = Client.Self.SessionID;

            objRotPacket.ObjectData = new ObjectRotationPacket.ObjectDataBlock[1];

            objRotPacket.ObjectData[0] = new ObjectRotationPacket.ObjectDataBlock();
            objRotPacket.ObjectData[0].ObjectLocalID = localID;
            objRotPacket.ObjectData[0].Rotation = rotation;
            Client.Network.SendPacket(objRotPacket, simulator);
        }

Same methods

ObjectManager::SetRotation ( Simulator simulator, uint localID, Quaternion quat, bool childOnly ) : void