#include <eggTransform3d.h>
Inheritance diagram for EggTransform3d:
Public Types | |
enum | ComponentType { CT_invalid, CT_translate, CT_rotx, CT_roty, CT_rotz, CT_rotate, CT_scale, CT_uniform_scale, CT_matrix } |
Public Member Functions | |
EggTransform3d () | |
EggTransform3d (const EggTransform3d ©) | |
EggTransform3d & | operator= (const EggTransform3d ©) |
virtual | ~EggTransform3d () |
void | clear_transform () |
Resets the transform to empty, identity. | |
void | add_translate (const LVector3d &translate) |
Appends a translation operation to the current transform. | |
void | add_rotx (double angle) |
Appends a rotation about the X axis to the current transform. | |
void | add_roty (double angle) |
Appends a rotation about the Y axis to the current transform. | |
void | add_rotz (double angle) |
Appends a rotation about the Z axis to the current transform. | |
void | add_rotate (double angle, const LVector3d &axis) |
Appends a rotation about an arbitrary axis to the current transform. | |
void | add_rotate (const LQuaterniond &quat) |
Appends an arbitrary rotation to the current transform, expressed as a quaternion. | |
void | add_scale (const LVecBase3d &scale) |
Appends a possibly non-uniform scale to the current transform. | |
void | add_uniform_scale (double scale) |
Appends a uniform scale to the current transform. | |
void | add_matrix (const LMatrix4d &mat) |
Appends an arbitrary 4x4 matrix to the current transform. | |
bool | has_transform () const |
Returns true if the transform is nonempty, false if it is empty (no transform components have been added). | |
void | set_transform (const LMatrix4d &mat) |
Sets the overall transform as a 4x4 matrix. | |
const LMatrix4d & | get_transform () const |
Returns the overall transform as a 4x4 matrix. | |
bool | transform_is_identity () const |
Returns true if the described transform is identity, false otherwise. | |
int | get_num_components () const |
Returns the number of components that make up the transform. | |
ComponentType | get_component_type (int n) const |
Returns the type of the nth component. | |
double | get_component_number (int n) const |
Returns the solitary number associated with the nth component. | |
const LVector3d & | get_component_vector (int n) const |
Returns the 3-component vector associated with the nth component. | |
const LMatrix4d & | get_component_matrix (int n) const |
Returns the 4x4 matrix associated with the nth component. | |
void | write (ostream &out, int indent_level) const |
Writes the transform to the indicated stream in Egg format. | |
Protected Member Functions | |
void | internal_clear_transform () |
Resets the transform to empty without calling transform_changed(). | |
void | internal_add_matrix (const LMatrix4d &mat) |
Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed(). | |
void | internal_set_transform (const LMatrix4d &mat) |
Sets the overall transform without calling transform_changed(). | |
virtual void | transform_changed () |
This virtual method is called whenever the transform is changed; it is intended to provide a hook for derived classes (e.g. | |
Private Types | |
typedef pvector< Component > | Components |
Private Attributes | |
Components | _components |
LMatrix4d | _transform |
This is a 3-d transform, and therefore computes a 4x4 matrix.
Definition at line 43 of file eggTransform3d.h.
|
Definition at line 108 of file eggTransform3d.h. |
|
Definition at line 67 of file eggTransform3d.h. |
|
Definition at line 33 of file eggTransform3d.cxx. |
|
Definition at line 46 of file eggTransform3d.cxx. References _components, and _transform. |
|
Definition at line 74 of file eggTransform3d.cxx. References _components, and _transform. |
|
Appends an arbitrary 4x4 matrix to the current transform.
Definition at line 133 of file eggTransform3d.I. References INLINE, internal_set_transform(), and transform_changed(). |
|
Appends an arbitrary rotation to the current transform, expressed as a quaternion. This is converted to axis-angle notation for the egg file. Definition at line 186 of file eggTransform3d.cxx. References CT_rotx, CT_roty, and CT_translate. |
|
Appends a rotation about an arbitrary axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. Definition at line 165 of file eggTransform3d.cxx. References _components, _transform, CT_uniform_scale, and transform_changed(). Referenced by add_rotz(). |
|
Appends a rotation about the X axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. Definition at line 108 of file eggTransform3d.cxx. References _components, _transform, CT_rotz, and transform_changed(). |
|
Appends a rotation about the Y axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. Definition at line 127 of file eggTransform3d.cxx. References _components, _transform, CT_rotate, and transform_changed(). |
|
Appends a rotation about the Z axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. Definition at line 146 of file eggTransform3d.cxx. References add_rotate(), and transform_changed(). |
|
Appends a possibly non-uniform scale to the current transform.
Definition at line 202 of file eggTransform3d.cxx. |
|
Appends a translation operation to the current transform.
Definition at line 88 of file eggTransform3d.cxx. References _components, _transform, CT_rotx, and transform_changed(). |
|
Appends a uniform scale to the current transform.
Definition at line 218 of file eggTransform3d.cxx. References CT_invalid, CT_matrix, and CT_uniform_scale. |
|
Resets the transform to empty, identity.
Definition at line 117 of file eggTransform3d.I. References _components, and INLINE. |
|
Returns the 4x4 matrix associated with the nth component. It is an error to call this if the component type is not CT_matrix. Definition at line 289 of file eggTransform3d.I. |
|
Returns the solitary number associated with the nth component. In the case of a rotation, this is the angle in degrees to rotate; in the case of uniform scale, this is the amount of the scale. Other types do not use this property. Definition at line 248 of file eggTransform3d.I. |
|
Returns the type of the nth component.
Definition at line 226 of file eggTransform3d.I. References _components. |
|
Returns the 3-component vector associated with the nth component. This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a vector property. Definition at line 270 of file eggTransform3d.I. |
|
Returns the number of components that make up the transform.
Definition at line 213 of file eggTransform3d.I. References _components. |
|
Returns the overall transform as a 4x4 matrix.
Definition at line 182 of file eggTransform3d.I. References _components. Referenced by CharacterMaker::make_bundle(), and EggGroup::string_collide_flags(). |
|
Returns true if the transform is nonempty, false if it is empty (no transform components have been added).
Definition at line 151 of file eggTransform3d.I. References _components, _transform, and INLINE. |
|
Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed().
Definition at line 319 of file eggTransform3d.cxx. |
|
Resets the transform to empty without calling transform_changed().
Definition at line 303 of file eggTransform3d.cxx. Referenced by EggTransform3d::Component::~Component(). |
|
Sets the overall transform without calling transform_changed().
Definition at line 306 of file eggTransform3d.I. Referenced by add_matrix(). |
|
Definition at line 60 of file eggTransform3d.cxx. Referenced by EggGroup::EggGroup(). |
|
Sets the overall transform as a 4x4 matrix. This completely replaces whatever componentwise transform may have been defined. Definition at line 168 of file eggTransform3d.I. References _components, and INLINE. |
|
This virtual method is called whenever the transform is changed; it is intended to provide a hook for derived classes (e.g. EggGroup) to update their internal cache appropriately. Reimplemented in EggGroup. Definition at line 340 of file eggTransform3d.cxx. Referenced by add_matrix(), add_rotate(), add_rotx(), add_roty(), add_rotz(), add_translate(), and EggTransform3d::Component::~Component(). |
|
Returns true if the described transform is identity, false otherwise.
Definition at line 197 of file eggTransform3d.I. References _components. |
|
Writes the transform to the indicated stream in Egg format.
Reimplemented in EggGroup. Definition at line 235 of file eggTransform3d.cxx. |
|
Definition at line 109 of file eggTransform3d.h. Referenced by add_rotate(), add_rotx(), add_roty(), add_translate(), clear_transform(), EggTransform3d(), get_component_type(), get_num_components(), get_transform(), has_transform(), set_transform(), transform_is_identity(), and ~EggTransform3d(). |
|
Definition at line 110 of file eggTransform3d.h. Referenced by add_rotate(), add_rotx(), add_roty(), add_translate(), EggTransform3d(), has_transform(), and ~EggTransform3d(). |