Panda3D
|
Represents a transform that may be applied to a particular instance of a tree when added to the SpeedTreeNode. More...
#include "stTransform.h"
Public Member Functions | |
STTransform () | |
The default constructor creates an identity transform. | |
STTransform (const LPoint3 &pos, PN_stdfloat rotate=0.0f, PN_stdfloat scale=1.0f) | |
Construct a transform with componentwise inputs. | |
STTransform (const SpeedTree::CInstance &instance) | |
This is used internally to construct an STTransform from a SpeedTree::CInstance object. | |
STTransform (const STTransform ©) | |
STTransform (const TransformState *trans) | |
This constructor accepts a Panda TransformState, for instance as extracted from the scene graph. | |
STTransform (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat rotate, PN_stdfloat scale) | |
Construct a transform with componentwise inputs. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new SpeedTreeNode. | |
const LPoint3 & | get_pos () const |
Returns the translation component. | |
PN_stdfloat | get_rotate () const |
Returns the rotation component, in degrees counter-clockwise around the vertical axis. | |
PN_stdfloat | get_scale () const |
Returns the scale component, as a uniform scale value. | |
operator SpeedTree::CInstance () const | |
This is used internally to convert an STTransform into a SpeedTree::CInstance object. | |
STTransform | operator* (const STTransform &other) const |
Composes these transforms and returns the result. | |
void | operator*= (const STTransform &other) |
Composes these transforms and stores the result in-place. | |
void | operator= (const STTransform ©) |
void | output (std::ostream &out) const |
void | set_pos (const LPoint3 &pos) |
Replaces the translation component. | |
void | set_rotate (PN_stdfloat rotate) |
Replaces the rotation component. | |
void | set_scale (PN_stdfloat scale) |
Replaces the scale component. | |
operator CPT | TransformState () const |
void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static const STTransform & | ident_mat () |
Returns a global identity transform object. | |
Public Attributes | |
LPoint3 | _pos |
PN_stdfloat | _rotate |
PN_stdfloat | _scale |
Static Public Attributes | |
static STTransform | _ident_mat |
Represents a transform that may be applied to a particular instance of a tree when added to the SpeedTreeNode.
Definition at line 26 of file stTransform.h.
|
inline |
The default constructor creates an identity transform.
Definition at line 17 of file stTransform.I.
STTransform::STTransform | ( | const TransformState * | trans | ) |
This constructor accepts a Panda TransformState, for instance as extracted from the scene graph.
Definition at line 22 of file stTransform.cxx.
References TransformState::get_hpr, TransformState::get_pos, TransformState::get_uniform_scale(), TransformState::has_components(), and TransformState::has_uniform_scale().
|
inline |
Construct a transform with componentwise inputs.
Definition at line 28 of file stTransform.I.
|
inline |
Construct a transform with componentwise inputs.
Definition at line 39 of file stTransform.I.
|
inline |
Definition at line 50 of file stTransform.I.
|
inline |
This is used internally to construct an STTransform from a SpeedTree::CInstance object.
Definition at line 72 of file stTransform.I.
void STTransform::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager ) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new SpeedTreeNode.
Definition at line 66 of file stTransform.cxx.
References DatagramIterator::get_stdfloat().
Referenced by SpeedTreeNode::InstanceList::fillin().
|
inline |
Returns the translation component.
Definition at line 123 of file stTransform.I.
Referenced by operator*=(), and SpeedTreeNode::snap_to_terrain().
|
inline |
Returns the rotation component, in degrees counter-clockwise around the vertical axis.
Definition at line 141 of file stTransform.I.
|
inline |
Returns the scale component, as a uniform scale value.
Definition at line 157 of file stTransform.I.
|
inlinestatic |
Returns a global identity transform object.
Definition at line 107 of file stTransform.I.
|
inline |
This is used internally to convert an STTransform into a SpeedTree::CInstance object.
Definition at line 84 of file stTransform.I.
|
inline |
Composes these transforms and returns the result.
Definition at line 177 of file stTransform.I.
|
inline |
Composes these transforms and stores the result in-place.
Definition at line 165 of file stTransform.I.
References get_pos().
|
inline |
Definition at line 61 of file stTransform.I.
void STTransform::output | ( | std::ostream & | out | ) | const |
Definition at line 46 of file stTransform.cxx.
|
inline |
Replaces the translation component.
Definition at line 115 of file stTransform.I.
Referenced by SpeedTreeNode::snap_to_terrain().
|
inline |
Replaces the rotation component.
Accepts a rotation in degrees counter- clockwise around the vertical axis.
Definition at line 132 of file stTransform.I.
|
inline |
Replaces the scale component.
Accepts a uniform scale value.
Definition at line 149 of file stTransform.I.
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition at line 55 of file stTransform.cxx.
References Datagram::add_stdfloat().
Referenced by SpeedTreeNode::InstanceList::write_datagram().
|
static |
Definition at line 64 of file stTransform.h.
LPoint3 STTransform::_pos |
Definition at line 60 of file stTransform.h.
PN_stdfloat STTransform::_rotate |
Definition at line 61 of file stTransform.h.
PN_stdfloat STTransform::_scale |
Definition at line 62 of file stTransform.h.