public SimpleTree GenerateSimpleTree(Random random)
 {
     SimpleTree tree = new SimpleTree(GraphicsDevice, Generator.GenerateTree(random));
     tree.TrunkTexture = TrunkTexture;
     tree.LeafTexture = LeafTexture;
     tree.TrunkEffect = TrunkEffect;
     tree.LeafEffect = LeafEffect;
     return tree;
 }
        public SimpleTree GenerateSimpleTree(Random random)
        {
            SimpleTree tree = new SimpleTree(GraphicsDevice, Generator.GenerateTree(random));

            tree.TrunkTexture = TrunkTexture;
            tree.LeafTexture  = LeafTexture;
            tree.TrunkEffect  = TrunkEffect;
            tree.LeafEffect   = LeafEffect;
            return(tree);
        }
 //        private TreeMesh trunk;
 //        private TreeLeafCloud leaves;
 //        private TreeAnimationState animationState;
 //        private Effect trunkEffect;
 //        private Effect leafEffect;
 //        private Texture2D trunkTexture;
 //        private Texture2D leafTexture;
 //        private Matrix[] bindingMatrices;
 //        private readonly BasicEffect boneEffect;
 public SunlitSimpleTree(SimpleTree tree)
     : this(tree.GraphicsDevice, tree.Skeleton)
 {
     AnimationState = tree.AnimationState;
     BindingMatrices = tree.BindingMatrices;
     Leaves = tree.Leaves;
     Trunk = tree.Trunk;
     LeafEffect = tree.LeafEffect;
     TrunkEffect = tree.TrunkEffect;
     LeafTexture = tree.LeafTexture;
     TrunkTexture = tree.TrunkTexture;
 }
Beispiel #4
0
 protected override void LoadContent()
 {
     TreeProfile profile = content.Load<TreeProfile>("Trees/Gardenwood");
        tree = profile.GenerateSimpleTree();
 }
 public Tree(SimpleTree simpleTree, Matrix transformationMatrix)
 {
     this.simpleTree = simpleTree;
     this.transformationMatrix = transformationMatrix;
 }
Beispiel #6
0
 public LTree(String name, SimpleTree tree) : base(name)
 {
     m_SimpleTree = tree;
 }
Beispiel #7
0
 public LTree(SimpleTree tree) : base("")
 {
     m_SimpleTree = tree;
 }
 void NewTree()
 {
     // Generates a new tree using the currently selected tree profile
     // We call TreeProfile.GenerateSimpleTree() which does three things for us:
     // 1. Generates a tree skeleton
     // 2. Creates a mesh for the branches
     // 3. Creates a particle cloud (TreeLeafCloud) for the leaves
     // The line mesh is just for testing and debugging
     tree = profiles[currentTree].GenerateSimpleTree();
     linemesh = new TreeLineMesh(GraphicsDevice, tree.Skeleton);
 }
        public void UpdateTree()
        {
            if (!Initialized)
                return;

            tree = CurrentProfile.GenerateSimpleTree(new Random(seed));

            if (TreeUpdated != null)
                TreeUpdated(this, EventArgs.Empty);
        }