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

#include <Drawable.h>

Inherits Thing, and Snapshot.

Classes

struct  PhysicsXformInfo
 

Public Member Functions

 Drawable (const ThingTemplate *thing, DrawableStatus statusBits=DRAWABLE_STATUS_NONE)
 
void onDestroy (void)
 run from GameClient::destroyDrawable
 
void onLevelStart ()
 run from GameLogic::startNewGame
 
DrawablegetNextDrawable (void) const
 return the next drawable in the global list
 
DrawablegetPrevDrawable (void) const
 return the prev drawable in the global list
 
DrawableID getID (void) const
 return this drawable's unique ID
 
void friend_bindToObject (Object *obj)
 bind this drawable to an object ID. for use ONLY by GameLogic!
 
void setIndicatorColor (Color color)
 
void setTintStatus (TintStatus statusBits)
 
void clearTintStatus (TintStatus statusBits)
 
Bool testTintStatus (TintStatus statusBits) const
 
TintEnvelopegetColorTintEnvelope (void)
 
void setColorTintEnvelope (TintEnvelope &source)
 
void imitateStealthLook (Drawable &otherDraw)
 
void setTerrainDecal (TerrainDecalType type)
 decal that is to appear under the drawable
 
void setTerrainDecalSize (Real x, Real y)
 
void setTerrainDecalFadeTarget (Real target, Real rate=0.1f)
 
ObjectgetObject (void)
 return object ID bound to this drawble
 
const ObjectgetObject (void) const
 return object ID bound to this drawble
 
DrawableInfogetDrawableInfo (void)
 
void setDrawableHidden (Bool hidden)
 hide or unhide drawable
 
Bool isDrawableEffectivelyHidden () const
 
void setSelectable (Bool selectable)
 Changes the drawables selectability.
 
Bool isSelectable (void) const
 
Bool isMassSelectable (void) const
 
void setStealthLook (StealthLookType look)
 
StealthLookType getStealthLook () const
 
void updateDrawableClipStatus (UnsignedInt shotsRemaining, UnsignedInt maxShots, WeaponSlotType slot)
 This will do the show/hide work if ProjectileBoneFeedbackEnabled is set.
 
void updateDrawableSupplyStatus (Int maxSupply, Int currentSupply)
 This will do visual feedback on Supplies carried.
 
void notifyDrawableDependencyCleared ()
 If any of your draw modules were waiting for something, it's ready now.
 
void setPosition (const Coord3D *pos)
 
void reactToGeometryChange ()
 
const GeometryInfogetDrawableGeometryInfo () const
 
void reactToBodyDamageStateChange (BodyDamageType newState)
 
const Real getScale (void) const
 
ClientUpdateModule ** getClientUpdateModules ()
 
ClientUpdateModule const ** getClientUpdateModules () const
 
ClientUpdateModulefindClientUpdateModule (NameKeyType key)
 
DrawModule ** getDrawModulesNonDirty ()
 
DrawModule ** getDrawModules ()
 
DrawModule const ** getDrawModules () const
 
void setDrawableStatus (DrawableStatus bit)
 
void clearDrawableStatus (DrawableStatus bit)
 
Bool testDrawableStatus (DrawableStatus bit) const
 
void setShroudClearFrame (UnsignedInt frame)
 
UnsignedInt getShroudClearFrame (void)
 
void setShadowsEnabled (Bool enable)
 
Bool getShadowsEnabled () const
 
void releaseShadows (void)
 frees all shadow resources used by this module - used by Options screen.
 
void allocateShadows (void)
 create shadow resources if not already present. Used by Options screen.
 
void setFullyObscuredByShroud (Bool fullyObscured)
 
Bool getFullyObscuredByShroud (void)
 
Bool getDrawsInMirror () const
 
void colorFlash (const RGBColor *color, UnsignedInt decayFrames=DEF_DECAY_FRAMES, UnsignedInt attackFrames=0, UnsignedInt sustainAtPeak=FALSE)
 flash a drawable in the color specified for a short time
 
void colorTint (const RGBColor *color)
 tint this drawable the color specified
 
void setTintEnvelope (const RGBColor *color, Real attack, Real decay)
 how to transition color
 
void flashAsSelected (const RGBColor *color=NULL)
 drawable takes care of the details if you spec no color
 
Bool isSelected (void) const
 Return true if drawable has been marked as "selected".
 
void onSelected ()
 Work unrelated to selection that must happen at time of selection.
 
void onUnselected ()
 Work unrelated to selection that must happen at time of unselection.
 
void setInstanceMatrix (const Matrix3D *instance)
 set the Drawable's instance transform
 
const Matrix3DgetInstanceMatrix (void) const
 get drawable instance transform
 
Bool isInstanceIdentity () const
 
Real getInstanceScale (void) const
 get scale that will be applied to instance matrix
 
void setInstanceScale (Real value)
 set scale that will be applied to instance matrix before rendering.
 
const Matrix3DgetTransformMatrix (void) const
 return the world transform
 
void draw (View *view)
 render the drawable to the given view
 
void updateDrawable ()
 update the drawable
 
void drawIconUI (void)
 draw "icon"(s) needed on drawable (health bars, veterency, etc)
 
void startAmbientSound (Bool onlyIfPermanent=false)
 
void stopAmbientSound (void)
 
void enableAmbientSound (Bool enable)
 
void setTimeOfDay (TimeOfDay tod)
 
Bool getAmbientSoundEnabledFromScript (void) const
 
void prependToList (Drawable **pListHead)
 
void removeFromList (Drawable **pListHead)
 
