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

#include <W3DModelDraw.h>

Inherits DrawModule, and ObjectDrawInterface.

Inherited by W3DDependencyModelDraw, W3DOverlordAircraftDraw, W3DScienceModelDraw, W3DSupplyDraw, W3DTankDraw, W3DTankTruckDraw, and W3DTruckDraw.

Public Member Functions

 W3DModelDraw (Thing *thing, const ModuleData *moduleData)
 
virtual void preloadAssets (TimeOfDay timeOfDay)
 preloading assets
 
virtual void doDrawModule (const Matrix3D *transformMtx)
 the draw method
 
virtual void setShadowsEnabled (Bool enable)
 
virtual void releaseShadows (void)
 frees all shadow resources used by this module - used by Options screen.
 
virtual void allocateShadows (void)
 create shadow resources if not already present. Used by Options screen.
 
virtual void setFullyObscuredByShroud (Bool fullyObscured)
 
virtual void setTerrainDecal (TerrainDecalType type)
 
virtual Bool isVisible () const
 for limiting tree sway, etc to visible objects
 
virtual void reactToTransformChange (const Matrix3D *oldMtx, const Coord3D *oldPos, Real oldAngle)
 
virtual void reactToGeometryChange ()
 
virtual Bool clientOnly_getRenderObjInfo (Coord3D *pos, Real *boundingSphereRadius, Matrix3D *transform) const
 
virtual Bool clientOnly_getRenderObjBoundBox (OBBoxClass *boundbox) const
 
virtual Bool clientOnly_getRenderObjBoneTransform (const AsciiString &boneName, Matrix3D *set_tm) const
 
virtual Int getPristineBonePositionsForConditionState (const ModelConditionFlags &condition, const char *boneNamePrefix, Int startIndex, Coord3D *positions, Matrix3D *transforms, Int maxBones) const
 
virtual Int getCurrentBonePositions (const char *boneNamePrefix, Int startIndex, Coord3D *positions, Matrix3D *transforms, Int maxBones) const
 
virtual Bool getCurrentWorldspaceClientBonePositions (const char *boneName, Matrix3D &transform) const
 
virtual Bool getProjectileLaunchOffset (const ModelConditionFlags &condition, WeaponSlotType wslot, Int specificBarrelToUse, Matrix3D *launchPos, WhichTurretType tur, Coord3D *turretRotPos, Coord3D *turretPitchPos=NULL) const
 
virtual void updateProjectileClipStatus (UnsignedInt shotsRemaining, UnsignedInt maxShots, WeaponSlotType slot)
 This will do the show/hide work if ProjectileBoneFeedbackEnabled is set.
 
virtual void updateDrawModuleSupplyStatus (Int maxSupply, Int currentSupply)
 This will do visual feedback on Supplies carried.
 
virtual void notifyDrawModuleDependencyCleared ()
 if you were waiting for something before you drew, it's ready now
 
virtual void setHidden (Bool h)
 
virtual void replaceModelConditionState (const ModelConditionFlags &c)
 
virtual void replaceIndicatorColor (Color color)
 
virtual Bool handleWeaponFireFX (WeaponSlotType wslot, Int specificBarrelToUse, const FXList *fxl, Real weaponSpeed, const Coord3D *victimPos, Real damageRadius)
 
virtual Int getBarrelCount (WeaponSlotType wslot) const
 
virtual void setSelectable (Bool selectable)
 
virtual void setAnimationLoopDuration (UnsignedInt numFrames)
 
virtual void setAnimationCompletionTime (UnsignedInt numFrames)
 
virtual void setPauseAnimation (Bool pauseAnim)
 
virtual void setAnimationFrame (int frame)
 
virtual void updateSubObjects ()
 
virtual void showSubObject (const AsciiString &name, Bool show)
 
virtual ObjectDrawInterfacegetObjectDrawInterface ()
 
virtual const ObjectDrawInterfacegetObjectDrawInterface () const
 
RenderObjClassgetRenderObject ()
 
virtual Bool updateBonesForClientParticleSystems (void)
 this will reposition particle systems on the fly ML
 
virtual void onDrawableBoundToObject ()
 
virtual void setTerrainDecalSize (Real x, Real y)
 
virtual void setTerrainDecalOpacity (Real o)
 
