InstanceList

class InstanceList

Bases: CopyOnWriteObject

This structure stores a list of per-instance data, used by InstancedNode.

New in version 1.11.0.

Inheritance diagram

Inheritance diagram of InstanceList

class Instance

An individual instance in an InstanceList.

New in version 1.11.0.

Instance(InstanceList::Instance const&) = default

Initializes an instance with the identity transform.

Initializes an instance with the given transformation.

LVecBase3 get_hpr(void) const
LMatrix4 const &get_mat(void) const
LPoint3 get_pos(void) const
LQuaternion get_quat(void) const
LVecBase3 get_scale(void) const
TransformState const *get_transform(void) const
void set_hpr(LVecBase3 const&)
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
void set_mat(LMatrix4 const &mat)
void set_pos(LPoint3 const&)
void set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
void set_quat(LQuaternion const&)
void set_scale(LVecBase3 const&)
void set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
void set_transform(ConstPointerTo<TransformState>)
InstanceList(void)
InstanceList(InstanceList const &copy)
void append(InstanceList::Instance instance)
void append(TransformState const *transform)
void append(LPoint3 const &pos, LVecBase3 const &hpr = LVecBase3(0), LVecBase3 const &scale = LVecBase3(1))
void append(LPoint3 const &pos, LQuaternion const &quat, LVecBase3 const &scale = LVecBase3(1))

Adds a new instance with the indicated transformation to the list.

void clear(void)

Empties the instance list.

static TypeHandle get_class_type(void)
void reserve(std::size_t)

Reserves space for the given number of instances.

std::size_t size(void) const

Returns the total number of instances in the list.

bool validate_ptr(void const *ptr)
void xform(LMatrix4 const &mat)

Transforms all of the instances in the list by the indicated matrix.