void setID (DrawableID id)
 set this drawable's unique ID
 
const ModelConditionFlagsgetModelConditionFlags (void) const
 
void clearModelConditionState (ModelConditionFlagType a)
 
void setModelConditionState (ModelConditionFlagType a)
 
void clearAndSetModelConditionState (ModelConditionFlagType clr, ModelConditionFlagType set)
 
void clearModelConditionFlags (const ModelConditionFlags &clr)
 
void setModelConditionFlags (const ModelConditionFlags &set)
 
void clearAndSetModelConditionFlags (const ModelConditionFlags &clr, const ModelConditionFlags &set)
 
void replaceModelConditionFlags (const ModelConditionFlags &flags, Bool forceReplace=FALSE)
 
Bool handleWeaponFireFX (WeaponSlotType wslot, Int specificBarrelToUse, const FXList *fxl, Real weaponSpeed, Real recoilAmount, Real recoilAngle, const Coord3D *victimPos, Real damageRadius)
 
Int getBarrelCount (WeaponSlotType wslot) const
 
void changedTeam ()
 
const TWheelInfogetWheelInfo (void) const
 
const DrawableLocoInfogetLocoInfo () const
 
Bool clientOnly_getFirstRenderObjInfo (Coord3D *pos, Real *boundingSphereRadius, Matrix3D *transform)
 
Int getPristineBonePositions (const char *boneNamePrefix, Int startIndex, Coord3D *positions, Matrix3D *transforms, Int maxBones) const
 
Int getCurrentClientBonePositions (const char *boneNamePrefix, Int startIndex, Coord3D *positions, Matrix3D *transforms, Int maxBones) const
 
Bool getCurrentWorldspaceClientBonePositions (const char *boneName, Matrix3D &transform) const
 
Bool getProjectileLaunchOffset (WeaponSlotType wslot, Int specificBarrelToUse, Matrix3D *launchPos, WhichTurretType tur, Coord3D *turretRotPos, Coord3D *turretPitchPos=NULL) const
 
void setAnimationLoopDuration (UnsignedInt numFrames)
 
void setAnimationCompletionTime (UnsignedInt numFrames)
 
virtual void setAnimationFrame (int frame)
 
void updateSubObjects ()
 
void showSubObject (const AsciiString &name, Bool show)
 
UnsignedInt getExpirationDate () const
 
void setExpirationDate (UnsignedInt frame)
 
void friend_setSelected (void)
 mark drawable as "selected"
 
void friend_clearSelected (void)
 clear drawable's "selected"
 
Vector3getAmbientLight (void)
 get color value to add to ambient light when drawing
 
void setAmbientLight (Vector3 *ambient)
 set color value to add to ambient light when drawing
 
const Vector3getTintColor (void) const
 get FX color value to add to ALL LIGHTS when drawing
 
const Vector3getSelectionColor (void) const
 get FX color value to add to ALL LIGHTS when drawing
 
TerrainDecalType getTerrainDecalType (void) const
 
void setDrawableOpacity (Real value)
 set alpha/opacity value used to override defaults when drawing.
 
Real getEffectiveOpacity () const
 get alpha/opacity value used to override defaults when drawing.
 
void setEffectiveOpacity (Real pulseFactor, Real explicitOpacity=-1.0f)
 get alpha/opacity value used to override defaults when drawing.
 
Real getSecondMaterialPassOpacity () const
 get alpha/opacity value used to render add'l rendering pass.
 
void setSecondMaterialPassOpacity (Real op)
 
void fadeOut (UnsignedInt frames)
 set alpha/opacity value used to render add'l rendering pass.
 
void fadeIn (UnsignedInt frames)
 fade object in...how gradually this is done is determined by frames
 
void preloadAssets (TimeOfDay timeOfDay)
 preload the assets
 
Bool isVisible ()
 for limiting tree sway, etc to visible objects
 
Bool getShouldAnimate (Bool considerPower) const
 
Int getFlashCount (void)
 
void setFlashCount (Int count)
 
void setFlashColor (Color color)
 
void saturateRGB (RGBColor &color, Real factor)
 
void setCaptionText (const UnicodeString &captionText)
 
void clearCaptionText (void)
 
UnicodeString getCaptionText (void)
 
DrawableIconInfogetIconInfo ()
 lazily allocates, if necessary
 
void killIcon (DrawableIconType t)
 
Bool hasIconInfo () const
 
Bool getReceivesDynamicLights (void)
 
void setReceivesDynamicLights (Bool set)
 
const AudioEventInfogetBaseSoundAmbientInfo () const
 
void enableAmbientSoundFromScript (Bool enable)
 
const AudioEventRTSgetAmbientSound () const
 
void setCustomSoundAmbientOff ()
 
void setCustomSoundAmbientInfo (DynamicAudioEventInfo *customAmbientInfo)
 
void clearCustomSoundAmbient ()
 
Bool getAmbientSoundEnabled (void) const
 
void mangleCustomAudioName (DynamicAudioEventInfo *audioToMangle) const
 
Real friend_getStealthOpacity (void)
 
Real friend_getExplicitOpacity (void)
 
Real friend_getEffectiveStealthOpacity (void)
 
void clearEmoticon ()
 
void setEmoticon (const AsciiString &name, Int duration)
 
void drawUIText (void)
 draw the group number of this unit // public so gameclient can call
 
- Public Member Functions inherited from Thing
 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 ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static void killStaticImages ()
 
static void friend_lockDirtyStuffForIteration ()
 
static void friend_unlockDirtyStuffForIteration ()
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
void xferDrawableModules (Xfer *xfer)
 
