torque Torque Game Engine Documentation
TGE Version 1.5.2

ShapeBase Class Reference

#include <shapeBase.h>

Inheritance diagram for ShapeBase:

Inheritance graph
[legend]

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

enum  ShapeBaseMasks {
  NameMask = Parent::NextFreeMask,
  DamageMask = Parent::NextFreeMask << 1,
  NoWarpMask = Parent::NextFreeMask << 2,
  MountedMask = Parent::NextFreeMask << 3,
  CloakMask = Parent::NextFreeMask << 4,
  ShieldMask = Parent::NextFreeMask << 5,
  InvincibleMask = Parent::NextFreeMask << 6,
  SkinMask = Parent::NextFreeMask << 7,
  SoundMaskN = Parent::NextFreeMask << 8,
  ThreadMaskN = SoundMaskN << MaxSoundThreads,
  ImageMaskN = ThreadMaskN << MaxScriptThreads,
  NextFreeMask = ImageMaskN << MaxMountedImages
}
enum  BaseMaskConstants {
  SoundMask = (SoundMaskN << MaxSoundThreads) - SoundMaskN,
  ThreadMask = (ThreadMaskN << MaxScriptThreads) - ThreadMaskN,
  ImageMask = (ImageMaskN << MaxMountedImages) - ImageMaskN
}

Scripted Sound

Sound mSoundThread [MaxSoundThreads]

Scripted Animation Threads

Thread mScriptThread [MaxScriptThreads]

Invincibility

F32 mInvincibleCount
F32 mInvincibleTime
F32 mInvincibleSpeed
F32 mInvincibleDelta
F32 mInvincibleEffect
F32 mInvincibleFade
bool mInvincibleOn

Mounted Images

MountedImage mMountedImageList [MaxMountedImages]

Render settings

TSShapeInstancemShapeInstance
ConvexmConvexList
StringHandle mSkinNameHandle
StringHandle mShapeNameHandle
 Name sent to client.

Physical Properties

F32 mEnergy
 Current enery level.
F32 mRechargeRate
 Energy recharge rate (in units/tick).
bool mChargeEnergy
 Are we currently charging?
F32 mMass
 Mass.
F32 mOneOverMass
 Inverse of mass.

Physical Properties

Properties for the current object, which are calculated based on the container we are in.

See also:
ShapeBase::updateContainer()

ShapeBase::mContainer



F32 mDrag
 Drag.
F32 mBuoyancy
 Buoyancy factor.
U32 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 mGravityMod

Damage

F32 mDamage
F32 mRepairRate
F32 mRepairReserve
bool mRepairDamage
DamageState mDamageState
TSThreadmDamageThread
TSThreadmHulkThread
VectorF damageDir
bool blowApart

Cloaking

bool mCloaked
F32 mCloakLevel
TextureHandle mCloakTexture
bool mHidden
 in/out of world

Fading

bool mFadeOut
bool mFading
F32 mFadeVal
F32 mFadeElapsedTime
F32 mFadeTime
F32 mFadeDelay

Control info

F32 mCameraFov
 Camera FOV(in degrees).
bool mIsControlled
 Client side controlled flag.

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).

See also:
notifyCollision(), queueCollision()


CollisionTimeoutmTimeoutList
static CollisionTimeoutsFreeTimeoutList
void notifyCollision ()
 Go through all the items in the collision queue and call onCollision on them all.
virtual void onCollision (ShapeBase *object, VectorF vec)
 This gets called when an object collides with this object.
void queueCollision (ShapeBase *object, const VectorF &vec)
 Add a collision to the queue of collisions waiting to be handled.

Initialization

bool onAdd ()
 Called when the object is added to the sim.
void onRemove ()
 Called when the object is removed from the sim.
void onSceneRemove ()
 Called when this is removed from the SceneGraph.
bool onNewDataBlock (GameBaseData *dptr)
 Called when a new datablock is set.
static void consoleInit ()
 Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.

Name & Skin tags

void setShapeName (const char *)
const char * getShapeName ()
void setSkinName (const char *)
const char * getSkinName ()

Basic attributes

void setDamageLevel (F32 damage)
 Sets the ammount of damage on this object.
void 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 * getDamageStateName ()
 Returns the name of the current damage state as a string.
DamageState getDamageState ()
 Returns the current damage state.
bool isDestroyed ()
 Returns true if the object is destroyed.
void setRepairRate (F32 rate)
 Sets the rate at which the object regenerates damage.
F32 getDamageLevel ()
 Returns damage amount.
F32 getDamageValue ()
 Returns the damage percentage.
F32 getRepairRate ()
 Returns the rate at which the object regenerates damage.
void applyDamage (F32 amount)
 Adds damage to an object.
void applyRepair (F32 amount)
 Removes damage to an object.
void setDamageDir (const VectorF &vec)
 Sets the direction from which the damage is coming.
virtual void setEnergyLevel (F32 energy)
 Sets the level of energy for this object.
void setRechargeRate (F32 rate)
 Sets the rate at which the energy replentishes itself.
F32 getEnergyLevel ()
 Returns the amount of energy in the object.
F32 getEnergyValue ()
 Returns the percentage of energy, 0.0 - 1.0.
F32 getRechargeRate ()
 Returns the recharge rate.

Script sounds

void playAudio (U32 slot, AudioProfile *profile)
 Plays an audio sound from a mounted object.
void stopAudio (U32 slot)
 Stops audio from a mounted object.

Script animation

bool setThreadSequence (U32 slot, S32 seq, bool reset=true)
 Sets the animation thread for a mounted object.
void updateThread (Thread &st)
 Update the animation thread.
bool stopThread (U32 slot)
 Stop the current thread from playing on a mounted object.
bool pauseThread (U32 slot)
 Pause the running animation thread.
bool playThread (U32 slot)
 Start playing the running animation thread again.
bool setThreadDir (U32 slot, bool forward)
 Toggle the thread as reversed or normal (For example, sidestep-right reversed is sidestep-left).
void startSequenceSound (Thread &thread)
 Start the sound associated with an animation thread.
void stopThreadSound (Thread &thread)
 Stop the sound associated with an animation thread.
void advanceThreads (F32 dt)
 Advance all animation threads attached to this shapebase.

Cloaking

void forceUncloak (const char *reason)
 Force uncloaking of object.
void setCloakedState (bool cloaked)
 Set cloaked state of object.
bool getCloakedState ()
 Returns true if object is cloaked.
F32 getCloakLevel ()
 Returns level of cloaking, as it's not an instant "now you see it, now you don't".

Mounted objects

