OpenMetaverse.ObjectManager.UpdateObject C# (CSharp) Method

UpdateObject() public method

Send a Multiple Object Update packet to change the size, scale or rotation of a primitive
public UpdateObject ( Simulator simulator, uint localID, System.Vector3 data, UpdateType type ) : 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
data System.Vector3 The new rotation, size, or position of the target object
type UpdateType The flags from the Enum
return void
        public void UpdateObject(Simulator simulator, uint localID, Vector3 data, UpdateType type)
        {
            MultipleObjectUpdatePacket multiObjectUpdate = new MultipleObjectUpdatePacket();
            multiObjectUpdate.AgentData.AgentID = Client.Self.AgentID;
            multiObjectUpdate.AgentData.SessionID = Client.Self.SessionID;

            multiObjectUpdate.ObjectData = new MultipleObjectUpdatePacket.ObjectDataBlock[1];

            multiObjectUpdate.ObjectData[0] = new MultipleObjectUpdatePacket.ObjectDataBlock();
            multiObjectUpdate.ObjectData[0].Type = (byte)type;
            multiObjectUpdate.ObjectData[0].ObjectLocalID = localID;
            multiObjectUpdate.ObjectData[0].Data = data.GetBytes();

            Client.Network.SendPacket(multiObjectUpdate, simulator);
        }