void startAmbientSound (BodyDamageType dt, TimeOfDay tod, Bool onlyIfPermanent=false)
 
DrawableasDrawableMeth ()
 
const DrawableasDrawableMeth () const
 
Module ** getModuleList (ModuleType i)
 
Module *const * getModuleList (ModuleType i) const
 
void applyPhysicsXform (Matrix3D *mtx)
 
Bool calcPhysicsXform (PhysicsXformInfo &info)
 
void calcPhysicsXformThrust (const Locomotor *locomotor, PhysicsXformInfo &info)
 
void calcPhysicsXformHoverOrWings (const Locomotor *locomotor, PhysicsXformInfo &info)
 
void calcPhysicsXformTreads (const Locomotor *locomotor, PhysicsXformInfo &info)
 
void calcPhysicsXformWheels (const Locomotor *locomotor, PhysicsXformInfo &info)
 
void calcPhysicsXformMotorcycle (const Locomotor *locomotor, PhysicsXformInfo &info)
 
const AudioEventRTSgetAmbientSoundByDamage (BodyDamageType dt)
 
void clearCustomSoundAmbient (bool restartSound)
 
virtual void reactToTransformChange (const Matrix3D *oldMtx, const Coord3D *oldPos, Real oldAngle)
 
void updateHiddenStatus ()
 
- Protected Member Functions inherited from Thing
virtual Real calculateHeightAboveTerrain (void) const
 
virtual ObjectasObjectMeth ()
 
virtual const ObjectasObjectMeth () const
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

A Drawable is a graphical entity which is generally associated with a GameLogic object. Drawables are managed by TheGameClient.

Definition at line 286 of file Drawable.h.

Constructor & Destructor Documentation

◆ Drawable()

Drawable::Drawable ( const ThingTemplate * thingTemplate,
DrawableStatus statusBits = DRAWABLE_STATUS_NONE )

Drawables are lightweight, graphical entities which live on the GameClient, and are usually bound to GameLogic objects. In other words, they are the graphical side of a logical object, whereas GameLogic objects encapsulate behaviors and physics.

Todo
srj – this is evil, we shouldn't look at the module name directly!

allow for inter-Module resolution

Definition at line 349 of file Drawable.cpp.

Member Function Documentation

◆ allocateShadows()

void Drawable::allocateShadows ( void )

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

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

Definition at line 907 of file Drawable.cpp.

◆ applyPhysicsXform()

void Drawable::applyPhysicsXform ( Matrix3D * mtx)
protected

Definition at line 1388 of file Drawable.cpp.

◆ asDrawableMeth() [1/2]

Drawable * Drawable::asDrawableMeth ( )
inlineprotectedvirtual

Reimplemented from Thing.

Definition at line 596 of file Drawable.h.

◆ asDrawableMeth() [2/2]

const Drawable * Drawable::asDrawableMeth ( ) const
inlineprotectedvirtual

Reimplemented from Thing.

Definition at line 597 of file Drawable.h.

◆ calcPhysicsXform()

Bool Drawable::calcPhysicsXform ( PhysicsXformInfo & info)
protected

Definition at line 1414 of file Drawable.cpp.

◆ calcPhysicsXformHoverOrWings()

void Drawable::calcPhysicsXformHoverOrWings ( const Locomotor * locomotor,
PhysicsXformInfo & info )
protected

Definition at line 1549 of file Drawable.cpp.

◆ calcPhysicsXformMotorcycle()

void Drawable::calcPhysicsXformMotorcycle ( const Locomotor * locomotor,
PhysicsXformInfo & info )
protected
Todo
Steven/John ... please review this and make sure it makes sense (CBD)

Definition at line 2214 of file Drawable.cpp.

◆ calcPhysicsXformThrust()

void Drawable::calcPhysicsXformThrust ( const Locomotor * locomotor,
PhysicsXformInfo & info )
protected

Definition at line 1470 of file Drawable.cpp.

◆ calcPhysicsXformTreads()

void Drawable::calcPhysicsXformTreads ( const Locomotor * locomotor,
PhysicsXformInfo & info )
protected
Todo
Z needs to accelerate/decelerate, not be directly set (MSB)

Definition at line 1661 of file Drawable.cpp.

◆ calcPhysicsXformWheels()

void Drawable::calcPhysicsXformWheels ( const Locomotor * locomotor,
PhysicsXformInfo & info )
protected
Todo
Steven/John ... please review this and make sure it makes sense (CBD)

Definition at line 1919 of file Drawable.cpp.

◆ changedTeam()

void Drawable::changedTeam ( )

Definition at line 4192 of file Drawable.cpp.

◆ clearAndSetModelConditionFlags()

void Drawable::clearAndSetModelConditionFlags ( const ModelConditionFlags & clr,
const ModelConditionFlags & set )

Definition at line 4045 of file Drawable.cpp.

◆ clearAndSetModelConditionState()

void Drawable::clearAndSetModelConditionState ( ModelConditionFlagType clr,
ModelConditionFlagType set )

Definition at line 3967 of file Drawable.cpp.

◆ clearCaptionText()

void Drawable::clearCaptionText ( void )

Definition at line 4349 of file Drawable.cpp.

◆ clearCustomSoundAmbient() [1/2]

void Drawable::clearCustomSoundAmbient ( )
inline

Definition at line 577 of file Drawable.h.

◆ clearCustomSoundAmbient() [2/2]

void Drawable::clearCustomSoundAmbient ( bool restartSound)
protected

Return to using default ambient sound

Definition at line 4438 of file Drawable.cpp.

◆ clearDrawableStatus()