virtual void mountObject (ShapeBase *obj, U32 node)
 Mount an object to a mount point.
void unmountObject (ShapeBase *obj)
 Remove an object mounting.
void unmount ()
 Unmount this object from it's mount.
ShapeBasegetObjectMount ()
 Return the object that this object is mounted to.
ShapeBasegetMountLink ()
 Return object link of next object mounted to this object's mount.
ShapeBasegetMountList ()
 Returns the list of things mounted along with this object.
U32 getMountNode ()
 Returns the mount id that this is mounted to.
bool isMounted ()
 Returns true if this object is mounted to anything at all.
S32 getMountedObjectCount ()
 Returns the number of object mounted along with this.
ShapeBasegetMountedObject (S32 idx)
 Returns the object mounted at a position in the mount list.
S32 getMountedObjectNode (S32 idx)
 Returns the node the object at idx is mounted to.
ShapeBasegetMountNodeObject (S32 node)
 Returns the object a object on the mount list is mounted to.
Point3F getAIRepairPoint ()
 Returns where the AI should be to repair this object.

Mounted Images

virtual bool mountImage (ShapeBaseImageData *image, U32 imageSlot, bool loaded, StringHandle &skinNameHandle)
 Mount an image (ShapeBaseImage) onto an image slot.
virtual bool unmountImage (U32 imageSlot)
 Unmount an image from a slot.
ShapeBaseImageDatagetMountedImage (U32 imageSlot)
 Gets the information on the image mounted in a slot.
MountedImagegetImageStruct (U32 imageSlot)
 Gets the mounted image on on a slot.
TSShapeInstancegetImageShapeInstance (U32 imageSlot)
ShapeBaseImageDatagetPendingImage (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 isImageReady (U32 imageSlot, U32 ns=(U32)-1, U32 depth=0)
 This will return true if, when triggered, the object will fire.
bool isImageMounted (ShapeBaseImageData *image)
 Returns true if the specified image is mounted.
S32 getMountSlot (ShapeBaseImageData *image)
 Returns the slot which the image specified is mounted on.
StringHandle getImageSkinTag (U32 imageSlot)
 Returns the skin for the image in a slot.
const char * getImageState (U32 imageSlot)
 Returns the image state as a string.
void 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.
void 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.
void 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.
void 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.
bool getCorrectedAim (const MatrixF &muzMat, VectorF *result)
 Modify muzzle, if needed, to aim at whatever is straight in front of eye.
virtual void getMuzzleVector (U32 imageSlot, VectorF *vec)
 Gets the muzzle vector of a specified slot.
void getMuzzlePoint (U32 imageSlot, Point3F *pos)
 Gets the point of the muzzle of the image.

Transforms

virtual void 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.
virtual void getCameraTransform (F32 *pos, MatrixF *mat)
 Gets the camera transform.
S32 getNodeIndex (U32 imageSlot, StringTableEntry nodeName)
 Gets the index of a node inside a mounted image given the name.

Object Transforms

virtual void getEyeTransform (MatrixF *mat)
 Returns the eye transform of this shape, IE the eyes of a player.
virtual void getRetractionTransform (U32 imageSlot, MatrixF *mat)
 The retraction transform is the muzzle transform in world space.
virtual void getMountTransform (U32 mountPoint, MatrixF *mat)
 Mount point to world space transform.
virtual void getMuzzleTransform (U32 imageSlot, MatrixF *mat)
 Muzzle transform of mounted object in world space.
virtual void getImageTransform (U32 imageSlot, MatrixF *mat)
 Gets the transform of a mounted image in world space.
virtual void getImageTransform (U32 imageSlot, S32 node, MatrixF *mat)
 Gets the transform of a node on a mounted image in world space.
virtual void 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.


virtual void getRenderRetractionTransform (U32 index, MatrixF *mat)
virtual void getRenderMountTransform (U32 index, MatrixF *mat)
virtual void getRenderMuzzleTransform (U32 index, MatrixF *mat)
virtual void getRenderImageTransform (U32 imageSlot, MatrixF *mat)
virtual void getRenderImageTransform (U32 index, S32 node, MatrixF *mat)
virtual void getRenderImageTransform (U32 index, StringTableEntry nodeName, MatrixF *mat)
virtual void getRenderMuzzleVector (U32 imageSlot, VectorF *vec)
virtual void getRenderMuzzlePoint (U32 imageSlot, Point3F *pos)
virtual void getRenderEyeTransform (MatrixF *mat)

Screen Flashing

virtual F32 getDamageFlash () const
 Returns the level of screenflash that should be used.
virtual void setDamageFlash (const F32 amt)
 Sets the flash level.
virtual F32 getWhiteOut () const
 White out is the flash-grenade blindness effect This returns the level of flash to create.
virtual void setWhiteOut (const F32)
 Set the level of flash blindness.

Invincibility effect

This is the screen effect when invincible in the HUD

See also:
GameRenderFilters()


virtual F32 getInvincibleEffect () const
 Returns the level of invincibility effect.
virtual void setupInvincibleEffect (F32 time, F32 speed)
 Initializes invincibility effect and interpolation parameters.
virtual void updateInvincibleEffect (F32 dt)
 Advance invincibility effect animation.

Movement & velocity

virtual void setVelocity (const VectorF &vel)
 Sets the velocity of this object.
virtual void applyImpulse (const Point3F &pos, const VectorF &vec)
 Applies an impulse force to this object.

Cameras and Control

ShapeBasegetControllingObject ()
 Returns the object controling this object.
virtual void setControllingObject (ShapeBase *obj)
 Sets the controling object.
virtual ShapeBasegetControlObject ()
 Returns the object this is controling.
virtual void setControlObject (ShapeBase *obj)
 sets the object this is controling
bool isControlled ()
 Returns true if this object is controled by something.
bool isFirstPerson ()
 Returns true if this object is being used as a camera in first person.
bool useObjsEyePoint () const
 Returns true if the camera uses this objects eye point (defined by modeler).
bool onlyFirstPerson () const
 Returns true if this object can only be used as a first person camera.
virtual F32 getCameraFov ()
 Returns the Field of Vision for this object if used as a camera.
virtual F32 getDefaultCameraFov ()
 Returns the default FOV if this object is used as a camera.
virtual void setCameraFov (F32 fov)
 Sets the FOV for this object if used as a camera.
virtual bool isValidCameraFov (F32 fov)
 Returns true if the FOV supplied is within allowable parameters.

Rendering

TSShape const * getShape ()
 Returns the renderable shape of this object.
bool prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState)
 Called when the SceneGraph is ready for the registration of RenderImages.
