39 return (
int)_trees.
size();
50 nassertr(n >= 0 && n < (
int)_trees.
size(), NULL);
52 return instance_list->get_tree();
65 return *instance_list;
76 nassertr(n >= 0 && n < (
int)_trees.
size(), NULL);
78 _needs_repopulate =
true;
79 return (
STTree *)instance_list->get_tree();
150 _global_time_delta = delta;
163 return _global_time_delta;
171 INLINE SpeedTreeNode::InstanceList::
172 InstanceList(
const STTree *tree) : _tree((
STTree *)tree) {
182 return _tree < other._tree;
202 return (
int)_instances.size();
214 return _instances[n];
225 nassertv(n >= 0 && n < (
int)_instances.size());
226 _instances[n] = transform;
238 _instances.push_back(transform);
239 return ((
int)_instances.size() - 1);
249 nassertv(n >= 0 && n < (
int)_instances.size());
250 _instances.erase(_instances.begin() + n);
258 INLINE SpeedTreeNode::DrawCallback::
STTransform get_instance(int n) const
Returns the transform of the nth instance of this tree.
STTerrain * get_terrain() const
Returns the terrain associated with the node, or NULL if there is no terrain.
bool has_terrain() const
Returns true if a valid terrain has been associated with the node, false otherwise.
size_type_0 size() const
Returns the number of elements in the ordered vector.
void clear_terrain()
Removes the terrain associated with the node.
bool is_valid() const
Returns true if the node is valid and ready to render, false otherwise.
This is the abstract base class that defines the interface needed to describe a terrain for rendering...
bool operator<(const InstanceList &other) const
Used for comparison for ov_set.
static double get_global_time_delta()
Returns an offset that is to be added each frame to the global clock's frame_time for the purpose of ...
STTree * modify_tree(int n)
Returns a modifiable STTree pointer for the nth tree instance.
static void set_global_time_delta(double delta)
Specifies an offset that is to be added each frame to the global clock's frame_time for the purpose o...
void set_time_delta(double delta)
Specifies an offset that is to be added each frame to the global clock's frame_time for the purpose o...
int get_num_instances() const
Returns the number of instances of this tree.
const InstanceList & get_instance_list(int n) const
Returns a list of transforms that corresponds to the instances at which the nth tree appears...
double get_time_delta() const
Returns an offset that is to be added each frame to the global clock's frame_time for the purpose of ...
void set_terrain(STTerrain *terrain)
Associated a terrain with the node.
const STTree * get_tree() const
Returns the particular tree this list refers to.
void set_instance(int n, const STTransform &transform)
Replaces the transform of the nth instance of this tree.
void remove_instance(int n)
Removes the nth instance of this tree.
Interfaces with the SpeedTree library to render SpeedTree objects, especially trees, within the Panda3D scene graph.
int get_num_trees() const
Returns the number of unique tree objects that have been added to the node.
const STTree * get_tree(int n) const
Returns the STTree pointer for the nth tree.
int add_instance(const STTransform &transform)
Adds a new instance of this tree at the indicated transform.
Encapsulates a single tree model in the SpeedTree library, as loaded from an SRT file.