void Drawable::clearDrawableStatus ( DrawableStatus bit)
inline

Definition at line 367 of file Drawable.h.

◆ clearEmoticon()

void Drawable::clearEmoticon ( )

Definition at line 2824 of file Drawable.cpp.

◆ clearModelConditionFlags()

void Drawable::clearModelConditionFlags ( const ModelConditionFlags & clr)
inline

Definition at line 435 of file Drawable.h.

◆ clearModelConditionState()

void Drawable::clearModelConditionState ( ModelConditionFlagType a)
inline

Definition at line 431 of file Drawable.h.

◆ clearTintStatus()

void Drawable::clearTintStatus ( TintStatus statusBits)
inline

Definition at line 307 of file Drawable.h.

◆ clientOnly_getFirstRenderObjInfo()

Bool Drawable::clientOnly_getFirstRenderObjInfo ( Coord3D * pos,
Real * boundingSphereRadius,
Matrix3D * transform )

Definition at line 667 of file Drawable.cpp.

◆ colorFlash()

void Drawable::colorFlash ( const RGBColor * color,
UnsignedInt decayFrames = DEF_DECAY_FRAMES,
UnsignedInt attackFrames = 0,
UnsignedInt sustainAtPeak = FALSE )

flash a drawable in the color specified for a short time

Flash the drawable with the color

Definition at line 958 of file Drawable.cpp.

◆ colorTint()

void Drawable::colorTint ( const RGBColor * color)

tint this drawable the color specified

Tint a drawable a specified color

Definition at line 981 of file Drawable.cpp.

◆ crc()

void Drawable::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 4781 of file Drawable.cpp.

◆ draw()

void Drawable::draw ( View * view)

render the drawable to the given view

default draw is to just call the database defined draw

Definition at line 2636 of file Drawable.cpp.

◆ drawIconUI()

void Drawable::drawIconUI ( void )

draw "icon"(s) needed on drawable (health bars, veterency, etc)

This is called as part of the "post draw" phase when drawable a drawable. It is there that we should overlay on the screen any 2D elements for purposes of user interface information (such as a heatlh bar, veterency levels, etc.)

Definition at line 2762 of file Drawable.cpp.

◆ drawUIText()

void Drawable::drawUIText ( void )

draw the group number of this unit // public so gameclient can call

Definition at line 3115 of file Drawable.cpp.

◆ enableAmbientSound()

void Drawable::enableAmbientSound ( Bool enable)

Definition at line 4581 of file Drawable.cpp.

◆ enableAmbientSoundFromScript()

void Drawable::enableAmbientSoundFromScript ( Bool enable)

Definition at line 4604 of file Drawable.cpp.

◆ fadeIn()

void Drawable::fadeIn ( UnsignedInt frames)

fade object in...how gradually this is done is determined by frames

fades the object in gradually...how gradually is determined by number of frames

Parameters
framesdecloak object

Definition at line 1083 of file Drawable.cpp.

◆ fadeOut()

void Drawable::fadeOut ( UnsignedInt frames)

set alpha/opacity value used to render add'l rendering pass.

fade object out...how gradually this is done is determined by frames

fades the object out gradually...how gradually is determined by number of frames

Parameters
framescloak object

Definition at line 1072 of file Drawable.cpp.

◆ findClientUpdateModule()

ClientUpdateModule * Drawable::findClientUpdateModule ( NameKeyType key)

Definition at line 4762 of file Drawable.cpp.

◆ flashAsSelected()

void Drawable::flashAsSelected ( const RGBColor * color = NULL)

drawable takes care of the details if you spec no color

Parameters
colordrawable takes care of the details if you spec no color

Definition at line 1359 of file Drawable.cpp.

◆ friend_bindToObject()

void Drawable::friend_bindToObject ( Object * obj)

bind this drawable to an object ID. for use ONLY by GameLogic!

Parameters
objbind this drawable to an object ID

Definition at line 4162 of file Drawable.cpp.

◆ friend_clearSelected()

void Drawable::friend_clearSelected ( void )

clear drawable's "selected"

Clear drawable's "selected" status, if not already clear. Also update running total count of selected drawables.

Definition at line 946 of file Drawable.cpp.

◆ friend_getEffectiveStealthOpacity()

Real Drawable::friend_getEffectiveStealthOpacity ( void )
inline

Definition at line 584 of file Drawable.h.

◆ friend_getExplicitOpacity()

Real Drawable::friend_getExplicitOpacity ( void )
inline

Definition at line 583 of file Drawable.h.

◆ friend_getStealthOpacity()

Real Drawable::friend_getStealthOpacity ( void )
inline

Definition at line 582 of file Drawable.h.

◆ friend_lockDirtyStuffForIteration()

static void Drawable::friend_lockDirtyStuffForIteration ( )
static

◆ friend_setSelected()

void Drawable::friend_setSelected ( void )

mark drawable as "selected"

Set drawable's "selected" status, if not already set. Also update running total count of selected drawables.

Definition at line 932 of file Drawable.cpp.

◆ friend_unlockDirtyStuffForIteration()

static void Drawable::friend_unlockDirtyStuffForIteration ( )
static

◆ getAmbientLight()

Vector3 * Drawable::getAmbientLight ( void )

get color value to add to ambient light when drawing

◆ getAmbientSound()

const AudioEventRTS * Drawable::getAmbientSound ( ) const
inline

Definition at line 574 of file Drawable.h.

◆ getAmbientSoundByDamage()

const AudioEventRTS & Drawable::getAmbientSoundByDamage ( BodyDamageType dt)
protected

decodes the current previous damage type and sets the ambient sound set from that.