void renderObject (SceneState *state, SceneRenderImage *image)
 Called when the object is supposed to render itself.
virtual void renderMountedImage (SceneState *state, ShapeImageRenderImage *image)
 Renders a mounted object.
virtual void renderImage (SceneState *state, SceneRenderImage *image)
virtual void renderShadow (F32 dist, F32 fogAmount)
 Renders the shadow for this object.
virtual void calcClassRenderData ()
 Preprender logic.
static void wireCube (const Point3F &size, const Point3F &pos)
 Draws a wire cube at any point in space with specified parameters.

Collision

bool castRay (const Point3F &start, const Point3F &end, RayInfo *info)
 Casts a ray from start to end, stores gathered information in 'info' returns true if successful.
bool buildPolyList (AbstractPolyList *polyList, const Box3F &box, const SphereF &sphere)
 Builds a polylist of the polygons in this object returns true if successful.
void buildConvex (const Box3F &box, Convex *convex)
 Builds a convex hull for this object.

Rendering

bool didRenderLastRender ()
 Returns true if the last frame calculated rendered.
virtual void setHidden (bool hidden)
 Sets the state of this object as hidden or not.
bool isHidden ()
 Returns true if this object is hidden.
bool isInvincible ()
 Returns true if this object can be damaged.
void startFade (F32 fadeTime, F32 fadeDelay=0.0, bool fadeOut=true)
 Start fade of object in/out.
void registerLights (LightManager *lightManager, bool lightingScene)
 Traverses mounted objects and registers light sources with the light manager.
static void incRenderFrame ()
 Increments the last rendered frame number.

Network

F32 getUpdatePriority (CameraScopeQuery *focusObject, U32 updateMask, S32 updateSkips)
 This returns a value which is used to prioritize which objects need to be updated.
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *conn, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.
void writePacketData (GameConnection *conn, BitStream *stream)
 Write state information necessary to perform client side prediction of an object.
void readPacketData (GameConnection *conn, BitStream *stream)
 Read data written with writePacketData() and update the object state.
virtual U32 getPacketDataChecksum (GameConnection *conn)
 Gets the checksum for packet data.

Image Manipulation

void scriptCallback (U32 imageSlot, const char *function)
 Utility function to call script functions which have to do with ShapeBase objects.
virtual void setImage (U32 imageSlot, ShapeBaseImageData *imageData, StringHandle &skinNameHandle, bool loaded=true, bool ammo=false, bool triggerDown=false, bool target=false)
 Assign a ShapeBaseImage to an image slot.
void resetImageSlot (U32 imageSlot)
 Clear out an image slot.
U32 getImageFireState (U32 imageSlot)
 Get the firing action state of the image.
void setImageState (U32 imageSlot, U32 state, bool force=false)
 Sets the state of the image.
void updateImageAnimation (U32 imageSlot, F32 dt)
 Advance animation on a image.
void updateImageState (U32 imageSlot, F32 dt)
 Advance state of image.
void startImageEmitter (MountedImage &image, ShapeBaseImageData::StateData &state)
 Start up the particle emitter for the this shapebase.
LightgetImageLight (U32 imageSlot)
 Get light information for a mounted image.

Events

virtual void onDeleteNotify (SimObject *)
 Called when a SimObject is deleted.
virtual void onImageRecoil (U32 imageSlot, ShapeBaseImageData::StateData::RecoilState)
virtual void ejectShellCasing (U32 imageSlot)
virtual void updateDamageLevel ()
virtual void updateDamageState ()
virtual void blowUp ()
virtual void onMount (ShapeBase *obj, S32 node)
virtual void onUnmount (ShapeBase *obj, S32 node)
virtual void onImpact (SceneObject *obj, VectorF vec)
virtual void onImpact (VectorF vec)

Public Types

enum  PublicConstants {
  ThreadSequenceBits = 6,
  MaxSequenceIndex = (1 << ThreadSequenceBits) - 1,
  EnergyLevelBits = 5,
  DamageLevelBits = 6,
  DamageStateBits = 2,
  MaxSoundThreads = 4,
  MaxScriptThreads = 4,
  MaxMountedImages = 4,
  MaxImageEmitters = 3,
  NumImageBits = 3,
  ShieldNormalBits = 8,
  CollisionTimeoutValue = 250
}
enum  DamageState {
  Enabled,
  Disabled,
  Destroyed,
  NumDamageStates,
  NumDamageStateBits = 2
}
 This enum indexes into the sDamageStateName array. More...

Public Member Functions

 ShapeBase ()
 ~ShapeBase ()
TSShapeInstancegetShapeInstance ()
void processTick (const Move *move)
 Processes a move event and updates object state once every 32 milliseconds.
void advanceTime (F32 dt)
 Advances simulation time for animations.
void onCameraScopeQuery (NetConnection *cr, CameraScopeQuery *camInfo)
 Control object scoping.
bool pointInWater (Point3F &point)
 Returns true if the point specified is in the water.
F32 getWaterCoverage ()
 Returns the percentage of this object covered by water.
F32 getLiquidHeight ()
 Returns the height of the liquid on this object.
 DECLARE_CONOBJECT (ShapeBase)

Static Public Attributes

static bool gRenderEnvMaps
 Global flag which turns on or off all environment maps.
static F32 sWhiteoutDec
static F32 sDamageFlashDec

Protected Member Functions

void updateMass ()
 This recalculates the total mass of the object, and all mounted objects.
void updateServerAudio ()
 Prune out non looping sounds from the sound manager which have expired.
void updateAudioState (Sound &st)
 Updates the audio state of the supplied sound.
void updateAudioPos ()
 Recalculates the spacial sound based on the current position of the object emitting the sound.
void updateContainer ()
 Update bouyency and drag properties.

Protected Attributes

sgObjectShadows shadows
F32 mDamageFlash
F32 mWhiteOut
bool mFlipFadeVal
U32 mLightTime
Point3F mShieldNormal
 Last shield direction (cur. unused).
ShapeBase::MountInfo mMount
 Mounted objects.
U32 mLastRenderFrame
F32 mLastRenderDistance
U32 mSkinHash

Static Protected Attributes

static U32 sLastRenderFrame

Private Types

typedef GameBase Parent

Private Attributes

ShapeBaseDatamDataBlock
 Datablock.
ShapeBasemControllingObject
 Controlling object.
bool mTrigger [MaxTriggerKeys]
 What triggers are set, if any.

Friends

class ShapeBaseConvex
class ShapeBaseImageData
void physicalZoneFind (SceneObject *, void *)

Data Structures

