Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
Thing Class Referenceabstract

#include <Thing.h>

Inherits MemoryPoolObject.

Inherited by Drawable, and Object.

Public Member Functions

 Thing (const ThingTemplate *thingTemplate)
 
const ThingTemplategetTemplate () const
 
Bool isKindOf (KindOfType t) const
 
Bool isKindOfMulti (const KindOfMaskType &mustBeSet, const KindOfMaskType &mustBeClear) const
 
Bool isAnyKindOf (const KindOfMaskType &anyKindOf) const
 
void setPosition (const Coord3D *pos)
 
void setPositionZ (Real z)
 the nice thing about this is that we don't have to recalc out cached terrain stuff.
 
void setOrientation (Real angle)
 
const Coord3DgetPosition () const
 
Real getOrientation () const
 
const Coord3DgetUnitDirectionVector2D () const
 
void getUnitDirectionVector2D (Coord3D &dir) const
 
void getUnitDirectionVector3D (Coord3D &dir) const
 
Real getHeightAboveTerrain () const
 
Real getHeightAboveTerrainOrWater () const
 
Bool isAboveTerrain () const
 
Bool isAboveTerrainOrWater () const
 
Bool isSignificantlyAboveTerrain () const
 
void convertBonePosToWorldPos (const Coord3D *bonePos, const Matrix3D *boneTransform, Coord3D *worldPos, Matrix3D *worldTransform) const
 
void setTransformMatrix (const Matrix3D *mx)
 set the world transformation matrix
 
const Matrix3DgetTransformMatrix () const
 return the world transformation matrix
 
void transformPoint (const Coord3D *in, Coord3D *out)
 transform this point using the m_transform matrix of this thing
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 

Protected Member Functions

virtual Real calculateHeightAboveTerrain (void) const
 
virtual ObjectasObjectMeth ()
 
virtual DrawableasDrawableMeth ()
 
virtual const ObjectasObjectMeth () const
 
virtual const DrawableasDrawableMeth () const
 
virtual void reactToTransformChange (const Matrix3D *oldMtx, const Coord3D *oldPos, Real oldAngle)=0
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Friends

ObjectAsObject (Thing *thing)
 
DrawableAsDrawable (Thing *thing)
 
const ObjectAsObject (const Thing *thing)
 
const DrawableAsDrawable (const Thing *thing)
 

Detailed Description

A thing is the common base class for objects and drawables. It will hold common information to both and systems that need to work with both objects and drawables should work with things instead. You can not instantiate things, they are purely virtual

Definition at line 86 of file Thing.h.

Constructor & Destructor Documentation

◆ Thing()

Thing::Thing ( const ThingTemplate * thingTemplate)

Constructor

Definition at line 58 of file Thing.cpp.

Member Function Documentation

◆ asDrawableMeth() [1/2]

virtual Drawable * Thing::asDrawableMeth ( )
inlineprotectedvirtual

Reimplemented in Drawable.

Definition at line 152 of file Thing.h.

◆ asDrawableMeth() [2/2]

virtual const Drawable * Thing::asDrawableMeth ( ) const
inlineprotectedvirtual

Reimplemented in Drawable.

Definition at line 154 of file Thing.h.

◆ asObjectMeth() [1/2]

virtual Object * Thing::asObjectMeth ( )
inlineprotectedvirtual

Reimplemented in Object.

Definition at line 151 of file Thing.h.

◆ asObjectMeth() [2/2]

virtual const Object * Thing::asObjectMeth ( ) const
inlineprotectedvirtual

Reimplemented in Object.

Definition at line 153 of file Thing.h.

◆ calculateHeightAboveTerrain()

Real Thing::calculateHeightAboveTerrain ( void ) const
protectedvirtual

Reimplemented in Object.

Definition at line 287 of file Thing.cpp.

◆ convertBonePosToWorldPos()

void Thing::convertBonePosToWorldPos ( const Coord3D * bonePos,
const Matrix3D * boneTransform,
Coord3D * worldPos,
Matrix3D * worldTransform ) const

Definition at line 341 of file Thing.cpp.

◆ getHeightAboveTerrain()

Real Thing::getHeightAboveTerrain ( ) const

Definition at line 297 of file Thing.cpp.

◆ getHeightAboveTerrainOrWater()