Definition at line 2512 of file Drawable.cpp.

◆ getAmbientSoundEnabled()

Bool Drawable::getAmbientSoundEnabled ( void ) const
inline

Definition at line 578 of file Drawable.h.

◆ getAmbientSoundEnabledFromScript()

Bool Drawable::getAmbientSoundEnabledFromScript ( void ) const
inline

Definition at line 418 of file Drawable.h.

◆ getBarrelCount()

Int Drawable::getBarrelCount ( WeaponSlotType wslot) const

Definition at line 4266 of file Drawable.cpp.

◆ getBaseSoundAmbientInfo()

const AudioEventInfo * Drawable::getBaseSoundAmbientInfo ( ) const

If you wish to change some parameters of the default ambient sound, but keep the rest, this function will give you the default ambient sound's info

Definition at line 4386 of file Drawable.cpp.

◆ getCaptionText()

UnicodeString Drawable::getCaptionText ( void )

Definition at line 4357 of file Drawable.cpp.

◆ getClientUpdateModules() [1/2]

ClientUpdateModule ** Drawable::getClientUpdateModules ( )
inline

Definition at line 357 of file Drawable.h.

◆ getClientUpdateModules() [2/2]

ClientUpdateModule const ** Drawable::getClientUpdateModules ( ) const
inline

Definition at line 358 of file Drawable.h.

◆ getColorTintEnvelope()

TintEnvelope * Drawable::getColorTintEnvelope ( void )
inline

Definition at line 309 of file Drawable.h.

◆ getCurrentClientBonePositions()

Int Drawable::getCurrentClientBonePositions ( const char * boneNamePrefix,
Int startIndex,
Coord3D * positions,
Matrix3D * transforms,
Int maxBones ) const

Definition at line 800 of file Drawable.cpp.

◆ getCurrentWorldspaceClientBonePositions()

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

Definition at line 829 of file Drawable.cpp.

◆ getDrawableGeometryInfo()

const GeometryInfo & Drawable::getDrawableGeometryInfo ( ) const

Definition at line 4116 of file Drawable.cpp.

◆ getDrawableInfo()

DrawableInfo * Drawable::getDrawableInfo ( void )
inline

Definition at line 322 of file Drawable.h.

◆ getDrawModules() [1/2]

DrawModule ** Drawable::getDrawModules ( )

Definition at line 3985 of file Drawable.cpp.

◆ getDrawModules() [2/2]

DrawModule const ** Drawable::getDrawModules ( ) const

Definition at line 4014 of file Drawable.cpp.

◆ getDrawModulesNonDirty()

DrawModule ** Drawable::getDrawModulesNonDirty ( )

Definition at line 3978 of file Drawable.cpp.

◆ getDrawsInMirror()

Bool Drawable::getDrawsInMirror ( ) const
inline

Definition at line 385 of file Drawable.h.

◆ getEffectiveOpacity()

Real Drawable::getEffectiveOpacity ( ) const
inline

get alpha/opacity value used to override defaults when drawing.

Definition at line 532 of file Drawable.h.

◆ getExpirationDate()

UnsignedInt Drawable::getExpirationDate ( ) const
inline

Definition at line 512 of file Drawable.h.

◆ getFlashCount()

Int Drawable::getFlashCount ( void )
inline

Definition at line 550 of file Drawable.h.

◆ getFullyObscuredByShroud()

Bool Drawable::getFullyObscuredByShroud ( void )
inline

Definition at line 380 of file Drawable.h.

◆ getIconInfo()

DrawableIconInfo * Drawable::getIconInfo ( )

lazily allocates, if necessary

Definition at line 2816 of file Drawable.cpp.

◆ getID()

DrawableID Drawable::getID ( void ) const

return this drawable's unique ID

Return drawable ID, this ID is only good on the client

Definition at line 4151 of file Drawable.cpp.

◆ getInstanceMatrix()

const Matrix3D * Drawable::getInstanceMatrix ( void ) const
inline

get drawable instance transform

Definition at line 401 of file Drawable.h.

◆ getInstanceScale()

Real Drawable::getInstanceScale ( void ) const
inline

get scale that will be applied to instance matrix

Definition at line 404 of file Drawable.h.

◆ getLocoInfo()

const DrawableLocoInfo * Drawable::getLocoInfo ( ) const
inline

Definition at line 461 of file Drawable.h.

◆ getModelConditionFlags()

const ModelConditionFlags & Drawable::getModelConditionFlags ( void ) const
inline

Definition at line 424 of file Drawable.h.

◆ getModuleList() [1/2]

Module ** Drawable::getModuleList ( ModuleType i)
inlineprotected

Definition at line 599 of file Drawable.h.

◆ getModuleList() [2/2]

Module *const * Drawable::getModuleList ( ModuleType i) const
inlineprotected

Definition at line 605 of file Drawable.h.

◆ getNextDrawable()

Drawable * Drawable::getNextDrawable ( void ) const
inline

return the next drawable in the global list

Definition at line 299 of file Drawable.h.

◆ getObject() [1/2]

Object * Drawable::getObject ( void )
inline

return object ID bound to this drawble

Definition at line 319 of file Drawable.h.

◆ getObject() [2/2]

const Object * Drawable::getObject ( void ) const
inline

return object ID bound to this drawble

Definition at line 320 of file Drawable.h.

◆ getPrevDrawable()

Drawable * Drawable::getPrevDrawable ( void ) const
inline

return the prev drawable in the global list

Definition at line 300 of file Drawable.h.

◆ getPristineBonePositions()