struct  CollisionTimeout
struct  MountedImage
 An image mounted on a shapebase. More...
struct  MountInfo
 Mounted objects. More...
struct  Sound
struct  Thread


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
ThreadSequenceBits 
MaxSequenceIndex 
EnergyLevelBits 
DamageLevelBits 
DamageStateBits 
MaxSoundThreads  Should be a power of 2.
MaxScriptThreads  Should be a power of 2.
MaxMountedImages  Should be a power of 2.
MaxImageEmitters 
NumImageBits 
ShieldNormalBits 
CollisionTimeoutValue  Timeout in ms.

This enum indexes into the sDamageStateName array.

Enumerator:
Enabled 
Disabled 
Destroyed 
NumDamageStates 
NumDamageStateBits  Should be log2 of the number of states.

Enumerator:
NameMask 
DamageMask 
NoWarpMask 
MountedMask 
CloakMask 
ShieldMask 
InvincibleMask 
SkinMask 
SoundMaskN  Extends + MaxSoundThreads bits.
ThreadMaskN  Extends + MaxScriptThreads bits.
ImageMaskN  Extends + MaxMountedImage bits.
NextFreeMask 

Enumerator:
SoundMask 
ThreadMask 
ImageMask 


Constructor & Destructor Documentation

ShapeBase::ShapeBase (  ) 

ShapeBase::~ShapeBase (  ) 


Member Function Documentation

void ShapeBase::notifyCollision (  ) 

Go through all the items in the collision queue and call onCollision on them all.

See also:
onCollision

virtual void ShapeBase::onCollision ( ShapeBase object,
VectorF  vec 
) [virtual]

This gets called when an object collides with this object.

Parameters:
object Object colliding with this object
vec Vector along which collision occured

void ShapeBase::queueCollision ( ShapeBase object,
const VectorF vec 
)

Add a collision to the queue of collisions waiting to be handled.

See also:
onCollision
Parameters:
object Object collision occurs with
vec Vector along which collision occurs

void ShapeBase::updateMass (  )  [protected]

This recalculates the total mass of the object, and all mounted objects.

void ShapeBase::scriptCallback ( U32  imageSlot,
const char *  function 
) [protected]

Utility function to call script functions which have to do with ShapeBase objects.

Parameters:
imageSlot Image Slot id
function Function

virtual void ShapeBase::setImage ( U32  imageSlot,
ShapeBaseImageData imageData,
StringHandle skinNameHandle,
bool  loaded = true,
bool  ammo = false,
bool  triggerDown = false,
bool  target = false 
) [protected, virtual]

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?
target Does the image have a target?

void ShapeBase::resetImageSlot ( U32  imageSlot  )  [protected]

Clear out an image slot.

Parameters:
imageSlot Image slot id

U32 ShapeBase::getImageFireState ( U32  imageSlot  )  [protected]

Get the firing action state of the image.

Parameters:
imageSlot Image slot id

void ShapeBase::setImageState ( U32  imageSlot,
U32  state,
bool  force = false 
) [protected]

Sets the state of the image.

Parameters:
imageSlot Image slot id
state State id
force Force image to state or let it finish then change

void ShapeBase::updateImageAnimation ( U32  imageSlot,
F32  dt 
) [protected]

Advance animation on a image.

Parameters:
imageSlot Image slot id
dt Change in time since last animation update

void ShapeBase::updateImageState ( U32  imageSlot,
F32  dt 
) [protected]

Advance state of image.

Parameters:
imageSlot Image slot id
dt Change in time since last state update

void ShapeBase::startImageEmitter ( MountedImage image,
ShapeBaseImageData::StateData state 
) [protected]

Start up the particle emitter for the this shapebase.

Parameters:
image Mounted image
state State of shape base image

Light* ShapeBase::getImageLight ( U32  imageSlot  )  [protected]

Get light information for a mounted image.

Parameters:
imageSlot Image slot id

void ShapeBase::updateServerAudio (  )  [protected]

Prune out non looping sounds from the sound manager which have expired.

void ShapeBase::updateAudioState ( Sound st  )  [protected]

Updates the audio state of the supplied sound.

Parameters:
st Sound

void ShapeBase::updateAudioPos (  )  [protected]

Recalculates the spacial sound based on the current position of the object emitting the sound.

void ShapeBase::updateContainer (  )  [protected]

Update bouyency and drag properties.

virtual void ShapeBase::onDeleteNotify ( SimObject object  )  [protected, virtual]

Called when a SimObject is deleted.

When you are on the notification list for another object and it is deleted, this method is called.

Reimplemented from SimObject.

Reimplemented in Camera, and Item.

virtual void ShapeBase::onImageRecoil ( U32  imageSlot,
ShapeBaseImageData::StateData::RecoilState   
) [protected, virtual]

Reimplemented in Player.

virtual void ShapeBase::ejectShellCasing ( U32  imageSlot  )  [protected, virtual]

virtual void ShapeBase::updateDamageLevel (  )  [protected, virtual]

Reimplemented in Player.

virtual void ShapeBase::updateDamageState (  )  [protected, virtual]

Reimplemented in Player.

virtual void ShapeBase::blowUp (  )  [protected, virtual]

virtual void ShapeBase::onMount ( ShapeBase obj,
S32  node 
) [protected, virtual]

virtual void ShapeBase::onUnmount ( ShapeBase obj,
S32  node 
) [protected, virtual]

Reimplemented in Player, and StaticShape.

virtual void ShapeBase::onImpact ( SceneObject obj,
VectorF  vec 
) [protected, virtual]

virtual void ShapeBase::onImpact ( VectorF  vec  )  [protected, virtual]

TSShapeInstance* ShapeBase::getShapeInstance (  )  [inline]

bool ShapeBase::onAdd (  )  [virtual]

Called when the object is added to the sim.

Reimplemented from GameBase.

Reimplemented in Camera, Item, MissionMarker, SpawnSphere, PathCamera, Player, RigidShape, StaticShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::onRemove (  )  [virtual]

Called when the object is removed from the sim.

Reimplemented from GameBase.

Reimplemented in Camera, Item, MissionMarker, PathCamera, Player, RigidShape, StaticShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::onSceneRemove (  )  [virtual]

Called when this is removed from the SceneGraph.

Reimplemented from SceneObject.

static void ShapeBase::consoleInit (  )  [static]

Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.

Deprecated:
You should use ConsoleMethod and ConsoleFunction, not this, to register methods or commands.
See also:
console

Reimplemented from GameBase.

Reimplemented in Camera, Item, PathCamera, and Player.

