barsuift.simLife.tree
Class TreeStateFactory

java.lang.Object
  extended by barsuift.simLife.tree.TreeStateFactory

public class TreeStateFactory
extends java.lang.Object


Field Summary
static float HEIGHT_BRANCH_RADIAL_LENGTH_RATIO
          Ratio between the length of branches compared to the tree height
static int HEIGHT_RADIUS_RATIO
           
 
Constructor Summary
TreeStateFactory()
           
 
Method Summary
protected  javax.vecmath.Point3d computeBranchEndPoint(double treeHeight, boolean goingToPositiveX, boolean goingToPositiveZ)
          Compute the branch end point.
protected  javax.vecmath.Vector3d computeBranchTranslationVector(float treeRadius, float treeHeight)
          Compute the branch translation vector.
protected  TreeBranchState computeRandomBranchState(float treeRadius, float treeHeight)
           
 TreeState createRandomTreeState(javax.vecmath.Point3d translationVector, int nbBranches, float height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEIGHT_RADIUS_RATIO

public static final int HEIGHT_RADIUS_RATIO
See Also:
Constant Field Values

HEIGHT_BRANCH_RADIAL_LENGTH_RATIO

public static final float HEIGHT_BRANCH_RADIAL_LENGTH_RATIO
Ratio between the length of branches compared to the tree height

See Also:
Constant Field Values
Constructor Detail

TreeStateFactory

public TreeStateFactory()
Method Detail

createRandomTreeState

public TreeState createRandomTreeState(javax.vecmath.Point3d translationVector,
                                       int nbBranches,
                                       float height)

computeRandomBranchState

protected TreeBranchState computeRandomBranchState(float treeRadius,
                                                   float treeHeight)

computeBranchTranslationVector

protected javax.vecmath.Vector3d computeBranchTranslationVector(float treeRadius,
                                                                float treeHeight)
Compute the branch translation vector.

Parameters:
treeRadius - the tree radius
treeHeight - the tree height
Returns:
the computed translation vector

computeBranchEndPoint

protected javax.vecmath.Point3d computeBranchEndPoint(double treeHeight,
                                                      boolean goingToPositiveX,
                                                      boolean goingToPositiveZ)
Compute the branch end point.

The end pĂ´int is computed as follows :

Parameters:
treeHeight - the tree height
goingToPositiveX - true of the x should be positive, false otherwise
goingToPositiveZ - true of the z should be positive, false otherwise
Returns:
the computed branch end point


Copyright © 2010. All Rights Reserved.