Int Drawable::getPristineBonePositions ( const char * boneNamePrefix,
Int startIndex,
Coord3D * positions,
Matrix3D * transforms,
Int maxBones ) const

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.

Definition at line 771 of file Drawable.cpp.

◆ getProjectileLaunchOffset()

Bool Drawable::getProjectileLaunchOffset ( WeaponSlotType wslot,
Int specificBarrelToUse,
Matrix3D * launchPos,
WhichTurretType tur,
Coord3D * turretRotPos,
Coord3D * turretPitchPos = NULL ) const

Definition at line 679 of file Drawable.cpp.

◆ getReceivesDynamicLights()

Bool Drawable::getReceivesDynamicLights ( void )
inline

Definition at line 567 of file Drawable.h.

◆ getScale()

const Real Drawable::getScale ( void ) const

Definition at line 1093 of file Drawable.cpp.

◆ getSecondMaterialPassOpacity()

Real Drawable::getSecondMaterialPassOpacity ( ) const
inline

get alpha/opacity value used to render add'l rendering pass.

Definition at line 536 of file Drawable.h.

◆ getSelectionColor()

const Vector3 * Drawable::getSelectionColor ( void ) const

get FX color value to add to ALL LIGHTS when drawing

get SELECTION color value to add to ALL LIGHTS when drawing

Definition at line 1054 of file Drawable.cpp.

◆ getShadowsEnabled()

Bool Drawable::getShadowsEnabled ( ) const
inline

Definition at line 374 of file Drawable.h.

◆ getShouldAnimate()

Bool Drawable::getShouldAnimate ( Bool considerPower) const

Definition at line 626 of file Drawable.cpp.

◆ getShroudClearFrame()

UnsignedInt Drawable::getShroudClearFrame ( void )
inline

Definition at line 371 of file Drawable.h.

◆ getStealthLook()

StealthLookType Drawable::getStealthLook ( ) const
inline

Definition at line 337 of file Drawable.h.

◆ getTerrainDecalType()

TerrainDecalType Drawable::getTerrainDecalType ( void ) const
inline

Definition at line 527 of file Drawable.h.

◆ getTintColor()

const Vector3 * Drawable::getTintColor ( void ) const

get FX color value to add to ALL LIGHTS when drawing

get FX color value to add to ALL LIGHTS when drawing

Definition at line 1038 of file Drawable.cpp.

◆ getTransformMatrix()

const Matrix3D * Drawable::getTransformMatrix ( void ) const

return the world transform

Return the Drawable's world transform. If this Drawable is attached to an Object, return the Object's transform instead.

Definition at line 4302 of file Drawable.cpp.

◆ getWheelInfo()

const TWheelInfo * Drawable::getWheelInfo ( void ) const
inline

Definition at line 459 of file Drawable.h.

◆ handleWeaponFireFX()

Bool Drawable::handleWeaponFireFX ( WeaponSlotType wslot,
Int specificBarrelToUse,
const FXList * fxl,
Real weaponSpeed,
Real recoilAmount,
Real recoilAngle,
const Coord3D * victimPos,
Real damageRadius )

Definition at line 4240 of file Drawable.cpp.

◆ hasIconInfo()

Bool Drawable::hasIconInfo ( ) const
inline

Definition at line 564 of file Drawable.h.

◆ imitateStealthLook()

void Drawable::imitateStealthLook ( Drawable & otherDraw)

Definition at line 1144 of file Drawable.cpp.

◆ isDrawableEffectivelyHidden()

Bool Drawable::isDrawableEffectivelyHidden ( ) const
inline

Definition at line 329 of file Drawable.h.

◆ isInstanceIdentity()

Bool Drawable::isInstanceIdentity ( ) const
inline

Definition at line 402 of file Drawable.h.

◆ isMassSelectable()

Bool Drawable::isMassSelectable ( void ) const

Return whether or not this Drawable is selectable as part of a group.

Definition at line 4741 of file Drawable.cpp.

◆ isSelectable()

Bool Drawable::isSelectable ( void ) const

Return whether or not this Drawable is selectable.

Definition at line 4733 of file Drawable.cpp.

◆ isSelected()

Bool Drawable::isSelected ( void ) const
inline

Return true if drawable has been marked as "selected".

Definition at line 393 of file Drawable.h.

◆ isVisible()

Bool Drawable::isVisible ( )

for limiting tree sway, etc to visible objects

Definition at line 613 of file Drawable.cpp.

◆ killIcon()

void Drawable::killIcon ( DrawableIconType t)
inline

Definition at line 563 of file Drawable.h.

◆ killStaticImages()

void Drawable::killStaticImages ( )
static

Definition at line 312 of file Drawable.cpp.

◆ loadPostProcess()

void Drawable::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 5420 of file Drawable.cpp.

◆ mangleCustomAudioName()

void Drawable::mangleCustomAudioName ( DynamicAudioEventInfo * audioToMangle) const

Produce a unique-across-entire-level name for this audio event

Definition at line 4398 of file Drawable.cpp.

◆ notifyDrawableDependencyCleared()

void Drawable::notifyDrawableDependencyCleared ( )

If any of your draw modules were waiting for something, it's ready now.

Definition at line 4703 of file Drawable.cpp.

◆ onDestroy()

void Drawable::onDestroy ( void )

run from GameClient::destroyDrawable

Run from GameClient::destroyDrawable

Definition at line 595 of file Drawable.cpp.

◆ onLevelStart()

void Drawable::onLevelStart ( )

run from GameLogic::startNewGame

Definition at line 1344 of file Drawable.cpp.

◆ onSelected()

void Drawable::onSelected ( )

