PlayerData

Engine/source/T3D/player.h

More...

Classes:

class

Animation and other data initialized in onAdd.

Physics constants

Maximum height the player can step up.

Maximum angle from vertical in degrees the player can run up.

Max speed attainable in the horizontal.

Speed at which resistance will take place.

Factor of resistance once horizResistSpeed has been reached.

Max vertical speed attainable.

Speed at which resistance will take place.

Factor of resistance once upResistSpeed has been reached.

Downward speed at which we consider the player falling.

RunForce multiplier in recover state.

If greater than 0 then the legacy fall recovery system will be bypassed in favour of just playing the player's land sequence.

bool

When going from a fall to a land, should we transition between the two?

Force used to accelerate player.

Energy drain/tick.

Minimum energy required to run.

Maximum forward speed when running.

Maximum backward speed when running.

Maximum side speed when running.

Force exerted per jump.

Energy drained per jump.

Minimum energy required to jump.

Minimum speed needed to jump.

Maximum speed before the player can no longer jump.

Angle from vertical in degrees where the player can jump.

Delay time in ticks between jumps.

Force used to accelerate player.

Energy drain/tick.

Minimum energy required to sprint.

Maximum forward speed when sprinting.

Maximum backward speed when sprinting.

Maximum side speed when sprinting.

Amount to scale strafing motion vector while sprinting.

Amount to scale yaw motion while sprinting.

Amount to scale pitch motion while sprinting.

bool

Can the player jump while sprinting.

Force used to accelerate player while swimming.

Maximum underwater forward speed when running.

Maximum underwater backward speed when running.

Maximum underwater side speed when running.

Force used to accelerate player while crouching.

Maximum forward speed when crouching.

Maximum backward speed when crouching.

Maximum side speed when crouching.

Force used to accelerate player while prone.

Maximum forward speed when prone.

Maximum backward speed when prone.

Maximum side speed when prone.

Energy per jump.

Angle vertical degrees.

Callbacks

DECLARE_CALLBACK(void , onPoseChange , (Player *obj, const char *oldPose, const char *newPose) )
DECLARE_CALLBACK(void , onStartSwim , (Player *obj) )
DECLARE_CALLBACK(void , onStopSwim , (Player *obj) )
DECLARE_CALLBACK(void , onStartSprintMotion , (Player *obj) )
DECLARE_CALLBACK(void , onStopSprintMotion , (Player *obj) )
DECLARE_CALLBACK(void , doDismount , (Player *obj) )
DECLARE_CALLBACK(void , onEnterLiquid , (Player *obj, F32 coverage, const char *type) )
DECLARE_CALLBACK(void , onLeaveLiquid , (Player *obj, const char *type) )
DECLARE_CALLBACK(void , animationDone , (Player *obj) )
DECLARE_CALLBACK(void , onEnterMissionArea , (Player *obj) )
DECLARE_CALLBACK(void , onLeaveMissionArea , (Player *obj) )

Public Types

enum
_Anonymous_ {
  RootAnim 
  RunForwardAnim 
  BackBackwardAnim 
  SideLeftAnim 
  SideRightAnim 
  SprintRootAnim 
  SprintForwardAnim 
  SprintBackwardAnim 
  SprintLeftAnim 
  SprintRightAnim 
  CrouchRootAnim 
  CrouchForwardAnim 
  CrouchBackwardAnim 
  CrouchLeftAnim 
  CrouchRightAnim 
  ProneRootAnim 
  ProneForwardAnim 
  ProneBackwardAnim 
  SwimRootAnim 
  SwimForwardAnim 
  SwimBackwardAnim 
  SwimLeftAnim 
  SwimRightAnim 
  FallAnim 
  JumpAnim 
  StandJumpAnim 
  LandAnim 
  JetAnim 
  NumTableActionAnims = JetAnim + 1
  NumExtraActionAnims = 512 - NumTableActionAnims
  NumActionAnims = NumTableActionAnims + NumExtraActionAnims
  ActionAnimBits = 9
  NullAnimation = (1 << ActionAnimBits) - 1
}
enum
Constants {
  RecoverDelayBits = 7
  JumpDelayBits = 7
  NumSpineNodes = 6
  ImpactBits = 3
  NUM_SPLASH_EMITTERS = 3
  BUBBLE_EMITTER = 2
}
enum
Impacts {
  ImpactNone 
  ImpactNormal 
}
enum
Recoil {
  LightRecoil 
  MediumRecoil 
  HeavyRecoil 
  NumRecoilSequences 
}
enum
Sounds {
  FootSoft 
  FootHard 
  FootMetal 
  FootSnow 
  MaxSoundOffsets 
  FootShallowSplash 
  FootWading 
  FootUnderWater 
  FootBubbles 
  MoveBubbles 
  WaterBreath 
  ImpactStart 
  ImpactSoft = ImpactStart
  ImpactHard 
  ImpactMetal 
  ImpactSnow 
  ImpactWaterEasy 
  ImpactWaterMedium 
  ImpactWaterHard 
  ExitWater 
  MaxSounds 
}