- Public Member Functions inherited from DrawModule
 DrawModule (Thing *thing, const ModuleData *moduleData)
 
virtual Bool isLaser () const
 
virtual DebrisDrawInterfacegetDebrisDrawInterface ()
 
virtual const DebrisDrawInterfacegetDebrisDrawInterface () const
 
virtual TracerDrawInterfacegetTracerDrawInterface ()
 
virtual const TracerDrawInterfacegetTracerDrawInterface () const
 
virtual RopeDrawInterfacegetRopeDrawInterface ()
 
virtual const RopeDrawInterfacegetRopeDrawInterface () const
 
virtual LaserDrawInterfacegetLaserDrawInterface ()
 
virtual const LaserDrawInterfacegetLaserDrawInterface () const
 
- Public Member Functions inherited from DrawableModule
 DrawableModule (Thing *thing, const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
- Public Member Functions inherited from Module
 Module (const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual NameKeyType getModuleNameKey () const =0
 
NameKeyType getModuleTagNameKey () const
 
virtual void onObjectCreated ()
 
virtual void onDelete (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void onRenderObjRecreated (void)
 
const ModelConditionInfogetCurState () const
 
void setModelState (const ModelConditionInfo *newState)
 
const ModelConditionInfofindBestInfo (const ModelConditionFlags &c) const
 
void handleClientTurretPositioning ()
 
void handleClientRecoil ()
 
void recalcBonesForClientParticleSystems ()
 
void stopClientParticleSystems ()
 
void doHideShowSubObjs (const std::vector< ModelConditionInfo::HideShowSubObjInfo > *vec)
 
virtual void adjustTransformMtx (Matrix3D &mtx) const
 
Real getCurAnimDistanceCovered () const
 
Bool setCurAnimDurationInMsec (Real duration)
 
Bool getFullyObscuredByShroud () const
 
- Protected Member Functions inherited from DrawableModule
DrawablegetDrawable ()
 
const DrawablegetDrawable () const
 
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from Module
const ModuleDatagetModuleData () const
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Additional Inherited Members

- Static Public Member Functions inherited from DrawModule
static ModuleType getModuleType ()
 
static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from Module
static ModuleDatafriend_newModuleData (INI *ini)
 

Detailed Description

Definition at line 340 of file W3DModelDraw.h.

Constructor & Destructor Documentation

◆ W3DModelDraw()

W3DModelDraw::W3DModelDraw ( Thing * thing,
const ModuleData * moduleData )

Definition at line 1720 of file W3DModelDraw.cpp.

Member Function Documentation

◆ adjustTransformMtx()

void W3DModelDraw::adjustTransformMtx ( Matrix3D & mtx) const
protectedvirtual

Reimplemented in W3DDependencyModelDraw.

Definition at line 1994 of file W3DModelDraw.cpp.

◆ allocateShadows()

void W3DModelDraw::allocateShadows ( void )
virtual

create shadow resources if not already present. Used by Options screen.

Create shadow resources if not already present. This is used to dynamically enable/disable shadows by the options screen

Implements DrawModule.

Definition at line 1853 of file W3DModelDraw.cpp.

◆ clientOnly_getRenderObjBoneTransform()

Bool W3DModelDraw::clientOnly_getRenderObjBoneTransform ( const AsciiString & boneName,
Matrix3D * set_tm ) const
virtual

Implements ObjectDrawInterface.

Definition at line 3537 of file W3DModelDraw.cpp.

◆ clientOnly_getRenderObjBoundBox()

Bool W3DModelDraw::clientOnly_getRenderObjBoundBox ( OBBoxClass * boundbox) const
virtual

Implements ObjectDrawInterface.

Definition at line 3516 of file W3DModelDraw.cpp.

◆ clientOnly_getRenderObjInfo()

Bool W3DModelDraw::clientOnly_getRenderObjInfo ( Coord3D * pos,
Real * boundingSphereRadius,
Matrix3D * transform ) const
virtual

Implements ObjectDrawInterface.

Definition at line 3236 of file W3DModelDraw.cpp.

◆ doDrawModule()

void W3DModelDraw::doDrawModule ( const Matrix3D * transformMtx)
virtual

◆ doHideShowSubObjs()

void W3DModelDraw::doHideShowSubObjs ( const std::vector< ModelConditionInfo::HideShowSubObjInfo > * vec)
protected

Definition at line 2342 of file W3DModelDraw.cpp.

◆ findBestInfo()

const ModelConditionInfo * W3DModelDraw::findBestInfo ( const ModelConditionFlags & c) const
protected

Definition at line 3683 of file W3DModelDraw.cpp.

◆ getBarrelCount()

Int W3DModelDraw::getBarrelCount ( WeaponSlotType wslot) const
virtual

Implements ObjectDrawInterface.

Definition at line 3689 of file W3DModelDraw.cpp.

◆ getCurAnimDistanceCovered()

Real W3DModelDraw::getCurAnimDistanceCovered ( ) const
protected

Definition at line 2256 of file W3DModelDraw.cpp.

◆ getCurrentBonePositions()

Int W3DModelDraw::getCurrentBonePositions ( const char * boneNamePrefix,
Int startIndex,
Coord3D * positions,
Matrix3D * transforms,
Int maxBones ) const
virtual

Implements ObjectDrawInterface.

Definition at line 3569 of file W3DModelDraw.cpp.

◆ getCurrentWorldspaceClientBonePositions()

Bool W3DModelDraw::getCurrentWorldspaceClientBonePositions ( const char * boneName,
Matrix3D & transform ) const
virtual

Implements ObjectDrawInterface.

Definition at line 3555 of file W3DModelDraw.cpp.

◆ getCurState()

const ModelConditionInfo * W3DModelDraw::getCurState ( ) const
inlineprotected

Definition at line 437 of file W3DModelDraw.h.

◆ getFullyObscuredByShroud()

Bool W3DModelDraw::getFullyObscuredByShroud ( ) const
inlineprotected

Definition at line 452 of file W3DModelDraw.h.

◆ getObjectDrawInterface() [1/2]

virtual ObjectDrawInterface * W3DModelDraw::getObjectDrawInterface ( )
inlinevirtual

Reimplemented from DrawModule.

Definition at line 422 of file W3DModelDraw.h.

◆ getObjectDrawInterface() [2/2]

virtual const ObjectDrawInterface * W3DModelDraw::getObjectDrawInterface ( ) const
inlinevirtual

Reimplemented from DrawModule.

Definition at line 423 of file W3DModelDraw.h.

◆ getPristineBonePositionsForConditionState()

Int W3DModelDraw::getPristineBonePositionsForConditionState ( const ModelConditionFlags & condition,
const char * boneNamePrefix,
Int startIndex,
Coord3D * positions,
Matrix3D * transforms,
Int maxBones ) const
virtual

Find the bone(s) with the given name and return their positions and/or transforms in the given arrays. We look for a bone named "boneNamePrefixQQ", where QQ is 01, 02, 03, etc, starting at the value of "startIndex". Want to look for just a specific boneName with no numeric suffix? just pass zero (0) for startIndex. (no, we never look for "boneNamePrefix00".) We copy up to 'maxBones' into the array(s), and return the total count found.

NOTE: this returns the positions and transform for the "ideal" model... that is, at its default rotation and scale, located at (0,0,0). You'll have to concatenate an Object's position and transform onto these in order to move 'em into "world space"!

NOTE: this isn't very fast. Please call it sparingly and cache the result.

Implements ObjectDrawInterface.

Definition at line 3403 of file W3DModelDraw.cpp.

◆ getProjectileLaunchOffset()

Bool W3DModelDraw::getProjectileLaunchOffset ( const ModelConditionFlags & condition,
WeaponSlotType wslot,
Int specificBarrelToUse,
Matrix3D * launchPos,
WhichTurretType tur,
Coord3D * turretRotPos,
Coord3D * turretPitchPos = NULL ) const
virtual

Implements ObjectDrawInterface.

Definition at line 3253 of file W3DModelDraw.cpp.

◆ getRenderObject()

RenderObjClass * W3DModelDraw::getRenderObject ( )
inline
Todo
: I had to make this public because W3DDevice needs access for casting shadows -MW

Definition at line 426 of file W3DModelDraw.h.

◆ handleClientRecoil()

void W3DModelDraw::handleClientRecoil ( )
protected

Definition at line 2491 of file W3DModelDraw.cpp.

◆ handleClientTurretPositioning()

void W3DModelDraw::handleClientTurretPositioning ( )
protected

Definition at line 2415 of file W3DModelDraw.cpp.

◆ handleWeaponFireFX()

Bool W3DModelDraw::handleWeaponFireFX ( WeaponSlotType wslot,
Int specificBarrelToUse,
const FXList * fxl,
Real weaponSpeed,
const Coord3D * victimPos,
Real damageRadius )
virtual
Todo
Once Firepoint bones are actually implemented, this matrix will become correct. Unless of course they decide to not have the tracers come out of the windows, but rather go towards the target. In that case, tracers will have to be rewritten to be "point towards secondary" instead of "point straight ahead" which assumes we are facing the target.

Implements ObjectDrawInterface.

Definition at line 3696 of file W3DModelDraw.cpp.

◆ isVisible()

Bool W3DModelDraw::isVisible ( ) const
virtual

for limiting tree sway, etc to visible objects

Reimplemented from DrawModule.

Definition at line 3916 of file W3DModelDraw.cpp.

◆ notifyDrawModuleDependencyCleared()

virtual void W3DModelDraw::notifyDrawModuleDependencyCleared ( )
inlinevirtual

if you were waiting for something before you drew, it's ready now

Implements ObjectDrawInterface.

Reimplemented in W3DDependencyModelDraw.

Definition at line 382 of file W3DModelDraw.h.

◆ onDrawableBoundToObject()

void W3DModelDraw::onDrawableBoundToObject ( void )
virtual

this is called whenever a drawable is bound to the object. drawable is NOT guaranteed to be non-null.

Reimplemented from Module.

Definition at line 1782 of file W3DModelDraw.cpp.

◆ onRenderObjRecreated()

virtual void W3DModelDraw::onRenderObjRecreated ( void )
inlineprotectedvirtual

Reimplemented in W3DTankDraw, W3DTankTruckDraw, and W3DTruckDraw.

Definition at line 435 of file W3DModelDraw.h.

◆ preloadAssets()

void W3DModelDraw::preloadAssets ( TimeOfDay timeOfDay)
virtual

preloading assets

Preload any assets for the time of day requested

Reimplemented from Module.

Definition at line 3907 of file W3DModelDraw.cpp.

◆ reactToGeometryChange()

virtual void W3DModelDraw::reactToGeometryChange ( )
inlinevirtual

Implements DrawModule.

Reimplemented in W3DSupplyDraw, W3DTankTruckDraw, and W3DTruckDraw.

Definition at line 370 of file W3DModelDraw.h.

◆ reactToTransformChange()

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

Implements DrawModule.

Definition at line 3649 of file W3DModelDraw.cpp.

◆ recalcBonesForClientParticleSystems()

void W3DModelDraw::recalcBonesForClientParticleSystems ( )
protected

Definition at line 2589 of file W3DModelDraw.cpp.

◆ releaseShadows()

void W3DModelDraw::releaseShadows ( void )
virtual

frees all shadow resources used by this module - used by Options screen.

Free all data used by this model's shadow. This is used to dynamically enable/disable shadows by the options screen

Implements DrawModule.

Definition at line 1845 of file W3DModelDraw.cpp.

◆ replaceIndicatorColor()

void W3DModelDraw::replaceIndicatorColor ( Color color)
virtual

Implements ObjectDrawInterface.

Definition at line 3212 of file W3DModelDraw.cpp.

◆ replaceModelConditionState()

void W3DModelDraw::replaceModelConditionState ( const ModelConditionFlags & c)
virtual

Implements ObjectDrawInterface.

Definition at line 3184 of file W3DModelDraw.cpp.

◆ setAnimationCompletionTime()

void W3DModelDraw::setAnimationCompletionTime ( UnsignedInt numFrames)
virtual

similar to the above, but assumes that the current state is a "ONCE", and is smart about transition states... if there is a transition state "inbetween", it is included in the completion time.

Implements ObjectDrawInterface.

Definition at line 3799 of file W3DModelDraw.cpp.

◆ setAnimationFrame()

void W3DModelDraw::setAnimationFrame ( int frame)
virtual

Implements ObjectDrawInterface.

Definition at line 3821 of file W3DModelDraw.cpp.

◆ setAnimationLoopDuration()

void W3DModelDraw::setAnimationLoopDuration ( UnsignedInt numFrames)
virtual

This call says, "I want the current animation (if any) to take n frames to complete a single cycle". If it's a looping anim, each loop will take n frames. someday, we may want to add the option to insert "pad" frames at the start and/or end, but for now, we always just "stretch" the animation to fit. Note that you must call this AFTER setting the condition codes.

Implements ObjectDrawInterface.

Definition at line 3772 of file W3DModelDraw.cpp.

◆ setCurAnimDurationInMsec()

Bool W3DModelDraw::setCurAnimDurationInMsec ( Real duration)
protected

Definition at line 2234 of file W3DModelDraw.cpp.

◆ setFullyObscuredByShroud()

void W3DModelDraw::setFullyObscuredByShroud ( Bool fullyObscured)
virtual

collect some stats about the rendering cost of this draw module recurse through sub-objs to collect stats about the rendering cost of this draw module

Implements DrawModule.

Reimplemented in W3DTankDraw, W3DTankTruckDraw, and W3DTruckDraw.

Definition at line 1939 of file W3DModelDraw.cpp.

◆ setHidden()

void W3DModelDraw::setHidden ( Bool h)
virtual

◆ setModelState()

void W3DModelDraw::setModelState ( const ModelConditionInfo * newState)
protected

Change the model for this drawable. If color is non-zero, it will also apply team color to the model

Definition at line 2911 of file W3DModelDraw.cpp.

◆ setPauseAnimation()

void W3DModelDraw::setPauseAnimation ( Bool pauseAnim)
virtual

This call is used to pause or resume an animation.

Implements ObjectDrawInterface.

Definition at line 3833 of file W3DModelDraw.cpp.

◆ setSelectable()

void W3DModelDraw::setSelectable ( Bool selectable)
virtual

Implements ObjectDrawInterface.

Definition at line 3196 of file W3DModelDraw.cpp.

◆ setShadowsEnabled()

void W3DModelDraw::setShadowsEnabled ( Bool enable)
virtual

Implements DrawModule.

Definition at line 1880 of file W3DModelDraw.cpp.

◆ setTerrainDecal()

void W3DModelDraw::setTerrainDecal ( TerrainDecalType type)
virtual

Reimplemented from DrawModule.

Definition at line 2731 of file W3DModelDraw.cpp.

◆ setTerrainDecalOpacity()

void W3DModelDraw::setTerrainDecalOpacity ( Real o)
virtual

Reimplemented from DrawModule.

Definition at line 2777 of file W3DModelDraw.cpp.

◆ setTerrainDecalSize()

void W3DModelDraw::setTerrainDecalSize ( Real x,
Real y )
virtual

Reimplemented from DrawModule.

Definition at line 2769 of file W3DModelDraw.cpp.

◆ showSubObject()

void W3DModelDraw::showSubObject ( const AsciiString & name,
Bool show )
virtual

Implements ObjectDrawInterface.

Definition at line 1308 of file W3DModelDraw.cpp.

◆ stopClientParticleSystems()

void W3DModelDraw::stopClientParticleSystems ( )
protected

Definition at line 2385 of file W3DModelDraw.cpp.

◆ updateBonesForClientParticleSystems()

Bool W3DModelDraw::updateBonesForClientParticleSystems ( void )
virtual

this will reposition particle systems on the fly ML

Implements ObjectDrawInterface.

Definition at line 2677 of file W3DModelDraw.cpp.

◆ updateDrawModuleSupplyStatus()

void W3DModelDraw::updateDrawModuleSupplyStatus ( Int maxSupply,
Int currentSupply )
virtual

This will do visual feedback on Supplies carried.

Implements ObjectDrawInterface.

Reimplemented in W3DSupplyDraw.

Definition at line 3931 of file W3DModelDraw.cpp.

◆ updateProjectileClipStatus()

void W3DModelDraw::updateProjectileClipStatus ( UnsignedInt shotsRemaining,
UnsignedInt maxShots,
WeaponSlotType slot )
virtual

This will do the show/hide work if ProjectileBoneFeedbackEnabled is set.

Implements ObjectDrawInterface.

Definition at line 3922 of file W3DModelDraw.cpp.

◆ updateSubObjects()

void W3DModelDraw::updateSubObjects ( )
virtual

Implements ObjectDrawInterface.

Definition at line 3978 of file W3DModelDraw.cpp.


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