Work unrelated to selection that must happen at time of selection.

Gathering point for all things besides actual selection that must happen on selection

Definition at line 1010 of file Drawable.cpp.

◆ onUnselected()

void Drawable::onUnselected ( )

Work unrelated to selection that must happen at time of unselection.

Gathering point for all things besides actual selection that must happen on deselection

Definition at line 1030 of file Drawable.cpp.

◆ preloadAssets()

void Drawable::preloadAssets ( TimeOfDay timeOfDay)

preload the assets

Preload all our assets that we can for all our possible states in this time of day

walk all our modules and preload any assets we need to

Definition at line 4749 of file Drawable.cpp.

◆ prependToList()

void Drawable::prependToList ( Drawable ** pListHead)

add self to the linked list

Definition at line 4627 of file Drawable.cpp.

◆ reactToBodyDamageStateChange()

void Drawable::reactToBodyDamageStateChange ( BodyDamageType newState)

Definition at line 1101 of file Drawable.cpp.

◆ reactToGeometryChange()

void Drawable::reactToGeometryChange ( )

Definition at line 4231 of file Drawable.cpp.

◆ reactToTransformChange()

void Drawable::reactToTransformChange ( const Matrix3D * oldMtx,
const Coord3D * oldPos,
Real oldAngle )
protectedvirtual

Implements Thing.

Definition at line 4222 of file Drawable.cpp.

◆ releaseShadows()

void Drawable::releaseShadows ( void )

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

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

Definition at line 897 of file Drawable.cpp.

◆ removeFromList()

void Drawable::removeFromList ( Drawable ** pListHead)

remove self from the linked list

Definition at line 4640 of file Drawable.cpp.

◆ replaceModelConditionFlags()

void Drawable::replaceModelConditionFlags ( const ModelConditionFlags & flags,
Bool forceReplace = FALSE )

Definition at line 4068 of file Drawable.cpp.

◆ saturateRGB()

void Drawable::saturateRGB ( RGBColor & color,
Real factor )

Definition at line 322 of file Drawable.cpp.

◆ setAmbientLight()

void Drawable::setAmbientLight ( Vector3 * ambient)

set color value to add to ambient light when drawing

◆ setAnimationCompletionTime()

void Drawable::setAnimationCompletionTime ( UnsignedInt numFrames)

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.

Definition at line 702 of file Drawable.cpp.

◆ setAnimationFrame()

void Drawable::setAnimationFrame ( int frame)
virtual

Definition at line 714 of file Drawable.cpp.

◆ setAnimationLoopDuration()

void Drawable::setAnimationLoopDuration ( UnsignedInt numFrames)

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.

Definition at line 691 of file Drawable.cpp.

◆ setCaptionText()

void Drawable::setCaptionText ( const UnicodeString & captionText)

Set and clear the drawable's caption text

Definition at line 4317 of file Drawable.cpp.

◆ setColorTintEnvelope()

void Drawable::setColorTintEnvelope ( TintEnvelope & source)
inline

Definition at line 310 of file Drawable.h.

◆ setCustomSoundAmbientInfo()

void Drawable::setCustomSoundAmbientInfo ( DynamicAudioEventInfo * customAmbientInfo)

Force the Drawable to use the sound described by customAmbientInfo as its ambient sound. The Drawable expects TheAudio to own the actual info pointer

Definition at line 4420 of file Drawable.cpp.

◆ setCustomSoundAmbientOff()

void Drawable::setCustomSoundAmbientOff ( )

Force the Drawable to not ever get an ambient sound attached to it (except possibly for RUBBLE)

Definition at line 4409 of file Drawable.cpp.

◆ setDrawableHidden()

void Drawable::setDrawableHidden ( Bool hidden)

hide or unhide drawable

Hide or un-hide drawable

Definition at line 4671 of file Drawable.cpp.

◆ setDrawableOpacity()

void Drawable::setDrawableOpacity ( Real value)
inline

set alpha/opacity value used to override defaults when drawing.

Definition at line 529 of file Drawable.h.

◆ setDrawableStatus()

void Drawable::setDrawableStatus ( DrawableStatus bit)
inline

Definition at line 366 of file Drawable.h.

◆ setEffectiveOpacity()

void Drawable::setEffectiveOpacity ( Real pulseFactor,
Real explicitOpacity = -1.0f )

get alpha/opacity value used to override defaults when drawing.

Definition at line 1126 of file Drawable.cpp.

◆ setEmoticon()

void Drawable::setEmoticon ( const AsciiString & name,
Int duration )

Definition at line 2833 of file Drawable.cpp.

◆ setExpirationDate()

void Drawable::setExpirationDate ( UnsignedInt frame)
inline

Definition at line 513 of file Drawable.h.

◆ setFlashColor()

void Drawable::setFlashColor ( Color color)
inline

Definition at line 552 of file Drawable.h.

◆ setFlashCount()

void Drawable::setFlashCount ( Int count)
inline

Definition at line 551 of file Drawable.h.

◆ setFullyObscuredByShroud()

void Drawable::setFullyObscuredByShroud ( Bool fullyObscured)

Definition at line 916 of file Drawable.cpp.

◆ setID()

void Drawable::setID ( DrawableID id)

set this drawable's unique ID

Set the id for this drawable

Definition at line 4124 of file Drawable.cpp.

◆ setIndicatorColor()

void Drawable::setIndicatorColor ( Color color)

Definition at line 4105 of file Drawable.cpp.

◆ setInstanceMatrix()

void Drawable::setInstanceMatrix ( const Matrix3D * instance)

set the Drawable's instance transform