bool ShapeBase::onNewDataBlock ( GameBaseData dptr  )  [virtual]

Called when a new datablock is set.

This allows subclasses to appropriately handle new datablocks.

See also:
setDataBlock()
Parameters:
dptr New datablock

Reimplemented from GameBase.

Reimplemented in Item, MissionMarker, PathCamera, Player, RigidShape, StaticShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::setShapeName ( const char *   ) 

const char * ShapeBase::getShapeName (  )  [inline]

void ShapeBase::setSkinName ( const char *   ) 

const char * ShapeBase::getSkinName (  )  [inline]

void ShapeBase::setDamageLevel ( F32  damage  ) 

Sets the ammount of damage on this object.

void ShapeBase::setDamageState ( DamageState  state  ) 

Changes the object's damage state.

Parameters:
state New state of the object

bool ShapeBase::setDamageState ( const char *  state  ) 

Changes the object's damage state, based on a named state.

See also:
setDamageState
Parameters:
state New state of the object as a string.

const char* ShapeBase::getDamageStateName (  ) 

Returns the name of the current damage state as a string.

DamageState ShapeBase::getDamageState (  )  [inline]

Returns the current damage state.

bool ShapeBase::isDestroyed (  )  [inline]

Returns true if the object is destroyed.

void ShapeBase::setRepairRate ( F32  rate  )  [inline]

Sets the rate at which the object regenerates damage.

Parameters:
rate Repair rate in units/second.

F32 ShapeBase::getDamageLevel (  )  [inline]

Returns damage amount.

F32 ShapeBase::getDamageValue (  ) 

Returns the damage percentage.

Returns:
Damage factor, between 0.0 - 1.0

F32 ShapeBase::getRepairRate (  )  [inline]

Returns the rate at which the object regenerates damage.

void ShapeBase::applyDamage ( F32  amount  ) 

Adds damage to an object.

Parameters:
amount Amount of of damage to add

void ShapeBase::applyRepair ( F32  amount  ) 

Removes damage to an object.

Parameters:
amount Amount to repair object by

void ShapeBase::setDamageDir ( const VectorF vec  )  [inline]

Sets the direction from which the damage is coming.

Parameters:
vec Vector indicating the direction of the damage

virtual void ShapeBase::setEnergyLevel ( F32  energy  )  [virtual]

Sets the level of energy for this object.

Parameters:
energy Level of energy to assign to this object

Reimplemented in RigidShape, and Vehicle.

void ShapeBase::setRechargeRate ( F32  rate  )  [inline]

Sets the rate at which the energy replentishes itself.

Parameters:
rate Rate at which energy restores

F32 ShapeBase::getEnergyLevel (  ) 

Returns the amount of energy in the object.

F32 ShapeBase::getEnergyValue (  ) 

Returns the percentage of energy, 0.0 - 1.0.

F32 ShapeBase::getRechargeRate (  )  [inline]

Returns the recharge rate.

void ShapeBase::playAudio ( U32  slot,
AudioProfile profile 
)

Plays an audio sound from a mounted object.

Parameters:
slot Mount slot ID
profile Audio profile to play

void ShapeBase::stopAudio ( U32  slot  ) 

Stops audio from a mounted object.

Parameters:
slot Mount slot ID

bool ShapeBase::setThreadSequence ( U32  slot,
S32  seq,
bool  reset = true 
)

Sets the animation thread for a mounted object.

Parameters:
slot Mount slot ID
seq Sequance id
reset Reset the sequence

void ShapeBase::updateThread ( Thread st  ) 

Update the animation thread.

Parameters:
st Thread to update

bool ShapeBase::stopThread ( U32  slot  ) 

Stop the current thread from playing on a mounted object.

Parameters:
slot Mount slot ID

bool ShapeBase::pauseThread ( U32  slot  ) 

Pause the running animation thread.

Parameters:
slot Mount slot ID

bool ShapeBase::playThread ( U32  slot  ) 

Start playing the running animation thread again.

Parameters:
slot Mount slot ID

bool ShapeBase::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

void ShapeBase::startSequenceSound ( Thread thread  ) 

Start the sound associated with an animation thread.

Parameters:
thread Thread

void ShapeBase::stopThreadSound ( Thread thread  ) 

Stop the sound associated with an animation thread.

Parameters:
thread Thread

void ShapeBase::advanceThreads ( F32  dt  ) 

Advance all animation threads attached to this shapebase.

Parameters:
dt Change in time from last call to this function

void ShapeBase::forceUncloak ( const char *  reason  ) 

Force uncloaking of object.

Parameters:
reason Reason this is being forced to uncloak, this is passed directly to script control

void ShapeBase::setCloakedState ( bool  cloaked  ) 

Set cloaked state of object.

Parameters:
cloaked True if object is cloaked

bool ShapeBase::getCloakedState (  )  [inline]

Returns true if object is cloaked.

F32 ShapeBase::getCloakLevel (  )  [inline]

Returns level of cloaking, as it's not an instant "now you see it, now you don't".

virtual void ShapeBase::mountObject ( ShapeBase obj,
U32  node 
) [virtual]

Mount an object to a mount point.

Parameters:
obj Object to mount
node Mount node ID

Reimplemented in Vehicle.

void ShapeBase::unmountObject ( ShapeBase obj  ) 

Remove an object mounting.

Parameters:
obj Object to unmount

void ShapeBase::unmount (  ) 

Unmount this object from it's mount.

ShapeBase* ShapeBase::getObjectMount (  )  [inline]

Return the object that this object is mounted to.

ShapeBase* ShapeBase::getMountLink (  )  [inline]

Return object link of next object mounted to this object's mount.

ShapeBase* ShapeBase::getMountList (  )  [inline]

Returns the list of things mounted along with this object.

U32 ShapeBase::getMountNode (  )  [inline]

Returns the mount id that this is mounted to.

bool ShapeBase::isMounted (  )  [inline]

Returns true if this object is mounted to anything at all.

S32 ShapeBase::getMountedObjectCount (  ) 

Returns the number of object mounted along with this.

ShapeBase* ShapeBase::getMountedObject ( S32  idx  ) 

Returns the object mounted at a position in the mount list.

Parameters:
idx Position on the mount list

S32 ShapeBase::getMountedObjectNode ( S32  idx  ) 

Returns the node the object at idx is mounted to.

Parameters:
idx Index

ShapeBase* ShapeBase::getMountNodeObject ( S32  node  ) 

Returns the object a object on the mount list is mounted to.

Parameters:
node 

Point3F ShapeBase::getAIRepairPoint (  ) 

