Panda3D

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
STTransform Class Reference

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. More...
| STTransform (const LPoint3 &pos, PN_stdfloat rotate=0.0f, PN_stdfloat scale=1.0f)
| Construct a transform with componentwise inputs. More...
| STTransform (const SpeedTree::CInstance &instance)
| This is used internally to construct an STTransform from a SpeedTree::CInstance object. More...
| STTransform (const STTransform &copy)
| STTransform (const TransformState *trans)
| This constructor accepts a Panda TransformState, for instance as extracted from the scene graph. More...
| STTransform (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat rotate, PN_stdfloat scale)
| Construct a transform with componentwise inputs. More...
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. More...
const LPoint3 & | get_pos () const
| Returns the translation component. More...
PN_stdfloat | get_rotate () const
| Returns the rotation component, in degrees counter-clockwise around the vertical axis. More...
PN_stdfloat | get_scale () const
| Returns the scale component, as a uniform scale value. More...
| operator SpeedTree::CInstance () const
| This is used internally to convert an STTransform into a SpeedTree::CInstance object. More...
STTransform | operator* (const STTransform &other) const
| Composes these transforms and returns the result. More...
void | operator*= (const STTransform &other)
| Composes these transforms and stores the result in-place. More...
void | operator= (const STTransform &copy)
void | output (std::ostream &out) const
void | set_pos (const LPoint3 &pos)
| Replaces the translation component. More...
void | set_rotate (PN_stdfloat rotate)
| Replaces the rotation component. More...
void | set_scale (PN_stdfloat scale)
| Replaces the scale component. More...
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. More...

## Static Public Member Functions
static const STTransform & | ident_mat ()
| Returns a global identity transform object. More...

## Public Attributes
LPoint3 | _pos
PN_stdfloat | _rotate
PN_stdfloat | _scale

## Static Public Attributes
static STTransform | _ident_mat

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ STTransform() [1/5]

STTransform::STTransform | ( |  | ) |
| inline

The default constructor creates an identity transform.

Definition at line 17 of file stTransform.I.

## ◆ STTransform() [2/5]

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.

## ◆ STTransform() [3/5]

STTransform::STTransform | ( | const LPoint3 & | pos,
|  | PN_stdfloat | rotate = `0.0f`,
|  | PN_stdfloat | scale = `1.0f`
| ) |  |
| inline

Construct a transform with componentwise inputs.

Definition at line 28 of file stTransform.I.

## ◆ STTransform() [4/5]

STTransform::STTransform | ( | PN_stdfloat | x,
|  | PN_stdfloat | y,
|  | PN_stdfloat | z,
|  | PN_stdfloat | rotate,
|  | PN_stdfloat | scale
| ) |  |
| inline

Construct a transform with componentwise inputs.

Definition at line 39 of file stTransform.I.

## ◆ STTransform() [5/5]

STTransform::STTransform | ( | const SpeedTree::CInstance & | instance | ) |
| inline

This is used internally to construct an STTransform from a SpeedTree::CInstance object.

Definition at line 72 of file stTransform.I.

## Member Function Documentation

## ◆ fillin()

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().

## ◆ get_pos()

const LPoint3 & STTransform::get_pos | ( |  | ) | const
| inline

Returns the translation component.

Definition at line 123 of file stTransform.I.

## ◆ get_rotate()

PN_stdfloat STTransform::get_rotate | ( |  | ) | const
| inline

Returns the rotation component, in degrees counter-clockwise around the vertical axis.

Definition at line 141 of file stTransform.I.

## ◆ get_scale()

PN_stdfloat STTransform::get_scale | ( |  | ) | const
| inline

Returns the scale component, as a uniform scale value.

Definition at line 157 of file stTransform.I.

## ◆ ident_mat()

const STTransform & STTransform::ident_mat | ( |  | ) |
| inline static

Returns a global identity transform object.

Definition at line 107 of file stTransform.I.

## ◆ operator SpeedTree::CInstance()

STTransform::operator SpeedTree::CInstance | ( |  | ) | const
| inline

This is used internally to convert an STTransform into a SpeedTree::CInstance object.

Definition at line 84 of file stTransform.I.

## ◆ operator*()

STTransform STTransform::operator* | ( | const STTransform & | other | ) | const
| inline

Composes these transforms and returns the result.

Definition at line 177 of file stTransform.I.

## ◆ operator*=()

void STTransform::operator*= | ( | const STTransform & | other | ) |
| inline

Composes these transforms and stores the result in-place.

Definition at line 165 of file stTransform.I.

## ◆ set_pos()

void STTransform::set_pos | ( | const LPoint3 & | pos | ) |
| inline

Replaces the translation component.

Definition at line 115 of file stTransform.I.

## ◆ set_rotate()

void STTransform::set_rotate | ( | PN_stdfloat | rotate | ) |
| inline

Replaces the rotation component.

Accepts a rotation in degrees counter- clockwise around the vertical axis.

Definition at line 132 of file stTransform.I.

## ◆ set_scale()

void STTransform::set_scale | ( | PN_stdfloat | scale | ) |
| inline

Replaces the scale component.

Accepts a uniform scale value.

Definition at line 149 of file stTransform.I.

## ◆ write_datagram()

void STTransform::write_datagram | ( | BamWriter * | manager,
|  | Datagram & | dg
| ) |  |

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().

The documentation for this class was generated from the following files:

- panda/src/speedtree/stTransform.h
- panda/src/speedtree/stTransform.cxx
- panda/src/speedtree/stTransform.I