Set the Drawable's instance transform

Definition at line 4281 of file Drawable.cpp.

◆ setInstanceScale()

void Drawable::setInstanceScale ( Real value)
inline

set scale that will be applied to instance matrix before rendering.

Definition at line 405 of file Drawable.h.

◆ setModelConditionFlags()

void Drawable::setModelConditionFlags ( const ModelConditionFlags & set)
inline

Definition at line 436 of file Drawable.h.

◆ setModelConditionState()

void Drawable::setModelConditionState ( ModelConditionFlagType a)
inline

Definition at line 432 of file Drawable.h.

◆ setPosition()

void Drawable::setPosition ( const Coord3D * pos)

Definition at line 4214 of file Drawable.cpp.

◆ setReceivesDynamicLights()

void Drawable::setReceivesDynamicLights ( Bool set)
inline

Definition at line 568 of file Drawable.h.

◆ setSecondMaterialPassOpacity()

void Drawable::setSecondMaterialPassOpacity ( Real op)
inline

Definition at line 537 of file Drawable.h.

◆ setSelectable()

void Drawable::setSelectable ( Bool selectable)

Changes the drawables selectability.

Set as selectable or not.

Definition at line 4716 of file Drawable.cpp.

◆ setShadowsEnabled()

void Drawable::setShadowsEnabled ( Bool enable)

Definition at line 881 of file Drawable.cpp.

◆ setShroudClearFrame()

void Drawable::setShroudClearFrame ( UnsignedInt frame)
inline

Definition at line 370 of file Drawable.h.

◆ setStealthLook()

void Drawable::setStealthLook ( StealthLookType look)
Todo
srj – evil hack here... this whole heat-vision thing is fucked. don't want it on mines but no good way to do that. hack for now.
Todo
srj – evil hack here... this whole heat-vision thing is fucked. don't want it on mines but no good way to do that. hack for now.

Definition at line 2551 of file Drawable.cpp.

◆ setTerrainDecal()

void Drawable::setTerrainDecal ( TerrainDecalType type)

decal that is to appear under the drawable

Definition at line 841 of file Drawable.cpp.

◆ setTerrainDecalFadeTarget()

void Drawable::setTerrainDecalFadeTarget ( Real target,
Real rate = 0.1f )

Definition at line 868 of file Drawable.cpp.

◆ setTerrainDecalSize()

void Drawable::setTerrainDecalSize ( Real x,
Real y )

Definition at line 859 of file Drawable.cpp.

◆ setTimeOfDay()

void Drawable::setTimeOfDay ( TimeOfDay tod)

Attach and start playing an ambient sound to this drawable

Definition at line 4368 of file Drawable.cpp.

◆ setTintEnvelope()

void Drawable::setTintEnvelope ( const RGBColor * color,
Real attack,
Real decay )

how to transition color

◆ setTintStatus()

void Drawable::setTintStatus ( TintStatus statusBits)
inline

Definition at line 306 of file Drawable.h.

◆ showSubObject()

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

Definition at line 736 of file Drawable.cpp.

◆ startAmbientSound() [1/2]

void Drawable::startAmbientSound ( BodyDamageType dt,
TimeOfDay tod,
Bool onlyIfPermanent = false )
protected

Attach and start playing an ambient sound to this drawable

Definition at line 4461 of file Drawable.cpp.

◆ startAmbientSound() [2/2]

void Drawable::startAmbientSound ( Bool onlyIfPermanent = false)

Definition at line 4552 of file Drawable.cpp.

◆ stopAmbientSound()

void Drawable::stopAmbientSound ( void )

Stop playing the drawables ambient sound if it has one

Definition at line 4571 of file Drawable.cpp.

◆ testDrawableStatus()

Bool Drawable::testDrawableStatus ( DrawableStatus bit) const
inline

Definition at line 368 of file Drawable.h.

◆ testTintStatus()

Bool Drawable::testTintStatus ( TintStatus statusBits) const
inline

Definition at line 308 of file Drawable.h.

◆ updateDrawable()

void Drawable::updateDrawable ( void )

update the drawable

update is called once per frame

Definition at line 1168 of file Drawable.cpp.

◆ updateDrawableClipStatus()

void Drawable::updateDrawableClipStatus ( UnsignedInt shotsRemaining,
UnsignedInt maxShots,
WeaponSlotType slot )

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

Definition at line 4681 of file Drawable.cpp.

◆ updateDrawableSupplyStatus()

void Drawable::updateDrawableSupplyStatus ( Int maxSupply,
Int currentSupply )

This will do visual feedback on Supplies carried.

Definition at line 4692 of file Drawable.cpp.

◆ updateHiddenStatus()

void Drawable::updateHiddenStatus ( )
protected

Definition at line 4653 of file Drawable.cpp.

◆ updateSubObjects()

void Drawable::updateSubObjects ( )

Definition at line 725 of file Drawable.cpp.

◆ xfer()

void Drawable::xfer ( Xfer * xfer)
protectedvirtual

Xfer method Version Info; 1: Initial version 2: Moved condition state xfer before module xfer so we can restore anim frame during the module xfer (CBD) 4: Added m_ambientSoundEnabled flag 5: save full mtx, not pos+orient. 6: Added m_ambientSoundEnabledFromScript flag 7: Save the customize ambient sound info

Implements Snapshot.

Definition at line 4924 of file Drawable.cpp.

◆ xferDrawableModules()

void Drawable::xferDrawableModules ( Xfer * xfer)
protected

Xfer the drawable modules Version Info: 1: Initial version

Definition at line 4791 of file Drawable.cpp.


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