Real Thing::getHeightAboveTerrainOrWater ( ) const

Definition at line 308 of file Thing.cpp.

◆ getOrientation()

Real Thing::getOrientation ( ) const
inline

Definition at line 123 of file Thing.h.

◆ getPosition()

const Coord3D * Thing::getPosition ( ) const
inline

Definition at line 122 of file Thing.h.

◆ getTemplate()

const ThingTemplate * Thing::getTemplate ( ) const

return the thing template for this thing.

Definition at line 94 of file Thing.cpp.

◆ getTransformMatrix()

const Matrix3D * Thing::getTransformMatrix ( void ) const
inline

return the world transformation matrix

Definition at line 142 of file Thing.h.

◆ getUnitDirectionVector2D() [1/2]

const Coord3D * Thing::getUnitDirectionVector2D ( ) const

Definition at line 100 of file Thing.cpp.

◆ getUnitDirectionVector2D() [2/2]

void Thing::getUnitDirectionVector2D ( Coord3D & dir) const

Definition at line 116 of file Thing.cpp.

◆ getUnitDirectionVector3D()

void Thing::getUnitDirectionVector3D ( Coord3D & dir) const

Definition at line 122 of file Thing.cpp.

◆ isAboveTerrain()

Bool Thing::isAboveTerrain ( ) const
inline

Definition at line 131 of file Thing.h.

◆ isAboveTerrainOrWater()

Bool Thing::isAboveTerrainOrWater ( ) const
inline

Definition at line 132 of file Thing.h.

◆ isAnyKindOf()

Bool Thing::isAnyKindOf ( const KindOfMaskType & anyKindOf) const

Definition at line 281 of file Thing.cpp.

◆ isKindOf()

Bool Thing::isKindOf ( KindOfType t) const

Definition at line 269 of file Thing.cpp.

◆ isKindOfMulti()

Bool Thing::isKindOfMulti ( const KindOfMaskType & mustBeSet,
const KindOfMaskType & mustBeClear ) const

Definition at line 275 of file Thing.cpp.

◆ isSignificantlyAboveTerrain()

Bool Thing::isSignificantlyAboveTerrain ( ) const

Ground vehicles moving down a slope will get slightly above the terrain. If we treat this as airborne, then they slide down slopes. This checks whether they are high enough that we should let them act like they're flying. jba.

If we treat this as airborne, then they slide down slopes. This checks whether they are high enough that we should let them act like they're flying. jba.

Definition at line 332 of file Thing.cpp.

◆ reactToTransformChange()

virtual void Thing::reactToTransformChange ( const Matrix3D * oldMtx,
const Coord3D * oldPos,
Real oldAngle )
protectedpure virtual

Implemented in Drawable, and Object.

◆ setOrientation()

void Thing::setOrientation ( Real angle)

Definition at line 198 of file Thing.cpp.

◆ setPosition()

void Thing::setPosition ( const Coord3D * pos)

Definition at line 169 of file Thing.cpp.

◆ setPositionZ()

void Thing::setPositionZ ( Real z)

the nice thing about this is that we don't have to recalc out cached terrain stuff.

Definition at line 133 of file Thing.cpp.

◆ setTransformMatrix()

void Thing::setTransformMatrix ( const Matrix3D * mx)

set the world transformation matrix

Set the world transformation matrix

Definition at line 250 of file Thing.cpp.

◆ transformPoint()

void Thing::transformPoint ( const Coord3D * in,
Coord3D * out )

transform this point using the m_transform matrix of this thing

Push the 'in' parameter through our transformation matrix and store in 'out'

@ todo this is dumb and we should not have to convert types

Definition at line 367 of file Thing.cpp.

Friends And Related Symbol Documentation

◆ AsDrawable [1/2]

const Drawable * AsDrawable ( const Thing * thing)
friend

Definition at line 93 of file Thing.h.

◆ AsDrawable [2/2]

Drawable * AsDrawable ( Thing * thing)
friend

Definition at line 91 of file Thing.h.

◆ AsObject [1/2]

const Object * AsObject ( const Thing * thing)
friend

Definition at line 92 of file Thing.h.

◆ AsObject [2/2]

Object * AsObject ( Thing * thing)
friend

Definition at line 90 of file Thing.h.


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