|
wavelength 1.0.0
|
Mix-in for an object with a local transform and a world transform derived from its parent's. More...
#include <rndtransformable.h>


Public Types | |
| enum | Billboard { kBillboardNone = 0 , kBillboardX = 1 , kBillboardY = 2 , kBillboardZ = 4 , kBillboardXZ = 8 , kBillboardXYZ = 16 , kBillboardSimpleXYZ = 32 , kBillboardLocalRotate = 64 , kBillboardScale = 128 , kBillboardScaleX = 129 , kBillboardScaleY = 130 , kBillboardScaleZ = 132 , kBillboardScaleXZ = 136 , kBillboardScaleXYZ = 144 , kBillboardScaleSimpleXYZ = 160 } |
| How the world transform turns to face the current camera. More... | |
Public Member Functions | |
| RndTransformable () | |
| Construct a transformable with identity transforms, no origin offset, and no billboard. | |
| ~RndTransformable () override | |
| Drop the references on the children. | |
| virtual void | SetBillboard (int nBillboard) |
| Set the billboard mode. | |
| virtual int | UpdateWorldXfm (RndTransformable *pParent, int bForce) |
| Recompute the world transform when it, or the parent's, changed, and then the children's. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the transformable. | |
| void | Save (BinStream &stream) override |
| Write the transforms, the names of the children, the billboard mode, and the origin. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace a child with another object. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy the transforms, the billboard mode, the origin, and the children when the flags request them. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote, or an earlier version of it. | |
| void | SetOrigin (const Vector3 &origin) |
| Set the point the world transform subtracts first when there is no billboard. | |
| RndTransformable * | Parent () |
| Find the transformable whose children include this object. | |
| bool | AddTrans (RndTransformable *pTrans) |
| Append a child and mark its world transform dirty. | |
| void | RemoveTrans (RndTransformable *pTrans) |
| Remove a child. | |
| void | ClearTrans () |
| Remove every child. | |
| const Transform & | BillboardXfm () |
| Report the world transform turned to face the current camera. | |
| const Transform & | GetLocalXfm () const |
| Transform & | GetLocalXfm () |
| void | SetLocalXfm (const Transform &xfm) |
| const Transform & | GetWorldXfm () const |
| Transform & | GetWorldXfm () |
| int | GetDirty () const |
| void | SetDirty (int nDirty) |
| const std::list< RndTransformable * > & | GetTransList () const |
| Public Member Functions inherited from RndObject | |
| RndObject (const char *pszName) | |
| Construct an object and register it under a name. | |
| virtual | ~RndObject () |
| Notify every referrer, then erase the registration. | |
| virtual const char * | ClassName () const =0 |
| Report the name of the object's most derived class. | |
| void | SetName (const char *pszName) |
| Register the object under a different name. | |
| void | AddRef (RndObject *pReferrer) |
| Register an object as a store of a pointer to this one. | |
| void | RemoveRef (RndObject *pReferrer) |
| Drop the first registration AddRef() made for a referrer. | |
| const char * | GetName () const |
| const std::list< RndObject * > & | GetRefs () const |
| int | GetInternal () const |
| void | SetInternal (int nInternal) |
Static Public Member Functions | |
| static void | CollectChildren (std::list< RndObject * > &objects, RndTransformable *pTransformable) |
| Append every transform descendant of a transformable, depth first, each before its descendants. | |
Static Public Attributes | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndObject | |
| static constexpr int | kCopyChildLists = 0x200 |
| The bit of the Copy() flags that copies the child lists of the mix-ins. | |
Protected Member Functions | |
| void | ReleaseTransRefs () |
| Drop the reference on every child without emptying the list. | |
| void | AcquireTransRefs () |
| Take a reference on every child. | |
Protected Attributes | |
| std::list< RndTransformable * > | mTransList |
| Transform | mLocalXfm |
| Transform | mWorldXfm |
| Vector3 | mOrigin |
| int | mDirty |
| int | mBillboard |
| Protected Attributes inherited from RndObject | |
| std::list< RndObject * > | mRefs |
| String | mName |
Mix-in for an object with a local transform and a world transform derived from its parent's.
The RTTI includes the class name and records RndObject as a virtual base. Every entry of mTransList registers this object as a referrer through RndObject::AddRef().
How the world transform turns to face the current camera.
| RndTransformable::RndTransformable | ( | ) |
Construct a transformable with identity transforms, no origin offset, and no billboard.
The world transform starts dirty. The constructor has no out-of-line copy.
|
override |
Drop the references on the children.
|
virtual |
|
virtual |
Recompute the world transform when it, or the parent's, changed, and then the children's.
Without a billboard, the origin is subtracted before the transform applies.
| pParent | The parent, or null for a root. |
| bForce | Non-zero to recompute even when nothing changed. |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Copy the transforms, the billboard mode, the origin, and the children when the flags request them.
| pSource | The transformable to copy from. |
| nFlags | The set of fields to copy. RndObject::kCopyChildLists copies the children. |
Implements RndObject.
Reimplemented in RndView.
|
overridevirtual |
| void RndTransformable::SetOrigin | ( | const Vector3 & | origin | ) |
Set the point the world transform subtracts first when there is no billboard.
| origin | The point. |
| RndTransformable * RndTransformable::Parent | ( | ) |
Find the transformable whose children include this object.
| bool RndTransformable::AddTrans | ( | RndTransformable * | pTrans | ) |
Append a child and mark its world transform dirty.
A transformable already among the children is not added again.
| pTrans | The new child. |
| void RndTransformable::RemoveTrans | ( | RndTransformable * | pTrans | ) |
Remove a child.
| pTrans | The child. |
| void RndTransformable::ClearTrans | ( | ) |
Remove every child.
| const Transform & RndTransformable::BillboardXfm | ( | ) |
Report the world transform turned to face the current camera.
Without a billboard the world transform itself is reported. Otherwise the result is built in one shared transform that the next call replaces.
|
inlinestatic |
Append every transform descendant of a transformable, depth first, each before its descendants.
Each unit that uses the inline routine emits a copy. The first address is the copy of RndManager, and the second the copy of UIList.
| objects | The list to append to. |
| pTransformable | The transformable to start from, or null. |
|
inline |
|
inline |
|
inline |
| xfm | The transform relative to the parent. |
|
inline |
|
inline |
|
inline |
|
inline |
| nDirty | Non-zero when mWorldXfm is out of date. |
|
inline |
|
protected |
Drop the reference on every child without emptying the list.
The name is inferred.
|
protected |
Take a reference on every child.
The name is inferred.
|
static |
|
protected |
The children. Each follows this object.
|
protected |
The transform relative to the parent.
|
protected |
The transform relative to the world.
|
protected |
The point the world transform subtracts.
|
protected |
Non-zero when mWorldXfm is out of date.
|
protected |
The Billboard mode.