Returns where the AI should be to repair this object.

Note:
Legacy code from Tribes 2, but still works

virtual bool ShapeBase::mountImage ( ShapeBaseImageData image,
U32  imageSlot,
bool  loaded,
StringHandle skinNameHandle 
) [virtual]

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

virtual bool ShapeBase::unmountImage ( U32  imageSlot  )  [virtual]

Unmount an image from a slot.

Parameters:
imageSlot Mount point

ShapeBaseImageData* ShapeBase::getMountedImage ( U32  imageSlot  ) 

Gets the information on the image mounted in a slot.

Parameters:
imageSlot Mount point

MountedImage* ShapeBase::getImageStruct ( U32  imageSlot  ) 

Gets the mounted image on on a slot.

Parameters:
imageSlot Mount Point

TSShapeInstance* ShapeBase::getImageShapeInstance ( U32  imageSlot  )  [inline]

ShapeBaseImageData* ShapeBase::getPendingImage ( U32  imageSlot  ) 

Gets the next image which will be put in an image slot.

See also:
setImageState
Parameters:
imageSlot mount Point

bool ShapeBase::isImageFiring ( U32  imageSlot  ) 

Returns true if the mounted image is firing.

Parameters:
imageSlot Mountpoint

bool ShapeBase::isImageReady ( U32  imageSlot,
U32  ns = (U32)-1,
U32  depth = 0 
)

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

bool ShapeBase::isImageMounted ( ShapeBaseImageData image  ) 

Returns true if the specified image is mounted.

Parameters:
image ShapeBase image

S32 ShapeBase::getMountSlot ( ShapeBaseImageData image  ) 

Returns the slot which the image specified is mounted on.

Parameters:
image Image to test for

StringHandle ShapeBase::getImageSkinTag ( U32  imageSlot  ) 

Returns the skin for the image in a slot.

Parameters:
imageSlot Image slot to get the skin from

const char* ShapeBase::getImageState ( U32  imageSlot  ) 

Returns the image state as a string.

Parameters:
imageSlot Image slot to check state

void ShapeBase::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

bool ShapeBase::getImageTriggerState ( U32  imageSlot  ) 

Returns the trigger state of the image.

Parameters:
imageSlot Image slot

void ShapeBase::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

bool ShapeBase::getImageAmmoState ( U32  imageSlot  ) 

Returns true if the image uses ammo, not energy.

Parameters:
imageSlot Image slot

void ShapeBase::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

bool ShapeBase::getImageWetState ( U32  imageSlot  ) 

Returns true if image is wet.

Parameters:
imageSlot image slot

void ShapeBase::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

bool ShapeBase::getImageLoadedState ( U32  imageSlot  ) 

Returns true if object is loaded with ammo.

Parameters:
imageSlot Image slot

bool ShapeBase::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)

virtual void ShapeBase::getMuzzleVector ( U32  imageSlot,
VectorF vec 
) [virtual]

Gets the muzzle vector of a specified slot.

Parameters:
imageSlot Image slot to check transform for
vec Muzzle vector (out)

void ShapeBase::getMuzzlePoint ( U32  imageSlot,
Point3F pos 
)

Gets the point of the muzzle of the image.

Parameters:
imageSlot Image slot
pos Muzzle point (out)

virtual void ShapeBase::getCameraParameters ( F32 min,
F32 max,
Point3F offset,
MatrixF rot 
) [virtual]

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 in Player, RigidShape, and Vehicle.

virtual void ShapeBase::getCameraTransform ( F32 pos,
MatrixF mat 
) [virtual]

Gets the camera transform.

Todo:
Find out what pos does
Parameters:
pos TODO: Find out what this does
mat Camera transform (out)

Reimplemented in Camera, PathCamera, RigidShape, and Vehicle.

S32 ShapeBase::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

virtual void ShapeBase::getEyeTransform ( MatrixF mat  )  [virtual]

Returns the eye transform of this shape, IE the eyes of a player.

Parameters:
mat Eye transform (out)

Reimplemented in Player.

virtual void ShapeBase::getRetractionTransform ( U32  imageSlot,
MatrixF mat 
) [virtual]

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)

virtual void ShapeBase::getMountTransform ( U32  mountPoint,
MatrixF mat 
) [virtual]

Mount point to world space transform.

Parameters:
mountPoint Mount point
mat mount point transform (out)

virtual void ShapeBase::getMuzzleTransform ( U32  imageSlot,
MatrixF mat 
) [virtual]

Muzzle transform of mounted object in world space.

Parameters:
imageSlot Image slot
mat Muzzle transform (out)

Reimplemented in Player.

virtual void ShapeBase::getImageTransform ( U32  imageSlot,
MatrixF mat 
) [virtual]

Gets the transform of a mounted image in world space.

Parameters:
imageSlot Image slot
mat Transform (out)

virtual void ShapeBase::getImageTransform ( U32  imageSlot,
S32  node,
MatrixF mat 
) [virtual]

Gets the transform of a node on a mounted image in world space.

Parameters:
imageSlot Image Slot
node node on image
mat Transform (out)

virtual void ShapeBase::getImageTransform ( U32  imageSlot,
StringTableEntry  nodeName,
MatrixF mat 
) [virtual]

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)

virtual void ShapeBase::getRenderRetractionTransform ( U32  index,
MatrixF mat 
) [virtual]

virtual void ShapeBase::getRenderMountTransform ( U32  index,
MatrixF mat 
) [virtual]

virtual void ShapeBase::getRenderMuzzleTransform ( U32  index,
MatrixF mat 
) [virtual]

Reimplemented in Player.

virtual void ShapeBase::getRenderImageTransform ( U32  imageSlot,
MatrixF mat 
) [virtual]

virtual void ShapeBase::getRenderImageTransform ( U32  index,
S32  node,
MatrixF mat 
) [virtual]

virtual void ShapeBase::getRenderImageTransform ( U32  index,
StringTableEntry  nodeName,
MatrixF mat 
) [virtual]

virtual void ShapeBase::getRenderMuzzleVector ( U32  imageSlot,
VectorF vec 
) [virtual]

virtual void ShapeBase::getRenderMuzzlePoint ( U32  imageSlot,
Point3F pos 
) [virtual]

virtual void ShapeBase::getRenderEyeTransform ( MatrixF mat  )  [virtual]

Reimplemented in Player.

virtual F32 ShapeBase::getDamageFlash (  )  const [virtual]

Returns the level of screenflash that should be used.

Reimplemented in Camera.

virtual void ShapeBase::setDamageFlash ( const F32  amt  )  [virtual]

Sets the flash level.