Zounds!

Public Attributes

actionList [NumActionAnims]
bool

When true a new thread is added to the player to allow for mounted images to request a sequence be played on the player through the image's state machine.

Width, depth, height.

bool

Render shadows while in first person when renderFirstPerson is disabled.

Minimum impact speed required to apply fall damage with the ground.

How much to shake.

How long to shake.

How fast the shake disapates.

Frequency in each direction for the camera to shake.

Passed along to mounted images to modify animation sequences played in third person.

Passed along to mounted images to modify animation sequences played in first person.

Angle from vertical in cos(jumpSurfaceAngle)

Max left/right angle the player can look.

Highest angle (radians) the player can look.

Max timeScale for action animations.

mCRCFP [ShapeBase::MaxMountedImages]

Computed CRC values for the first person mounted image shapes Depends on the ShapeBaseData computeCRC field.

Minimum impact speed required to apply fall damage.

Minimum impact speed required to apply non-falling damage.

Lowest angle (radians) the player can look.

mShapeFP [ShapeBase::MaxMountedImages]

First person mounted image shape resources [optional].

bool
mValidShapeFP [ShapeBase::MaxMountedImages]

Indicates that there is a valid first person mounted image shape.

Base off of pcikupRadius.

Radius around player for items (on server)

recoilSequence [NumRecoilSequences]
bool

Render the player shape in first person.

Angle from vertical in cos(runSurfaceAngle)

shapeNameFP [ShapeBase::MaxMountedImages]

Used to render with mounted images in first person [optional].

sound [MaxSounds]
spineNode [NumSpineNodes]

Public Static Attributes

Public Functions

bool
isJumpAction(U32 action)
bool
bool
preload(bool server, String & errorStr)

Called to prepare the datablock for use, after it has been unpacked.

Public Static Functions

Detailed Description

Physics constants

F32 maxStepHeight 

Maximum height the player can step up.

F32 runSurfaceAngle 

Maximum angle from vertical in degrees the player can run up.

F32 horizMaxSpeed 

Max speed attainable in the horizontal.

F32 horizResistSpeed 

Speed at which resistance will take place.

F32 horizResistFactor 

Factor of resistance once horizResistSpeed has been reached.

F32 upMaxSpeed 

Max vertical speed attainable.

F32 upResistSpeed 

Speed at which resistance will take place.

F32 upResistFactor 

Factor of resistance once upResistSpeed has been reached.

F32 fallingSpeedThreshold 

Downward speed at which we consider the player falling.

S32 recoverDelay 

tick

F32 recoverRunForceScale 

RunForce multiplier in recover state.

F32 landSequenceTime 

If greater than 0 then the legacy fall recovery system will be bypassed in favour of just playing the player's land sequence.

The time to recover from a fall then becomes this parameter's time and the land sequence's playback will be scaled to match.

bool transitionToLand 

When going from a fall to a land, should we transition between the two?

F32 runForce 

Force used to accelerate player.

F32 runEnergyDrain 

Energy drain/tick.

F32 minRunEnergy 

Minimum energy required to run.

F32 maxForwardSpeed 

Maximum forward speed when running.

F32 maxBackwardSpeed 

Maximum backward speed when running.

F32 maxSideSpeed 

Maximum side speed when running.

F32 jumpForce 

Force exerted per jump.

F32 jumpEnergyDrain 

Energy drained per jump.

F32 minJumpEnergy 

Minimum energy required to jump.

F32 minJumpSpeed 

Minimum speed needed to jump.

F32 maxJumpSpeed 

Maximum speed before the player can no longer jump.

F32 jumpSurfaceAngle 

Angle from vertical in degrees where the player can jump.

S32 jumpDelay 

Delay time in ticks between jumps.

F32 sprintForce 

Force used to accelerate player.

F32 sprintEnergyDrain 

Energy drain/tick.

F32 minSprintEnergy 

Minimum energy required to sprint.

F32 maxSprintForwardSpeed 

Maximum forward speed when sprinting.

F32 maxSprintBackwardSpeed 

Maximum backward speed when sprinting.

F32 maxSprintSideSpeed 

Maximum side speed when sprinting.

F32 sprintStrafeScale 

Amount to scale strafing motion vector while sprinting.

F32 sprintYawScale 

Amount to scale yaw motion while sprinting.

F32 sprintPitchScale 

Amount to scale pitch motion while sprinting.

bool sprintCanJump 

Can the player jump while sprinting.

F32 swimForce 

Force used to accelerate player while swimming.

F32 maxUnderwaterForwardSpeed 

Maximum underwater forward speed when running.

F32 maxUnderwaterBackwardSpeed 

Maximum underwater backward speed when running.

F32 maxUnderwaterSideSpeed 

Maximum underwater side speed when running.

F32 crouchForce 

Force used to accelerate player while crouching.

F32 maxCrouchForwardSpeed 

Maximum forward speed when crouching.

F32 maxCrouchBackwardSpeed 

Maximum backward speed when crouching.

F32 maxCrouchSideSpeed 

Maximum side speed when crouching.

F32 proneForce 

Force used to accelerate player while prone.

F32 maxProneForwardSpeed 

Maximum forward speed when prone.

F32 maxProneBackwardSpeed 

Maximum backward speed when prone.

F32 maxProneSideSpeed 

Maximum side speed when prone.

F32 jetJumpForce 
F32 jetJumpEnergyDrain 

Energy per jump.

F32 jetMinJumpEnergy 
F32 jetMinJumpSpeed 
F32 jetMaxJumpSpeed 
F32 jetJumpSurfaceAngle 

Angle vertical degrees.

Hitboxes

F32 boxHeadPercentage 
F32 boxTorsoPercentage 
F32 boxHeadLeftPercentage 
F32 boxHeadRightPercentage 
F32 boxHeadBackPercentage 
F32 boxHeadFrontPercentage 

Particles

All of the data relating to environmental effects

ParticleEmitterData * footPuffEmitter 
S32 footPuffID 
S32 footPuffNumParts 
F32 footPuffRadius 
DecalData * decalData 
S32 decalID 
ParticleEmitterData * dustEmitter 
S32 dustID 
SplashData * splash 
S32 splashId 
F32 splashVelocity 
F32 splashAngle 
F32 splashFreqMod 
F32 splashVelEpsilon 
F32 bubbleEmitTime 
F32 medSplashSoundVel 
F32 hardSplashSoundVel 
F32 exitSplashSoundVel 
F32 footSplashHeight 
F32 airControl 
bool jumpTowardsNormal 
StringTableEntry physicsPlayerType 
ParticleEmitterData * splashEmitterList [NUM_SPLASH_EMITTERS]
S32 splashEmitterIDList [NUM_SPLASH_EMITTERS]

Callbacks

DECLARE_CALLBACK(void , onPoseChange , (Player *obj, const char *oldPose, const char *newPose) )

DECLARE_CALLBACK(void , onStartSwim , (Player *obj) )

DECLARE_CALLBACK(void , onStopSwim , (Player *obj) )

DECLARE_CALLBACK(void , onStartSprintMotion , (Player *obj) )

DECLARE_CALLBACK(void , onStopSprintMotion , (Player *obj) )

DECLARE_CALLBACK(void , doDismount , (Player *obj) )

DECLARE_CALLBACK(void , onEnterLiquid , (Player *obj, F32 coverage, const char *type) )

DECLARE_CALLBACK(void , onLeaveLiquid , (Player *obj, const char *type) )

DECLARE_CALLBACK(void , animationDone , (Player *obj) )

DECLARE_CALLBACK(void , onEnterMissionArea , (Player *obj) )

DECLARE_CALLBACK(void , onLeaveMissionArea , (Player *obj) )

Public Types

@196

Enumerator

RootAnim
RunForwardAnim
BackBackwardAnim
SideLeftAnim
SideRightAnim
SprintRootAnim
SprintForwardAnim
SprintBackwardAnim
SprintLeftAnim
SprintRightAnim
CrouchRootAnim
CrouchForwardAnim
CrouchBackwardAnim
CrouchLeftAnim
CrouchRightAnim
ProneRootAnim
ProneForwardAnim
ProneBackwardAnim
SwimRootAnim
SwimForwardAnim
SwimBackwardAnim
SwimLeftAnim
SwimRightAnim
FallAnim
JumpAnim
StandJumpAnim
LandAnim
JetAnim
NumTableActionAnims = JetAnim + 1
NumExtraActionAnims = 512 - NumTableActionAnims
NumActionAnims = NumTableActionAnims + NumExtraActionAnims
ActionAnimBits = 9
NullAnimation = (1 << ActionAnimBits) - 1
Constants

Enumerator

RecoverDelayBits = 7
JumpDelayBits = 7
NumSpineNodes = 6
ImpactBits = 3
NUM_SPLASH_EMITTERS = 3
BUBBLE_EMITTER = 2
Impacts

Enumerator

ImpactNone
ImpactNormal
Recoil

Enumerator

LightRecoil
MediumRecoil
HeavyRecoil
NumRecoilSequences
Sounds

Enumerator

FootSoft
FootHard
FootMetal
FootSnow
MaxSoundOffsets
FootShallowSplash
FootWading
FootUnderWater
FootBubbles
MoveBubbles
WaterBreath
ImpactStart
ImpactSoft = ImpactStart
ImpactHard
ImpactMetal
ImpactSnow
ImpactWaterEasy
ImpactWaterMedium
ImpactWaterHard
ExitWater
MaxSounds

Zounds!

typedef ShapeBaseData Parent 

Public Attributes

U32 actionCount 
ActionAnimation actionList [NumActionAnims]
bool allowImageStateAnimation 

When true a new thread is added to the player to allow for mounted images to request a sequence be played on the player through the image's state machine.

It is only optional so that we don't create a TSThread on the player if we don't need to.

Point3F boxSize 

Width, depth, height.

Point3F crouchBoxSize 
F32 decalOffset 
bool firstPersonShadows 

Render shadows while in first person when renderFirstPerson is disabled.

F32 groundImpactMinSpeed 

Minimum impact speed required to apply fall damage with the ground.

VectorF groundImpactShakeAmp 

How much to shake.

F32 groundImpactShakeDuration 

How long to shake.

F32 groundImpactShakeFalloff 

How fast the shake disapates.

VectorF groundImpactShakeFreq 

Frequency in each direction for the camera to shake.

StringTableEntry imageAnimPrefix 

Passed along to mounted images to modify animation sequences played in third person.

[optional]

StringTableEntry imageAnimPrefixFP 

Passed along to mounted images to modify animation sequences played in first person.

[optional]

F32 jumpSurfaceCos 

Angle from vertical in cos(jumpSurfaceAngle)

U32 lookAction 
F32 maxFreelookAngle 

Max left/right angle the player can look.

F32 maxLookAngle 

Highest angle (radians) the player can look.

F32 maxTimeScale 

Max timeScale for action animations.

U32 mCRCFP [ShapeBase::MaxMountedImages]

Computed CRC values for the first person mounted image shapes Depends on the ShapeBaseData computeCRC field.

F32 minImpactSpeed 

Minimum impact speed required to apply fall damage.

F32 minLateralImpactSpeed 

Minimum impact speed required to apply non-falling damage.

F32 minLookAngle 

Lowest angle (radians) the player can look.

Resource< TSShape > mShapeFP [ShapeBase::MaxMountedImages]

First person mounted image shape resources [optional].

bool mValidShapeFP [ShapeBase::MaxMountedImages]

Indicates that there is a valid first person mounted image shape.

S32 pickupDelta 

Base off of pcikupRadius.

F32 pickupRadius 

Radius around player for items (on server)

Point3F proneBoxSize 
S32 recoilSequence [NumRecoilSequences]
bool renderFirstPerson 

Render the player shape in first person.

F32 runSurfaceCos 

Angle from vertical in cos(runSurfaceAngle)

StringTableEntry shapeNameFP [ShapeBase::MaxMountedImages]

Used to render with mounted images in first person [optional].

SFXTrack * sound [MaxSounds]
S32 spineNode [NumSpineNodes]
Point3F swimBoxSize 

Public Static Attributes

ActionAnimationDef ActionAnimationList [NumTableActionAnims]

Public Functions

PlayerData()

DECLARE_CONOBJECT(PlayerData )

getGroundInfo(TSShapeInstance * , TSThread * , ActionAnimation * )

isJumpAction(U32 action)

isTableSequence(S32 seq)

packData(BitStream * stream)

Reimplemented from: ShapeBaseData

preload(bool server, String & errorStr)

Reimplemented from: ShapeBaseData

unpackData(BitStream * stream)

Reimplemented from: ShapeBaseData

Public Static Functions

initPersistFields()