OpenMetaverse.ObjectManager.AddGrass C# (CSharp) 메소드

AddGrass() 공개 메소드

Rez grass and ground cover
public AddGrass ( Simulator simulator, System.Vector3 scale, Quaternion rotation, System.Vector3 position, Grass grassType, UUID groupOwner ) : void
simulator Simulator A reference to the object where the object resides
scale System.Vector3 The size of the grass
rotation Quaternion The rotation of the grass
position System.Vector3 The position of the grass
grassType Grass The type of grass from the enum
groupOwner UUID The of the group to set the tree to, /// or UUID.Zero if no group is to be set
리턴 void
        public void AddGrass(Simulator simulator, Vector3 scale, Quaternion rotation, Vector3 position,
            Grass grassType, UUID groupOwner)
        {
            ObjectAddPacket add = new ObjectAddPacket();

            add.AgentData.AgentID = Client.Self.AgentID;
            add.AgentData.SessionID = Client.Self.SessionID;
            add.AgentData.GroupID = groupOwner;
            add.ObjectData.BypassRaycast = 1;
            add.ObjectData.Material = 3;
            add.ObjectData.PathCurve = 16;
            add.ObjectData.PCode = (byte)PCode.Grass;
            add.ObjectData.RayEnd = position;
            add.ObjectData.RayStart = position;
            add.ObjectData.RayTargetID = UUID.Zero;
            add.ObjectData.Rotation = rotation;
            add.ObjectData.Scale = scale;
            add.ObjectData.State = (byte)grassType;

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