Parameters:
amt Level of flash

virtual F32 ShapeBase::getWhiteOut (  )  const [virtual]

White out is the flash-grenade blindness effect This returns the level of flash to create.

Reimplemented in Camera.

virtual void ShapeBase::setWhiteOut ( const   F32  )  [virtual]

Set the level of flash blindness.

virtual F32 ShapeBase::getInvincibleEffect (  )  const [virtual]

Returns the level of invincibility effect.

virtual void ShapeBase::setupInvincibleEffect ( F32  time,
F32  speed 
) [virtual]

Initializes invincibility effect and interpolation parameters.

Parameters:
time Time it takes to become invincible
speed Speed at which invincibility effects progress

virtual void ShapeBase::updateInvincibleEffect ( F32  dt  )  [virtual]

Advance invincibility effect animation.

Parameters:
dt Time since last call of this function

virtual void ShapeBase::setVelocity ( const VectorF vel  )  [virtual]

Sets the velocity of this object.

Parameters:
vel Velocity vector

Reimplemented from SceneObject.

Reimplemented in Item, and Player.

virtual void ShapeBase::applyImpulse ( const Point3F pos,
const VectorF vec 
) [virtual]

Applies an impulse force to this object.

Parameters:
pos Position where impulse came from in world space
vec Velocity vector (Impulse force F = m * v)

Reimplemented in Item, Player, RigidShape, and Vehicle.

ShapeBase* ShapeBase::getControllingObject (  )  [inline]

Returns the object controling this object.

Parameters:
client New controling client

virtual void ShapeBase::setControllingObject ( ShapeBase obj  )  [virtual]

Sets the controling object.

Parameters:
obj New controling object

virtual ShapeBase* ShapeBase::getControlObject (  )  [virtual]

Returns the object this is controling.

Reimplemented in Player.

virtual void ShapeBase::setControlObject ( ShapeBase obj  )  [virtual]

sets the object this is controling

Parameters:
obj New controlled object

Reimplemented in Player.

bool ShapeBase::isControlled (  )  [inline]

Returns true if this object is controled by something.

bool ShapeBase::isFirstPerson (  ) 

Returns true if this object is being used as a camera in first person.

bool ShapeBase::useObjsEyePoint (  )  const

Returns true if the camera uses this objects eye point (defined by modeler).

bool ShapeBase::onlyFirstPerson (  )  const

Returns true if this object can only be used as a first person camera.

virtual F32 ShapeBase::getCameraFov (  )  [virtual]

Returns the Field of Vision for this object if used as a camera.

Reimplemented in Camera.

virtual F32 ShapeBase::getDefaultCameraFov (  )  [virtual]

Returns the default FOV if this object is used as a camera.

Reimplemented in Camera.

virtual void ShapeBase::setCameraFov ( F32  fov  )  [virtual]

Sets the FOV for this object if used as a camera.

Reimplemented in Camera.

virtual bool ShapeBase::isValidCameraFov ( F32  fov  )  [virtual]

Returns true if the FOV supplied is within allowable parameters.

Parameters:
fov FOV to test

Reimplemented in Camera.

void ShapeBase::processTick ( const Move move  )  [virtual]

Processes a move event and updates object state once every 32 milliseconds.

This takes place both on the client and server, every 32 milliseconds (1 tick).

See also:
ProcessList
Parameters:
move Move event corresponding to this tick, or NULL.

Reimplemented from GameBase.

Reimplemented in Camera, Item, PathCamera, Player, RigidShape, StaticShape, Vehicle, and WheeledVehicle.

void ShapeBase::advanceTime ( F32  dt  )  [virtual]

Advances simulation time for animations.

This is called every frame.

Parameters:
dt Time since last advance call

Reimplemented from GameBase.

Reimplemented in Player, RigidShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

TSShape const* ShapeBase::getShape (  ) 

Returns the renderable shape of this object.

bool ShapeBase::prepRenderImage ( SceneState state,
const U32  stateKey,
const U32  startZone,
const bool  modifyBaseZoneState 
) [virtual]

Called when the SceneGraph is ready for the registration of RenderImages.

See also:
SceneState
Parameters:
state SceneState
stateKey State key of the current SceneState
startZone Base zone index
modifyBaseZoneState If true, the object needs to modify the zone state.

Reimplemented from SceneObject.

Reimplemented in Item, and WheeledVehicle.

void ShapeBase::renderObject ( SceneState state,
SceneRenderImage image 
) [virtual]

Called when the object is supposed to render itself.

Parameters:
state Current rendering state.
See also:
SceneState
Parameters:
image Image associated with this object to render.
See also:
SceneRenderImage

Reimplemented from SceneObject.

virtual void ShapeBase::renderMountedImage ( SceneState state,
ShapeImageRenderImage image 
) [virtual]

Renders a mounted object.

Parameters:
state State of scene
image ShapeImage to render

Reimplemented in Player, and Vehicle.

virtual void ShapeBase::renderImage ( SceneState state,
SceneRenderImage image 
) [virtual]

virtual void ShapeBase::renderShadow ( F32  dist,
F32  fogAmount 
) [virtual]

Renders the shadow for this object.

Parameters:
dist Distance away from object shadow is rendering on
fogAmount Amount of fog present

Reimplemented in StaticShape.

static void ShapeBase::wireCube ( const Point3F size,
const Point3F pos 
) [static]

Draws a wire cube at any point in space with specified parameters.

Parameters:
size Length, width, depth
pos xyz position in world space

virtual void ShapeBase::calcClassRenderData (  )  [virtual]

Preprender logic.

Reimplemented in Player.

void ShapeBase::onCameraScopeQuery ( NetConnection cr,
CameraScopeQuery camInfo 
) [virtual]

Control object scoping.

Reimplemented from NetObject.

Reimplemented in Player.

bool ShapeBase::castRay ( const Point3F start,
const Point3F end,
RayInfo info 
) [virtual]

Casts a ray from start to end, stores gathered information in 'info' returns true if successful.

Parameters:
start Start point for ray
end End point for ray
info Information from raycast (out)

Reimplemented from SceneObject.

Reimplemented in Player.

bool ShapeBase::buildPolyList ( AbstractPolyList polyList,
const Box3F box,
const SphereF sphere 
) [virtual]

Builds a polylist of the polygons in this object returns true if successful.

Parameters:
polyList Returned polylist (out)
box Not used
sphere Not used

Reimplemented from SceneObject.

Reimplemented in Item, Player, and WheeledVehicle.

void ShapeBase::buildConvex ( const Box3F box,
Convex convex 
) [virtual]

