ShapeBase
ShapeBase is the renderable shape from which most of the scriptable objects are derived, including the player, vehicle and items classes.
Classes:
An image mounted on a shapebase.
Network state masks
ShapeBaseMasks { NameMask = Parent::NextFreeMask DamageMask = Parent::NextFreeMask << 1 NoWarpMask = Parent::NextFreeMask << 2 CloakMask = Parent::NextFreeMask << 3 SkinMask = Parent::NextFreeMask << 4 MeshHiddenMask = Parent::NextFreeMask << 5 SoundMaskN = Parent::NextFreeMask << 6 ThreadMaskN = SoundMaskN << MaxSoundThreads ImageMaskN = ThreadMaskN << MaxScriptThreads NextFreeMask = ImageMaskN << MaxMountedImages }
BaseMaskConstants { SoundMask = (SoundMaskN << MaxSoundThreads) - SoundMaskN ThreadMask = (ThreadMaskN << MaxScriptThreads) - ThreadMaskN ImageMask = (ImageMaskN << MaxMountedImages) - ImageMaskN }
Scripted Sound
mSoundThread [MaxSoundThreads]
Scripted Animation Threads
mScriptThread [MaxScriptThreads]
Motion
bool
Indicates that a Move has come in requesting x, y or z motion.
Mounted Images
bool
mountImage(ShapeBaseImageData * image, U32 imageSlot, bool loaded, NetStringHandle & skinNameHandle)
Mount an image (ShapeBaseImage) onto an image slot.
bool
unmountImage(U32 imageSlot)
Unmount an image from a slot.
getMountedImage(U32 imageSlot)
Gets the information on the image mounted in a slot.
getImageStruct(U32 imageSlot)
Gets the mounted image on on a slot.
getImageShapeInstance(U32 imageSlot)
getPendingImage(U32 imageSlot)
Gets the next image which will be put in an image slot.
bool
isImageFiring(U32 imageSlot)
Returns true if the mounted image is firing.
bool
isImageAltFiring(U32 imageSlot)
Returns true if the mounted image is alternate firing.
bool
isImageReloading(U32 imageSlot)
Returns true if the mounted image is reloading.
bool
isImageReady(U32 imageSlot, U32 ns, U32 depth)
This will return true if, when triggered, the object will fire.
bool
isImageMounted(ShapeBaseImageData * image)
Returns true if the specified image is mounted.
getMountSlot(ShapeBaseImageData * image)
Returns the slot which the image specified is mounted on.
getImageSkinTag(U32 imageSlot)
Returns the skin for the image in a slot.
bool
hasImageState(U32 imageSlot, const char * state)
Check if the given state exists on the mounted Image.
const char *
getImageState(U32 imageSlot)
Returns the image state as a string.
setImageGenericTriggerState(U32 imageSlot, U32 trigger, bool state)
Sets the generic trigger state of the image.
bool
getImageGenericTriggerState(U32 imageSlot, U32 trigger)
Returns the generic trigger state of the image.
setImageTriggerState(U32 imageSlot, bool trigger)
Sets the trigger state of the image (Ie trigger pulled down on gun)
bool
getImageTriggerState(U32 imageSlot)
Returns the trigger state of the image.
setImageAltTriggerState(U32 imageSlot, bool trigger)
Sets the alt trigger state of the image (Ie trigger pulled down on gun)
bool
getImageAltTriggerState(U32 imageSlot)
Returns the alt trigger state of the image.
setImageAmmoState(U32 imageSlot, bool ammo)
Sets the flag if the image uses ammo or energy.
bool
getImageAmmoState(U32 imageSlot)
Returns true if the image uses ammo, not energy.
setImageWetState(U32 imageSlot, bool wet)
Sets the image as wet or not, IE if you wanted a gun not to function underwater.
bool
getImageWetState(U32 imageSlot)
Returns true if image is wet.
setImageMotionState(U32 imageSlot, bool motion)
Sets the image as in motion or not, IE if you wanted a gun not to sway while the player is in motion.
bool
getImageMotionState(U32 imageSlot)
Returns true if image is in motion.
setImageTargetState(U32 imageSlot, bool ammo)
Sets the flag if the image has a target.
bool
getImageTargetState(U32 imageSlot)
Returns true if the image has a target.
setImageLoadedState(U32 imageSlot, bool loaded)
Sets the flag of if the image is loaded with ammo.
bool
getImageLoadedState(U32 imageSlot)
Returns true if object is loaded with ammo.
setImageScriptAnimPrefix(U32 imageSlot, NetStringHandle prefix)
Set the script animation prefix for the image.
getImageScriptAnimPrefix(U32 imageSlot)
Get the script animation prefix for the image.
bool
getCorrectedAim(const MatrixF & muzMat, VectorF * result)
Modify muzzle, if needed, to aim at whatever is straight in front of eye.
getMuzzleVector(U32 imageSlot, VectorF * vec)
Gets the muzzle vector of a specified slot.
getMuzzlePoint(U32 imageSlot, Point3F * pos)
Gets the point of the muzzle of the image.
mMountedImageList [MaxMountedImages]
Render settings
Name sent to client.
Physical Properties
Properties for the current object, which are calculated based on the container we are in.
Energy recharge rate (in units/tick).
Inverse of mass.
Type of liquid (if any) we are in.
Height of liquid around us (from 0..1).
Percent of this object covered by water.
Damage
Cloaking
forceUncloak(const char * reason)
Force uncloaking of object.
setCloakedState(bool cloaked)
Set cloaked state of object.
bool
Returns true if object is cloaked.
Returns level of cloaking, as it's not an instant "now you see it, now you don't".
bool
Fading
Control info
The camera vertical FOV in degrees.
bool
Client side controlled flag.
Mesh Visibility
setAllMeshesHidden(bool forceHidden)
Change the hidden state on all the meshes.
setMeshHidden(S32 meshIndex, bool forceHidden)
Set the force hidden state on a mesh.
setMeshHidden(const char * meshName, bool forceHidden)
Set the force hidden state on a named mesh.
Prints the list of meshes and their visibility state to the console for debugging purposes.
Sync the shape instance with the hidden mesh bit vector.
A bit vector of the meshes forced to be hidden.
Collision Notification
This is used to keep us from spamming collision notifications.
When a collision occurs, we add to this list; then we don't notify anyone of the collision until the CollisionTimeout expires (which by default occurs in 1/10 of a second).
Go through all the items in the collision queue and call onCollision on them all.
queueCollision(SceneObject * object, const VectorF & vec)
Add a collision to the queue of collisions waiting to be handled.
onCollision(SceneObject * object, const VectorF & vec)
Initialization
bool
onAdd()
Called when the object is added to the sim.
Called when this is removed from its current SceneManager.
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
Name & Skin tags
Basic attributes
setDamageLevel(F32 damage)
Sets the amount of damage on this object.
setDamageState(DamageState state)
Changes the object's damage state.
bool
setDamageState(const char * state)
Changes the object's damage state, based on a named state.
const char *
Returns the name of the current damage state as a string.
Returns the current damage state.
bool
Returns true if the object is destroyed.
setRepairRate(F32 rate)
Sets the rate at which the object regenerates damage.
Returns damage amount.
Returns the damage percentage.
Returns the datablock.maxDamage value
Returns the rate at which the object regenerates damage.
applyDamage(F32 amount)
Adds damage to an object.
applyRepair(F32 amount)
Removes damage to an object.
setDamageDir(const VectorF & vec)
Sets the direction from which the damage is coming.
setEnergyLevel(F32 energy)
Sets the level of energy for this object.
setRechargeRate(F32 rate)
Sets the rate at which the energy replentishes itself.
Returns the amount of energy in the object.
Returns the percentage of energy, 0.0 - 1.0.
Returns the recharge rate.
Script sounds
Script animation
const char *
getThreadSequenceName(U32 slot)
bool
setThreadSequence(U32 slot, S32 seq, bool reset)
Sets the animation thread for a mounted object.
updateThread(Thread & st)
Update the animation thread.
bool
stopThread(U32 slot)
Stop the current thread from playing on a mounted object.
bool
destroyThread(U32 slot)
Destroys the given animation thread.
bool
pauseThread(U32 slot)
Pause the running animation thread.
bool
playThread(U32 slot)
Start playing the running animation thread again.
bool
setThreadPosition(U32 slot, F32 pos)
Set the thread position.
bool
setThreadDir(U32 slot, bool forward)
Toggle the thread as reversed or normal (For example, sidestep-right reversed is sidestep-left)
bool
setThreadTimeScale(U32 slot, F32 timeScale)
Set the thread time scale.
advanceThreads(F32 dt)
Advance all animation threads attached to this shapebase.
Mounted objects
onMount(SceneObject * obj, S32 node)
Callback when this object is mounted.
onUnmount(SceneObject * obj, S32 node)
Callback when this object is unmounted.
Transforms
getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)
Gets the minimum viewing distance, maximum viewing distance, camera offsetand rotation for this object, if the world were to be viewed through its eyes.
getCameraTransform(F32 * pos, MatrixF * mat)
Gets the camera to world space transform matrix.
getEyeCameraTransform(IDisplayDevice * display, U32 eyeId, MatrixF * outMat)
Gets the view transform for a particular eye, taking into account the current absolute orient and position values of the display device.
getNodeIndex(U32 imageSlot, StringTableEntry nodeName)
Gets the index of a node inside a mounted image given the name.
Object Transforms
getEyeTransform(MatrixF * mat)
Returns the eye transform of this shape, IE the eyes of a player.
getEyeBaseTransform(MatrixF * mat, bool includeBank)
Returns the eye transform of this shape without including mounted images, IE the eyes of a player.
getRetractionTransform(U32 imageSlot, MatrixF * mat)
The retraction transform is the muzzle transform in world space.
getMuzzleTransform(U32 imageSlot, MatrixF * mat)
Muzzle transform of mounted object in world space.
getImageTransform(U32 imageSlot, MatrixF * mat)
Gets the transform of a mounted image in world space.
getImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
Gets the transform of a node on a mounted image in world space.
getImageTransform(U32 imageSlot, StringTableEntry nodeName, MatrixF * mat)
Gets the transform of a node on a mounted image in world space.
Render transforms
Render transforms are different from object transforms in that the render transform of an object is where, in world space, the object is actually rendered.
The object transform is the absolute position of the object, as in where it should be.
The render transforms typically vary from object transforms due to client side prediction.
Other than that, these functions are identical to their object-transform counterparts
note:These are meaningless on the server.
getRenderRetractionTransform(U32 index, MatrixF * mat)
getRenderMuzzleTransform(U32 index, MatrixF * mat)
getRenderImageTransform(U32 imageSlot, MatrixF * mat, bool noEyeOffset)
getRenderImageTransform(U32 index, S32 node, MatrixF * mat)
getRenderImageTransform(U32 index, StringTableEntry nodeName, MatrixF * mat)
getRenderMuzzleVector(U32 imageSlot, VectorF * vec)
getRenderMuzzlePoint(U32 imageSlot, Point3F * pos)
getRenderEyeTransform(MatrixF * mat)
getRenderEyeBaseTransform(MatrixF * mat, bool includeBank)
Screen Flashing
Returns the level of screenflash that should be used.
setDamageFlash(const F32 amt)
Sets the flash level.
White out is the flash-grenade blindness effect This returns the level of flash to create.
setWhiteOut(const F32)
Set the level of flash blindness.
Movement & velocity
setVelocity(const VectorF & vel)
Sets the velocity of this object.
Cameras and Control
Returns the object controlling this object.
setControllingObject(ShapeBase * obj)
Sets the controlling object.
setControllingClient(GameConnection * client)
Sets the client controlling this object.
Returns the object this is controlling.
setControlObject(ShapeBase * obj)
sets the object this is controlling
bool
Returns true if this object is controlling by something.
bool
Returns true if this object is being used as a camera in first person.
bool
Returns true if the camera uses this objects eye point (defined by modeler)
bool
Returns true if this object can only be used as a first person camera.
Returns the vertical field of view in degrees for this object if used as a camera.
Returns the default vertical field of view in degrees if this object is used as a camera.
setCameraFov(F32 fov)
Sets the vertical field of view in degrees for this object if used as a camera.
bool
isValidCameraFov(F32 fov)
Returns true if the vertical FOV in degrees is within allowable parameters of the datablock.
Rendering
prepRenderImage(SceneRenderState * state)
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Used from ShapeBase::_prepRenderImage() to submit render instances for the main shape or its mounted elements.
Preprender logic.
renderMountedImage(U32 imageSlot, TSRenderState & rstate, SceneRenderState * state)
Virtualize this so other classes may override it for custom reasons.
bool
Returns true if the last frame calculated rendered.
bool
Returns true if this object can be damaged.
submitLights(LightManager * lm, bool staticLighting)
Traverses mounted objects and registers light sources with the light manager.
Increments the last rendered frame number.
Network
getUpdatePriority(CameraScopeQuery * focusObject, U32 updateMask, S32 updateSkips)
This returns a value which is used to prioritize which objects need to be updated.
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Instructs this object to pack its state for transfer over the network.
unpackUpdate(NetConnection * conn, BitStream * stream)
Instructs this object to read state data previously packed with packUpdate.
writePacketData(GameConnection * conn, BitStream * stream)
Write state information necessary to perform client side prediction of an object.
readPacketData(GameConnection * conn, BitStream * stream)
Read data written with writePacketData() and update the object state.
Image Manipulation
scriptCallback(U32 imageSlot, const char * function)
setImage(U32 imageSlot, ShapeBaseImageData * imageData, NetStringHandle & skinNameHandle, bool loaded, bool ammo, bool triggerDown, bool altTriggerDown, bool motion, bool genericTrigger0, bool genericTrigger1, bool genericTrigger2, bool genericTrigger3, bool target)
Assign a ShapeBaseImage to an image slot.
resetImageSlot(U32 imageSlot)
Clear out an image slot.
getImageFireState(U32 imageSlot)
Get the firing action state of the image.
getImageAltFireState(U32 imageSlot)
Get the alternate firing action state of the image.
getImageReloadState(U32 imageSlot)
Get the reload action state of the image.
setImageState(U32 imageSlot, U32 state, bool force)
Sets the state of the image by state index.
updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData * lastState)
const char *
getImageAnimPrefix(U32 imageSlot, S32 imageShapeIndex)
Get the animation prefix for the image.
updateImageAnimation(U32 imageSlot, F32 dt)
Advance animation on a image.
updateImageState(U32 imageSlot, F32 dt)
Advance state of image.
startImageEmitter(MountedImage & image, ShapeBaseImageData::StateData & state)
Start up the particle emitter for the this shapebase.
Light *
getImageLight(U32 imageSlot)
Get light information for a mounted image.
getImageShapeIndex(const MountedImage & image)
Get the shape index to use for a mounted image.
Events
onDeleteNotify(SimObject * object)
Called when a SimObject is deleted.
onImageRecoil(U32 imageSlot, ShapeBaseImageData::StateData::RecoilState )
onImageStateAnimation(U32 imageSlot, const char * seqName, bool direction, bool scaleToState, F32 stateTimeOutValue)
onImageAnimThreadChange(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData * lastState, const char * anim, F32 pos, F32 timeScale, bool reset)
onImageAnimThreadUpdate(U32 imageSlot, S32 imageShapeIndex, F32 dt)
ejectShellCasing(U32 imageSlot)
shakeCamera(U32 imageSlot)
onImpact(SceneObject * obj, const VectorF & vec)
Public Types
DamageState { Enabled Disabled Destroyed NumDamageStates NumDamageStateBits = 2 }
This enum indexes into the sDamageStateName array.
PublicConstants { ThreadSequenceBits = 6 MaxSequenceIndex = (1 << ThreadSequenceBits) - 1 EnergyLevelBits = 5 DamageLevelBits = 6 DamageStateBits = 2 MaxSoundThreads = 4 MaxScriptThreads = 4 MaxMountedImages = 4 MaxImageEmitters = 3 NumImageBits = 3 CollisionTimeoutValue = 250 }
Parent
Protected Types
_Anonymous_ { ANIM_OVERRIDDEN = BIT(0) BLOCK_USER_CONTROL = BIT(1) IS_DEATH_ANIM = BIT(2) BAD_ANIM_ID = 999999999 BLENDED_CLIP = 0x80000000 }
Public Friends
Protected Attributes
Controlling object.
Datablock.
bool
bool
Is this object AI controlled?
bool
mTrigger [MaxTriggerKeys]
What triggers are set, if any.
Public Attributes
Public Static Attributes
Private Attributes
Protected Static Attributes
Public Functions
advanceTime(F32 dt)
Advances simulation time for animations.
buildConvex(const Box3F & box, Convex * convex)
Builds a convex hull for this object.
bool
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)
Builds a list of polygons which intersect a bounding volume.
bool
bool
Returns where the AI should be to repair this object.
getAnimationDuration(const char * name)
getAnimationDurationByID(U32 anim_id)
getAnimationID(const char * name)
Returns the water object we are colliding with, it is up to derived classes to actually set this object.
const char *
getLastClipName(U32 clip_tag)
Returns the height of the liquid on this object.
Returns the percentage of this object covered by water.
bool
bool
isBlendAnimation(const char * name)
onCameraScopeQuery(NetConnection * cr, CameraScopeQuery * camInfo)
Control object scoping.
playAnimation(const char * name, F32 pos, F32 rate, F32 trans, bool hold, bool wait, bool is_death_anim)
playAnimationByID(U32 anim_id, F32 pos, F32 rate, F32 trans, bool hold, bool wait, bool is_death_anim)
bool
pointInWater(Point3F & point)
Returns true if the point specified is in the water.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
restoreAnimation(U32 tag)
setCurrentWaterObject(WaterObject * obj)
setSelectionFlags(U8 flags)
setTransform(const MatrixF & mat)
Sets the Object -> World transform.
unlockAnimation(U32 tag, bool force)
Protected Functions
_prepRenderImage(SceneRenderState * state, bool renderSelf, bool renderMountedImages)
The inner prep render function that does the standard work to render the shapes.
_renderBoundingBox(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * )
Renders the shape bounds as well as the bounds of all mounted shape images.
DECLARE_CALLBACK(F32 , validateCameraFov , (F32 fov) )
playBlendAnimation(S32 seq_id, F32 pos, F32 rate)
restoreBlendAnimation(U32 tag)
Recalculates the spacial sound based on the current position of the object emitting the sound.
updateAudioState(Sound & st)
Updates the audio state of the supplied sound.
Update bouyency and drag properties.
This recalculates the total mass of the object, and all mounted objects.
Prune out non looping sounds from the sound manager which have expired.
Public Static Functions
const char *
_getFieldSkin(void * object, const char * data)
bool
_setFieldSkin(void * object, const char * index, const char * data)
Private Functions
notifyCollisionCallbacks(SceneObject * , const VectorF & vel)
Detailed Description
ShapeBase is the renderable shape from which most of the scriptable objects are derived, including the player, vehicle and items classes.
ShapeBase provides basic shape loading, audio channels, and animation as well as damage (and damage states), energy, and the ability to mount images and objects.
Network state masks
ShapeBaseMasks
Enumerator
- NameMask = Parent::NextFreeMask
- DamageMask = Parent::NextFreeMask << 1
- NoWarpMask = Parent::NextFreeMask << 2
- CloakMask = Parent::NextFreeMask << 3
- SkinMask = Parent::NextFreeMask << 4
- MeshHiddenMask = Parent::NextFreeMask << 5
- SoundMaskN = Parent::NextFreeMask << 6
Extends + MaxSoundThreads bits.
- ThreadMaskN = SoundMaskN << MaxSoundThreads
Extends + MaxScriptThreads bits.
- ImageMaskN = ThreadMaskN << MaxScriptThreads
Extends + MaxMountedImage bits.
- NextFreeMask = ImageMaskN << MaxMountedImages
BaseMaskConstants
Enumerator
- SoundMask = (SoundMaskN << MaxSoundThreads) - SoundMaskN
- ThreadMask = (ThreadMaskN << MaxScriptThreads) - ThreadMaskN
- ImageMask = (ImageMaskN << MaxMountedImages) - ImageMaskN
Scripted Sound
Sound mSoundThread [MaxSoundThreads]
Scripted Animation Threads
Thread mScriptThread [MaxScriptThreads]
Motion
bool mMoveMotion
Indicates that a Move has come in requesting x, y or z motion.
Mounted Images
mountImage(ShapeBaseImageData * image, U32 imageSlot, bool loaded, NetStringHandle & skinNameHandle)
Mount an image (ShapeBaseImage) onto an image slot.
Parameters:
image | ShapeBaseImage to mount |
imageSlot | Image mount point |
loaded | True if weapon is loaded (it assumes it's a weapon) |
skinNameHandle | Skin name for object |
unmountImage(U32 imageSlot)
Unmount an image from a slot.
Parameters:
imageSlot | Mount point |
getMountedImage(U32 imageSlot)
Gets the information on the image mounted in a slot.
Parameters:
imageSlot | Mount point |
getImageStruct(U32 imageSlot)
Gets the mounted image on on a slot.
Parameters:
imageSlot | Mount Point |
getImageShapeInstance(U32 imageSlot)
getPendingImage(U32 imageSlot)
Gets the next image which will be put in an image slot.
imageSlot | mount Point |
isImageFiring(U32 imageSlot)
Returns true if the mounted image is firing.
Parameters:
imageSlot | Mountpoint |
isImageAltFiring(U32 imageSlot)
Returns true if the mounted image is alternate firing.
Parameters:
imageSlot | Mountpoint |
isImageReloading(U32 imageSlot)
Returns true if the mounted image is reloading.
Parameters:
imageSlot | Mountpoint |
isImageReady(U32 imageSlot, U32 ns, U32 depth)
This will return true if, when triggered, the object will fire.
Parameters:
imageSlot | mount point |
ns | Used internally for recursion, do not mess with |
depth | Used internally for recursion, do not mess with |
isImageMounted(ShapeBaseImageData * image)
Returns true if the specified image is mounted.
Parameters:
image | ShapeBase image |
getMountSlot(ShapeBaseImageData * image)
Returns the slot which the image specified is mounted on.
Parameters:
image | Image to test for |
getImageSkinTag(U32 imageSlot)
Returns the skin for the image in a slot.
Parameters:
imageSlot | Image slot to get the skin from |
hasImageState(U32 imageSlot, const char * state)
Check if the given state exists on the mounted Image.
Parameters:
imageSlot | Image slot id |
state | Image state to check for |
getImageState(U32 imageSlot)
Returns the image state as a string.
Parameters:
imageSlot | Image slot to check state |
setImageGenericTriggerState(U32 imageSlot, U32 trigger, bool state)
Sets the generic trigger state of the image.
Parameters:
imageSlot | Image slot |
trigger | Generic trigger number 0-3 |
state | True if generic trigger is down |
getImageGenericTriggerState(U32 imageSlot, U32 trigger)
Returns the generic trigger state of the image.
Parameters:
imageSlot | Image slot |
trigger | Generic trigger number 0-3 |
setImageTriggerState(U32 imageSlot, bool trigger)
Sets the trigger state of the image (Ie trigger pulled down on gun)
Parameters:
imageSlot | Image slot |
trigger | True if trigger is down |
getImageTriggerState(U32 imageSlot)
Returns the trigger state of the image.
Parameters:
imageSlot | Image slot |
setImageAltTriggerState(U32 imageSlot, bool trigger)
Sets the alt trigger state of the image (Ie trigger pulled down on gun)
Parameters:
imageSlot | Image slot |
trigger | True if trigger is down |
getImageAltTriggerState(U32 imageSlot)
Returns the alt trigger state of the image.
Parameters:
imageSlot | Image slot |
setImageAmmoState(U32 imageSlot, bool ammo)
Sets the flag if the image uses ammo or energy.
Parameters:
imageSlot | Image slot |
ammo | True if the weapon uses ammo, not energy |
getImageAmmoState(U32 imageSlot)
Returns true if the image uses ammo, not energy.
Parameters:
imageSlot | Image slot |
setImageWetState(U32 imageSlot, bool wet)
Sets the image as wet or not, IE if you wanted a gun not to function underwater.
Parameters:
imageSlot | Image slot |
wet | True if image is wet |
getImageWetState(U32 imageSlot)
Returns true if image is wet.
Parameters:
imageSlot | image slot |
setImageMotionState(U32 imageSlot, bool motion)
Sets the image as in motion or not, IE if you wanted a gun not to sway while the player is in motion.
Parameters:
imageSlot | Image slot |
motion | True if image is in motion |
getImageMotionState(U32 imageSlot)
Returns true if image is in motion.
Parameters:
imageSlot | image slot |
setImageTargetState(U32 imageSlot, bool ammo)
Sets the flag if the image has a target.
Parameters:
imageSlot | Image slot |
ammo | True if the weapon has a target |
getImageTargetState(U32 imageSlot)
Returns true if the image has a target.
Parameters:
imageSlot | Image slot |
setImageLoadedState(U32 imageSlot, bool loaded)
Sets the flag of if the image is loaded with ammo.
Parameters:
imageSlot | Image slot |
loaded | True if object is loaded with ammo |
getImageLoadedState(U32 imageSlot)
Returns true if object is loaded with ammo.
Parameters:
imageSlot | Image slot |
setImageScriptAnimPrefix(U32 imageSlot, NetStringHandle prefix)
Set the script animation prefix for the image.
Parameters:
imageSlot | Image slot id |
prefix | The prefix applied to the image |
getImageScriptAnimPrefix(U32 imageSlot)
Get the script animation prefix for the image.
Parameters:
imageSlot | Image slot id |
imageShapeIndex | Shape index (1st person, etc.) used to look up the prefix text |
getCorrectedAim(const MatrixF & muzMat, VectorF * result)
Modify muzzle, if needed, to aim at whatever is straight in front of eye.
Returns true if result is actually modified. Parameters:
muzMat | Muzzle transform (in/out) |
result | Corrected muzzle vector (out) |
getMuzzleVector(U32 imageSlot, VectorF * vec)
Gets the muzzle vector of a specified slot.
Parameters:
imageSlot | Image slot to check transform for |
vec | Muzzle vector (out) |
Reimplemented by: AIPlayer, Player
getMuzzlePoint(U32 imageSlot, Point3F * pos)
Gets the point of the muzzle of the image.
Parameters:
imageSlot | Image slot |
pos | Muzzle point (out) |
MountedImage mMountedImageList [MaxMountedImages]
Render settings
TSShapeInstance * mShapeInstance
Convex * mConvexList
NetStringHandle mSkinNameHandle
String mAppliedSkinName
NetStringHandle mShapeNameHandle
Name sent to client.
Physical Properties
Properties for the current object, which are calculated based on the container we are in.
S32 mAiPose
Current pose.
F32 mEnergy
Current enery level.
F32 mRechargeRate
Energy recharge rate (in units/tick).
F32 mMass
Mass.
F32 mOneOverMass
Inverse of mass.
note:This is used to optimize certain physics calculations.
F32 mDrag
Drag.
F32 mBuoyancy
Buoyancy factor.
String mLiquidType
Type of liquid (if any) we are in.
F32 mLiquidHeight
Height of liquid around us (from 0..1).
F32 mWaterCoverage
Percent of this object covered by water.
Point3F mAppliedForce
F32 mNetGravity
Damage
F32 mDamage
F32 mRepairRate
F32 mRepairReserve
DamageState mDamageState
TSThread * mDamageThread
TSThread * mHulkThread
VectorF damageDir
Cloaking
forceUncloak(const char * reason)
Force uncloaking of object.
Parameters:
reason | Reason this is being forced to uncloak, this is passed directly to script control |
setCloakedState(bool cloaked)
Set cloaked state of object.
Parameters:
cloaked | True if object is cloaked |
getCloakedState()
Returns true if object is cloaked.
getCloakLevel()
Returns level of cloaking, as it's not an instant "now you see it, now you don't".
bool mCloaked
F32 mCloakLevel
Fading
getFadeVal()
bool mFadeOut
bool mFading
F32 mFadeVal
F32 mFadeElapsedTime
F32 mFadeTime
F32 mFadeDelay
Control info
F32 mCameraFov
The camera vertical FOV in degrees.
bool mIsControlled
Client side controlled flag.
Mesh Visibility
setAllMeshesHidden(bool forceHidden)
Change the hidden state on all the meshes.
setMeshHidden(S32 meshIndex, bool forceHidden)
Set the force hidden state on a mesh.
setMeshHidden(const char * meshName, bool forceHidden)
Set the force hidden state on a named mesh.
dumpMeshVisibility()
Prints the list of meshes and their visibility state to the console for debugging purposes.
_updateHiddenMeshes()
Sync the shape instance with the hidden mesh bit vector.
BitVector mMeshHidden
A bit vector of the meshes forced to be hidden.
Collision Notification
This is used to keep us from spamming collision notifications.
When a collision occurs, we add to this list; then we don't notify anyone of the collision until the CollisionTimeout expires (which by default occurs in 1/10 of a second).
notifyCollision()
Go through all the items in the collision queue and call onCollision on them all.
queueCollision(SceneObject * object, const VectorF & vec)
Add a collision to the queue of collisions waiting to be handled.
object | Object collision occurs with |
vec | Vector along which collision occurs |
onCollision(SceneObject * object, const VectorF & vec)
Reimplemented from: SceneObject
CollisionTimeout * mTimeoutList
CollisionTimeout * sFreeTimeoutList
Initialization
onAdd()
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VActor
onRemove()
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VActor
onSceneRemove()
Reimplemented from: SceneObject
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VHumanoidActor, VActor
consoleInit()
Name & Skin tags
setShapeName(const char * )
getShapeName()
setSkinName(const char * )
getSkinName()
Basic attributes
setDamageLevel(F32 damage)
Sets the amount of damage on this object.
setDamageState(DamageState state)
Changes the object's damage state.
Parameters:
state | New state of the object |
setDamageState(const char * state)
Changes the object's damage state, based on a named state.
state | New state of the object as a string. |
getDamageStateName()
Returns the name of the current damage state as a string.
getDamageState()
Returns the current damage state.
isDestroyed()
Returns true if the object is destroyed.
setRepairRate(F32 rate)
Sets the rate at which the object regenerates damage.
Parameters:
rate | Repair rate in units/second. |
getDamageLevel()
Returns damage amount.
getDamageValue()
Returns the damage percentage.
Damage factor, between 0.0 - 1.0
getMaxDamage()
Returns the datablock.maxDamage value
getRepairRate()
Returns the rate at which the object regenerates damage.
applyDamage(F32 amount)
Adds damage to an object.
Parameters:
amount | Amount of of damage to add |
applyRepair(F32 amount)
Removes damage to an object.
Parameters:
amount | Amount to repair object by |
setDamageDir(const VectorF & vec)
Sets the direction from which the damage is coming.
Parameters:
vec | Vector indicating the direction of the damage |
setEnergyLevel(F32 energy)
Sets the level of energy for this object.
Parameters:
energy | Level of energy to assign to this object |
Reimplemented by: RigidShape
setRechargeRate(F32 rate)
Sets the rate at which the energy replentishes itself.
Parameters:
rate | Rate at which energy restores |
getEnergyLevel()
Returns the amount of energy in the object.
getEnergyValue()
Returns the percentage of energy, 0.0 - 1.0.
getRechargeRate()
Returns the recharge rate.
blowUp()
Makes the shape explode.
Script sounds
playAudio(U32 slot, SFXTrack * track)
Plays an audio sound from a mounted object.
Parameters:
slot | Mount slot ID |
track | Audio track to play |
playAudio(U32 slot, SFXProfile * profile)
stopAudio(U32 slot)
Stops audio from a mounted object.
Parameters:
slot | Mount slot ID |
Script animation
getThreadSequenceName(U32 slot)
setThreadSequence(U32 slot, S32 seq, bool reset)
Sets the animation thread for a mounted object.
Parameters:
slot | Mount slot ID |
seq | Sequence id |
reset | Reset the sequence |
updateThread(Thread & st)
Update the animation thread.
Parameters:
st | Thread to update |
stopThread(U32 slot)
Stop the current thread from playing on a mounted object.
Parameters:
slot | Mount slot ID |
destroyThread(U32 slot)
Destroys the given animation thread.
Parameters:
slot | Mount slot ID |
pauseThread(U32 slot)
Pause the running animation thread.
Parameters:
slot | Mount slot ID |
playThread(U32 slot)
Start playing the running animation thread again.
Parameters:
slot | Mount slot ID |
setThreadPosition(U32 slot, F32 pos)
Set the thread position.
Parameters:
slot | Mount slot ID |
pos | Position |
setThreadDir(U32 slot, bool forward)
Toggle the thread as reversed or normal (For example, sidestep-right reversed is sidestep-left)
Parameters:
slot | Mount slot ID |
forward | True if the animation is to be played normally |
setThreadTimeScale(U32 slot, F32 timeScale)
Set the thread time scale.
Parameters:
slot | Mount slot ID |
timescale | Timescale |
advanceThreads(F32 dt)
Advance all animation threads attached to this shapebase.
Parameters:
dt | Change in time from last call to this function |
Mounted objects
onMount(SceneObject * obj, S32 node)
Reimplemented from: GameBase
Reimplemented by: VActor
onUnmount(SceneObject * obj, S32 node)
Reimplemented from: GameBase
Reimplemented by: Player, StaticShape, TurretShape, VActor
getMountTransform(S32 index, const MatrixF & xfm, MatrixF * outMat)
Reimplemented from: SceneObject
getRenderMountTransform(F32 delta, S32 index, const MatrixF & xfm, MatrixF * outMat)
Reimplemented from: SceneObject
Transforms
getCameraParameters(F32 * min, F32 * max, Point3F * offset, MatrixF * rot)
Gets the minimum viewing distance, maximum viewing distance, camera offsetand rotation for this object, if the world were to be viewed through its eyes.
Parameters:
min | Minimum viewing distance |
max | Maximum viewing distance |
offset | Offset of the camera from the origin in local space |
rot | Rotation matrix |
Reimplemented by: Player, RigidShape, TurretShape, Vehicle
getCameraTransform(F32 * pos, MatrixF * mat)
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera, PathCamera, RigidShape, TurretShape, Vehicle
getEyeCameraTransform(IDisplayDevice * display, U32 eyeId, MatrixF * outMat)
Reimplemented from: GameBase
Reimplemented by: Camera
getNodeIndex(U32 imageSlot, StringTableEntry nodeName)
Gets the index of a node inside a mounted image given the name.
Parameters:
imageSlot | Image slot |
nodeName | Node name |
Object Transforms
getEyeTransform(MatrixF * mat)
Returns the eye transform of this shape, IE the eyes of a player.
Parameters:
mat | Eye transform (out) |
Reimplemented by: Player
getEyeBaseTransform(MatrixF * mat, bool includeBank)
Returns the eye transform of this shape without including mounted images, IE the eyes of a player.
Parameters:
mat | Eye transform (out) |
Reimplemented by: Player
getRetractionTransform(U32 imageSlot, MatrixF * mat)
The retraction transform is the muzzle transform in world space.
If the gun is pushed back, for instance, if the player ran against something, the muzzle of the gun gets pushed back towards the player, towards this location. Parameters:
imageSlot | Image slot |
mat | Transform (out) |
getMuzzleTransform(U32 imageSlot, MatrixF * mat)
Muzzle transform of mounted object in world space.
Parameters:
imageSlot | Image slot |
mat | Muzzle transform (out) |
Reimplemented by: Player
getImageTransform(U32 imageSlot, MatrixF * mat)
Gets the transform of a mounted image in world space.
Parameters:
imageSlot | Image slot |
mat | Transform (out) |
Reimplemented by: TurretShape
getImageTransform(U32 imageSlot, S32 node, MatrixF * mat)
Gets the transform of a node on a mounted image in world space.
Parameters:
imageSlot | Image Slot |
node | node on image |
mat | Transform (out) |
Reimplemented by: TurretShape
getImageTransform(U32 imageSlot, StringTableEntry nodeName, MatrixF * mat)
Gets the transform of a node on a mounted image in world space.
Parameters:
imageSlot | Image Slot |
nodeName | Name of node on image |
mat | Transform (out) |
Render transforms
Render transforms are different from object transforms in that the render transform of an object is where, in world space, the object is actually rendered.
The object transform is the absolute position of the object, as in where it should be.
The render transforms typically vary from object transforms due to client side prediction.
Other than that, these functions are identical to their object-transform counterparts
note:These are meaningless on the server.
getRenderRetractionTransform(U32 index, MatrixF * mat)
getRenderMuzzleTransform(U32 index, MatrixF * mat)
Reimplemented by: Player
getRenderImageTransform(U32 imageSlot, MatrixF * mat, bool noEyeOffset)
Reimplemented by: TurretShape
getRenderImageTransform(U32 index, S32 node, MatrixF * mat)
Reimplemented by: TurretShape
getRenderImageTransform(U32 index, StringTableEntry nodeName, MatrixF * mat)
getRenderMuzzleVector(U32 imageSlot, VectorF * vec)
getRenderMuzzlePoint(U32 imageSlot, Point3F * pos)
getRenderEyeTransform(MatrixF * mat)
Reimplemented by: Player
getRenderEyeBaseTransform(MatrixF * mat, bool includeBank)
Reimplemented by: Player
Screen Flashing
getDamageFlash()
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
setDamageFlash(const F32 amt)
Sets the flash level.
Parameters:
amt | Level of flash |
getWhiteOut()
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
setWhiteOut(const F32)
Set the level of flash blindness.
Movement & velocity
setVelocity(const VectorF & vel)
Reimplemented from: SceneObject
Reimplemented by: Camera, Item, Player
applyImpulse(const Point3F & pos, const VectorF & vec)
Reimplemented from: SceneObject
Reimplemented by: Item, Player, RigidShape
Cameras and Control
getControllingObject()
Reimplemented from: GameBase
setControllingObject(ShapeBase * obj)
Sets the controlling object.
Parameters:
obj | New controlling object |
setControllingClient(GameConnection * client)
Reimplemented from: GameBase
Reimplemented by: Player, afxCamera
getControlObject()
Reimplemented from: GameBase
Reimplemented by: Player
setControlObject(ShapeBase * obj)
sets the object this is controlling
Parameters:
obj | New controlled object |
Reimplemented by: Player
isControlled()
Returns true if this object is controlling by something.
isFirstPerson()
Returns true if this object is being used as a camera in first person.
useObjsEyePoint()
Reimplemented from: GameBase
onlyFirstPerson()
Reimplemented from: GameBase
getCameraFov()
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
getDefaultCameraFov()
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
setCameraFov(F32 fov)
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
isValidCameraFov(F32 fov)
Reimplemented from: GameBase
Reimplemented by: afxCamera, Camera
Rendering
getShape()
Returns the renderable shape of this object.
prepRenderImage(SceneRenderState * state)
Reimplemented from: SceneObject
Reimplemented by: afxStaticShape, Item, Player, ProximityMine, TurretShape
prepBatchRender(SceneRenderState * state, S32 mountedImageIndex)
Used from ShapeBase::_prepRenderImage() to submit render instances for the main shape or its mounted elements.
Reimplemented by: RigidShape, AITurretShape, TurretShape, Vehicle, WheeledVehicle
calcClassRenderData()
Preprender logic.
Reimplemented by: Player
renderMountedImage(U32 imageSlot, TSRenderState & rstate, SceneRenderState * state)
Virtualize this so other classes may override it for custom reasons.
Reimplemented by: Player
didRenderLastRender()
Returns true if the last frame calculated rendered.
setHidden(bool hidden)
Reimplemented from: SceneObject
Reimplemented by: WayPoint
isInvincible()
Returns true if this object can be damaged.
startFade(F32 fadeTime, F32 fadeDelay, bool fadeOut)
Start fade of object in/out.
Parameters:
fadeTime | Time fade should take |
fadeDelay | Delay before starting fade |
fadeOut | True if object is fading out, false if fading in. |
submitLights(LightManager * lm, bool staticLighting)
Reimplemented from: ISceneLight
getLight()
Reimplemented from: ISceneLight
incRenderFrame()
Increments the last rendered frame number.
Network
getUpdatePriority(CameraScopeQuery * focusObject, U32 updateMask, S32 updateSkips)
Reimplemented from: GameBase
packUpdate(NetConnection * conn, U32 mask, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VHumanoidActor, VActor
unpackUpdate(NetConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VHumanoidActor, VActor
writePacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: TurretShape, FlyingVehicle, Vehicle, WheeledVehicle
readPacketData(GameConnection * conn, BitStream * stream)
Reimplemented from: GameBase
Reimplemented by: TurretShape, FlyingVehicle, Vehicle, WheeledVehicle
Image Manipulation
scriptCallback(U32 imageSlot, const char * function)
Utility function to call script functions which have to do with ShapeBase objects.
Parameters:
imageSlot | Image Slot id |
function | Function |
setImage(U32 imageSlot, ShapeBaseImageData * imageData, NetStringHandle & skinNameHandle, bool loaded, bool ammo, bool triggerDown, bool altTriggerDown, bool motion, bool genericTrigger0, bool genericTrigger1, bool genericTrigger2, bool genericTrigger3, bool target)
Assign a ShapeBaseImage to an image slot.
Parameters:
imageSlot | Image Slot ID |
imageData | ShapeBaseImageData to assign |
skinNameHandle | Skin texture name |
loaded | Is the image loaded? |
ammo | Does the image have ammo? |
triggerDown | Is the trigger on this image down? |
altTriggerDown | Is the second trigger on this image down? |
target | Does the image have a target? |
resetImageSlot(U32 imageSlot)
Clear out an image slot.
Parameters:
imageSlot | Image slot id |
getImageFireState(U32 imageSlot)
Get the firing action state of the image.
Parameters:
imageSlot | Image slot id |
getImageAltFireState(U32 imageSlot)
Get the alternate firing action state of the image.
Parameters:
imageSlot | Image slot id |
getImageReloadState(U32 imageSlot)
Get the reload action state of the image.
Parameters:
imageSlot | Image slot id |
setImageState(U32 imageSlot, U32 state, bool force)
Sets the state of the image by state index.
Parameters:
imageSlot | Image slot id |
state | State id |
force | Force image to state or let it finish then change |
updateAnimThread(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData * lastState)
getImageAnimPrefix(U32 imageSlot, S32 imageShapeIndex)
Get the animation prefix for the image.
Parameters:
imageSlot | Image slot id |
imageShapeIndex | Shape index (1st person, etc.) used to look up the prefix text |
Reimplemented by: Player
updateImageAnimation(U32 imageSlot, F32 dt)
Advance animation on a image.
Parameters:
imageSlot | Image slot id |
dt | Change in time since last animation update |
updateImageState(U32 imageSlot, F32 dt)
Advance state of image.
Parameters:
imageSlot | Image slot id |
dt | Change in time since last state update |
startImageEmitter(MountedImage & image, ShapeBaseImageData::StateData & state)
Start up the particle emitter for the this shapebase.
Parameters:
image | Mounted image |
state | State of shape base image |
getImageLight(U32 imageSlot)
Get light information for a mounted image.
Parameters:
imageSlot | Image slot id |
getImageShapeIndex(const MountedImage & image)
Get the shape index to use for a mounted image.
Parameters:
image | Mounted image |
Events
onDeleteNotify(SimObject * object)
Reimplemented from: SceneObject
Reimplemented by: Item, afxCamera, Camera
onImage(U32 imageSlot, bool unmount)
Reimplemented by: Player, TurretShape
onImageRecoil(U32 imageSlot, ShapeBaseImageData::StateData::RecoilState )
Reimplemented by: Player, TurretShape
onImageStateAnimation(U32 imageSlot, const char * seqName, bool direction, bool scaleToState, F32 stateTimeOutValue)
Reimplemented by: Player, TurretShape
onImageAnimThreadChange(U32 imageSlot, S32 imageShapeIndex, ShapeBaseImageData::StateData * lastState, const char * anim, F32 pos, F32 timeScale, bool reset)
Reimplemented by: Player
onImageAnimThreadUpdate(U32 imageSlot, S32 imageShapeIndex, F32 dt)
Reimplemented by: Player
ejectShellCasing(U32 imageSlot)
shakeCamera(U32 imageSlot)
updateDamageLevel()
Reimplemented by: Player, TurretShape
updateDamageState()
Reimplemented by: Player
onImpact(SceneObject * obj, const VectorF & vec)
onImpact(const VectorF & vec)
Public Types
DamageState
Enumerator
- Enabled
- Disabled
- Destroyed
- NumDamageStates
- NumDamageStateBits = 2
Should be log2 of the number of states.
This enum indexes into the sDamageStateName array.
PublicConstants
Enumerator
- ThreadSequenceBits = 6
- MaxSequenceIndex = (1 << ThreadSequenceBits) - 1
- EnergyLevelBits = 5
- DamageLevelBits = 6
- DamageStateBits = 2
- MaxSoundThreads = 4
Should be a power of 2.
- MaxScriptThreads = 4
Should be a power of 2.
- MaxMountedImages = 4
Should be a power of 2.
- MaxImageEmitters = 3
- NumImageBits = 3
- CollisionTimeoutValue = 250
Timeout in ms.
typedef GameBase Parent
Protected Types
@200
Enumerator
- ANIM_OVERRIDDEN = BIT(0)
- BLOCK_USER_CONTROL = BIT(1)
- IS_DEATH_ANIM = BIT(2)
- BAD_ANIM_ID = 999999999
- BLENDED_CLIP = 0x80000000
Public Friends
Protected Attributes
U8 anim_clip_flags
Vector< BlendThread > blend_clips
S32 last_anim_id
U32 last_anim_lock_tag
U32 last_anim_tag
ShapeBase * mControllingObject
Controlling object.
F32 mDamageFlash
ShapeBaseData * mDataBlock
Datablock.
bool mFlipFadeVal
bool mIsAiControlled
Is this object AI controlled?
F32 mLastRenderDistance
U32 mLastRenderFrame
ShapeBase * mShapeBaseMount
bool mTrigger [MaxTriggerKeys]
What triggers are set, if any.
F32 mWhiteOut
F32 saved_pos
F32 saved_rate
S32 saved_seq_id
Public Attributes
CubeReflector mCubeReflector
Public Static Attributes
F32 sCloakSpeed
F32 sDamageFlashDec
F32 sFullCorrectionDistance
U32 sLastRenderFrame
F32 sWhiteoutDec
Private Attributes
Vector< CollisionEventCallback * > collision_callbacks
Protected Static Attributes
U32 unique_anim_tag_counter
Public Functions
ShapeBase()
~ShapeBase()
advanceTime(F32 dt)
Reimplemented from: ProcessObject
Reimplemented by: AITurretShape, TurretShape, FlyingVehicle, HoverVehicle, Vehicle, WheeledVehicle, VHumanoidActor
buildConvex(const Box3F & box, Convex * convex)
Reimplemented from: SceneObject
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)
Reimplemented from: SceneObject
Reimplemented by: WheeledVehicle
castRay(const Point3F & start, const Point3F & end, RayInfo * info)
Reimplemented from: SceneObject
castRayRendered(const Point3F & start, const Point3F & end, RayInfo * info)
Reimplemented from: SceneObject
DECLARE_CONOBJECT(ShapeBase )
getAIRepairPoint()
Returns where the AI should be to repair this object.
note:Legacy code from Tribes 2, but still works
getAnimationDuration(const char * name)
getAnimationDurationByID(U32 anim_id)
Reimplemented by: Player
getAnimationID(const char * name)
Reimplemented by: Player
getCurrentWaterObject()
Reimplemented from: GameBase
getLastClipName(U32 clip_tag)
Reimplemented by: Player
getLiquidHeight()
Returns the height of the liquid on this object.
getMass()
Reimplemented from: SceneObject
getShapeInstance()
getWaterCoverage()
Returns the percentage of this object covered by water.
isAnimationLocked()
Reimplemented by: Player
isBlendAnimation(const char * name)
Reimplemented by: Player
lockAnimation()
Reimplemented by: Player
onCameraScopeQuery(NetConnection * cr, CameraScopeQuery * camInfo)
Reimplemented from: SceneObject
playAnimation(const char * name, F32 pos, F32 rate, F32 trans, bool hold, bool wait, bool is_death_anim)
playAnimationByID(U32 anim_id, F32 pos, F32 rate, F32 trans, bool hold, bool wait, bool is_death_anim)
Reimplemented by: Player
pointInWater(Point3F & point)
Returns true if the point specified is in the water.
Parameters:
point | Point to test in world space |
processTick(const Move * move)
Reimplemented from: GameBase
Reimplemented by: StaticShape, AITurretShape, TurretShape, Vehicle, WheeledVehicle, VHumanoidActor, VActor
registerCollisionCallback(CollisionEventCallback * )
restoreAnimation(U32 tag)
Reimplemented by: Player
setCurrentWaterObject(WaterObject * obj)
setSelectionFlags(U8 flags)
Reimplemented from: SceneObject
setTransform(const MatrixF & mat)
Reimplemented from: SceneObject
Reimplemented by: StaticShape, AITurretShape, TurretShape, VActor
unlockAnimation(U32 tag, bool force)
Reimplemented by: Player
unregisterCollisionCallback(CollisionEventCallback * )
Protected Functions
_prepRenderImage(SceneRenderState * state, bool renderSelf, bool renderMountedImages)
The inner prep render function that does the standard work to render the shapes.
_renderBoundingBox(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * )
Renders the shape bounds as well as the bounds of all mounted shape images.
DECLARE_CALLBACK(F32 , validateCameraFov , (F32 fov) )
emitDust(ParticleEmitter * emitter, F32 triggerHeight, const Point3F & offset, U32 numMilliseconds, const Point3F & axis)
Emit particles on the given emitter, if we're within triggerHeight above some static surface with a material that has 'showDust' set to true.
The particles will have a lifetime of 'numMilliseconds' and be emitted at the given offset from the contact point having a direction of 'axis'.
playBlendAnimation(S32 seq_id, F32 pos, F32 rate)
reSkin()
Do a reskin if necessary.
Reimplemented by: Player
restoreBlendAnimation(U32 tag)
updateAudioPos()
Recalculates the spacial sound based on the current position of the object emitting the sound.
updateAudioState(Sound & st)
Updates the audio state of the supplied sound.
Parameters:
st |
updateContainer()
Update bouyency and drag properties.
updateMass()
This recalculates the total mass of the object, and all mounted objects.
updateServerAudio()
Prune out non looping sounds from the sound manager which have expired.
Public Static Functions
_getFieldSkin(void * object, const char * data)
_setFieldSkin(void * object, const char * index, const char * data)
initPersistFields()