OpenMetaverse.ObjectManager.AddTree C# (CSharp) Method

AddTree() public method

Rez a Linden tree
public AddTree ( Simulator simulator, System.Vector3 scale, Quaternion rotation, System.Vector3 position, Tree treeType, UUID groupOwner, bool newTree ) : void
simulator Simulator A reference to the object where the object resides
scale System.Vector3 The size of the tree
rotation Quaternion The rotation of the tree
position System.Vector3 The position of the tree
treeType Tree The Type of tree
groupOwner UUID The of the group to set the tree to, /// or UUID.Zero if no group is to be set
newTree bool true to use the "new" Linden trees, false to use the old
return void
        public void AddTree(Simulator simulator, Vector3 scale, Quaternion rotation, Vector3 position,
            Tree treeType, UUID groupOwner, bool newTree)
        {
            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 = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree;
            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)treeType;

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