Builds a convex hull for this object.

See also:
Convex
Parameters:
box Bounding box
convex New convex hull (out)

Reimplemented from SceneObject.

Reimplemented in Item, and Player.

static void ShapeBase::incRenderFrame (  )  [inline, static]

Increments the last rendered frame number.

bool ShapeBase::didRenderLastRender (  )  [inline]

Returns true if the last frame calculated rendered.

virtual void ShapeBase::setHidden ( bool  hidden  )  [virtual]

Sets the state of this object as hidden or not.

If an object is hidden it is removed entirely from collisions, it is not ghosted and is essentially "non existant" as far as simulation is concerned.

Parameters:
hidden True if object is to be hidden

Reimplemented from SimObject.

bool ShapeBase::isHidden (  )  [inline]

Returns true if this object is hidden.

See also:
setHidden

Reimplemented from SimObject.

bool ShapeBase::isInvincible (  ) 

Returns true if this object can be damaged.

void ShapeBase::startFade ( F32  fadeTime,
F32  fadeDelay = 0.0,
bool  fadeOut = true 
)

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.

void ShapeBase::registerLights ( LightManager lightManager,
bool  lightingScene 
) [virtual]

Traverses mounted objects and registers light sources with the light manager.

Parameters:
lightManager Light manager to register with
lightingScene Set to true if the scene is being lit, in which case these lights will not be used

Reimplemented from SimObject.

Reimplemented in Item.

bool ShapeBase::pointInWater ( Point3F point  ) 

Returns true if the point specified is in the water.

Parameters:
point Point to test in world space

Reimplemented in Player.

F32 ShapeBase::getWaterCoverage (  )  [inline]

Returns the percentage of this object covered by water.

F32 ShapeBase::getLiquidHeight (  )  [inline]

Returns the height of the liquid on this object.

F32 ShapeBase::getUpdatePriority ( CameraScopeQuery focusObject,
U32  updateMask,
S32  updateSkips 
) [virtual]

This returns a value which is used to prioritize which objects need to be updated.

In NetObject, our returned priority is 0.1 * updateSkips, so that less recently updated objects are more likely to be updated.

In subclasses, this can be adjusted. For instance, ShapeBase provides priority based on proximity to the camera.

Parameters:
focusObject Information from a previous call to onCameraScopeQuery.
updateMask Current update mask.
updateSkips Number of ticks we haven't been updated for.
Returns:
A floating point value indicating priority. These are typically < 5.0.

Reimplemented from GameBase.

U32 ShapeBase::packUpdate ( NetConnection conn,
U32  mask,
BitStream stream 
) [virtual]

Instructs this object to pack its state for transfer over the network.

Parameters:
conn Net connection being used
mask Mask indicating fields to transmit.
stream Bitstream to pack data to
Returns:
Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.

Reimplemented from GameBase.

Reimplemented in Camera, Item, MissionMarker, SpawnSphere, PathCamera, Player, RigidShape, StaticShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::unpackUpdate ( NetConnection conn,
BitStream stream 
) [virtual]

Instructs this object to read state data previously packed with packUpdate.

Parameters:
conn Net connection being used
stream stream to read from

Reimplemented from GameBase.

Reimplemented in Camera, Item, MissionMarker, SpawnSphere, PathCamera, Player, RigidShape, StaticShape, FlyingVehicle, HoverVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::writePacketData ( GameConnection conn,
BitStream stream 
) [virtual]

Write state information necessary to perform client side prediction of an object.

This information is sent only to the controling object. For example, if you are a client controlling a Player, the server uses writePacketData() instead of packUpdate() to generate the data you receive.

Parameters:
conn Connection for which we're generating this data.
stream Bitstream for output.

Reimplemented from GameBase.

Reimplemented in Camera, Player, RigidShape, FlyingVehicle, Vehicle, and WheeledVehicle.

void ShapeBase::readPacketData ( GameConnection conn,
BitStream stream 
) [virtual]

Read data written with writePacketData() and update the object state.

Parameters:
conn Connection for which we're generating this data.
stream Bitstream to read.

Reimplemented from GameBase.

Reimplemented in Camera, Player, RigidShape, FlyingVehicle, Vehicle, and WheeledVehicle.

virtual U32 ShapeBase::getPacketDataChecksum ( GameConnection conn  )  [virtual]

Gets the checksum for packet data.

Basically writes a packet, does a CRC check on it, and returns that CRC.

See also:
writePacketData
Parameters:
conn Game connection

Reimplemented from GameBase.

ShapeBase::DECLARE_CONOBJECT ( ShapeBase   ) 


Friends And Related Function Documentation

friend class ShapeBaseConvex [friend]

friend class ShapeBaseImageData [friend]

void physicalZoneFind ( SceneObject ,
void  
) [friend]


Field Documentation

Controlling object.

bool ShapeBase::mTrigger[MaxTriggerKeys] [private]

What triggers are set, if any.

Sound ShapeBase::mSoundThread[MaxSoundThreads] [private]

Thread ShapeBase::mScriptThread[MaxScriptThreads] [private]

bool ShapeBase::mInvincibleOn [private]

MountedImage ShapeBase::mMountedImageList[MaxMountedImages] [protected]

Name sent to client.

F32 ShapeBase::mEnergy [protected]

Current enery level.

Energy recharge rate (in units/tick).

bool ShapeBase::mChargeEnergy [protected]

Are we currently charging?

Note:
Currently unused.

F32 ShapeBase::mMass [protected]

Mass.

Inverse of mass.

Note:
This is used to optimize certain physics calculations.

F32 ShapeBase::mDrag [protected]

Drag.

Buoyancy factor.

Type of liquid (if any) we are in.

Height of liquid around us (from 0..1).

Percent of this object covered by water.

bool ShapeBase::mFlipFadeVal [protected]

Last shield direction (cur. unused).

Mounted objects.

F32 ShapeBase::mDamage [protected]

bool ShapeBase::mRepairDamage [protected]

bool ShapeBase::blowApart [protected]

bool ShapeBase::mCloaked [protected]

TextureHandle ShapeBase::mCloakTexture [protected]

bool ShapeBase::mHidden [protected]

in/out of world

bool ShapeBase::mFadeOut [protected]

bool ShapeBase::mFading [protected]

F32 ShapeBase::mFadeVal [protected]

Camera FOV(in degrees).

Reimplemented from GameBase.

bool ShapeBase::mIsControlled [protected]

Client side controlled flag.

U32 ShapeBase::sLastRenderFrame [static, protected]

Global flag which turns on or off all environment maps.




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen