public Tree(TreeGroup group, SpeedTreeWrapper speedTree, Vector3 location) { this.group = group; this.location = location; this.speedTree = speedTree; billboard0 = new float[20]; billboard1 = new float[20]; // set location for the instance speedTree.TreePosition = SpeedTreeUtil.ToSpeedTree(location); // set bounding box AxisAlignedBox stbox = SpeedTreeUtil.FromSpeedTree(speedTree.BoundingBox); this.bounds = new AxisAlignedBox(stbox.Minimum + location, stbox.Maximum + location); }
public void RealAddTreeType(String filename, float size, float sizeVariance, uint numInstances) { List<Vector3> locations = new List<Vector3>(); // create random locations for trees for (int i = 0; i < numInstances; i++) { locations.Add(RandomLocation()); } TreeGroup group = new TreeGroup(filename, size, sizeVariance, speedWind, this, locations); AddBounds(group.Bounds); group.WindStrength = WindStrength; groups.Add(group); }