mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Update player.h
This commit is contained in:
parent
019d0b951b
commit
405f458e17
1 changed files with 37 additions and 10 deletions
|
|
@ -62,6 +62,7 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
typedef ShapeBaseData Parent;
|
typedef ShapeBaseData Parent;
|
||||||
enum Constants {
|
enum Constants {
|
||||||
RecoverDelayBits = 7,
|
RecoverDelayBits = 7,
|
||||||
|
ProneRecoverDelayBits = 7, //Skurps
|
||||||
JumpDelayBits = 7,
|
JumpDelayBits = 7,
|
||||||
NumSpineNodes = 6,
|
NumSpineNodes = 6,
|
||||||
ImpactBits = 3,
|
ImpactBits = 3,
|
||||||
|
|
@ -97,9 +98,8 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
F32 maxLookAngle; ///< Highest angle (radians) the player can look
|
F32 maxLookAngle; ///< Highest angle (radians) the player can look
|
||||||
F32 maxFreelookAngle; ///< Max left/right angle the player can look
|
F32 maxFreelookAngle; ///< Max left/right angle the player can look
|
||||||
|
|
||||||
F32 minProneLookAngle; /// Skurps
|
F32 minProneLookAngle; //< Lowest angle (radians) the player can look when prone. Should be >= minLookAngle. -Skurps
|
||||||
F32 maxProneLookAngle; /// Skurps
|
F32 maxProneLookAngle; ///< Highest angle (radians) the player can look when prone. Should be <= maxLookAngle. -Skurps
|
||||||
|
|
||||||
|
|
||||||
/// @name Physics constants
|
/// @name Physics constants
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -125,6 +125,10 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
/// sequence's playback will be scaled to match.
|
/// sequence's playback will be scaled to match.
|
||||||
bool transitionToLand; ///< When going from a fall to a land, should we transition between the two?
|
bool transitionToLand; ///< When going from a fall to a land, should we transition between the two?
|
||||||
|
|
||||||
|
F32 proneInSequenceTime; ///< Time for getting in prone, proneIn sequence is scaled to match this-Skurps
|
||||||
|
F32 proneDiveSequenceTime; ///< Time for diving into prone, dive sequence is scaled to match this-Skurps
|
||||||
|
F32 proneOutSequenceTime; ///< Time for getting up from prone, proneOut sequence is scaled to match this-Skurps
|
||||||
|
|
||||||
// Running/Walking
|
// Running/Walking
|
||||||
F32 runForce; ///< Force used to accelerate player
|
F32 runForce; ///< Force used to accelerate player
|
||||||
F32 runEnergyDrain; ///< Energy drain/tick
|
F32 runEnergyDrain; ///< Energy drain/tick
|
||||||
|
|
@ -159,18 +163,24 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
F32 maxUnderwaterForwardSpeed; ///< Maximum underwater forward speed when running
|
F32 maxUnderwaterForwardSpeed; ///< Maximum underwater forward speed when running
|
||||||
F32 maxUnderwaterBackwardSpeed; ///< Maximum underwater backward speed when running
|
F32 maxUnderwaterBackwardSpeed; ///< Maximum underwater backward speed when running
|
||||||
F32 maxUnderwaterSideSpeed; ///< Maximum underwater side speed when running
|
F32 maxUnderwaterSideSpeed; ///< Maximum underwater side speed when running
|
||||||
|
F32 swimYawScale; ///< Amount to scale yaw motion while swimming -Skurps
|
||||||
|
F32 swimPitchScale; ///< Amount to scale pitch motion while swimming -Skurps
|
||||||
|
|
||||||
// Crouching
|
// Crouching
|
||||||
F32 crouchForce; ///< Force used to accelerate player while crouching
|
F32 crouchForce; ///< Force used to accelerate player while crouching
|
||||||
F32 maxCrouchForwardSpeed; ///< Maximum forward speed when crouching
|
F32 maxCrouchForwardSpeed; ///< Maximum forward speed when crouching
|
||||||
F32 maxCrouchBackwardSpeed; ///< Maximum backward speed when crouching
|
F32 maxCrouchBackwardSpeed; ///< Maximum backward speed when crouching
|
||||||
F32 maxCrouchSideSpeed; ///< Maximum side speed when crouching
|
F32 maxCrouchSideSpeed; ///< Maximum side speed when crouching
|
||||||
|
F32 crouchYawScale; ///< Amount to scale yaw motion while crouching -Skurps
|
||||||
|
F32 crouchPitchScale; ///< Amount to scale pitch motion while crouching -Skurps
|
||||||
|
|
||||||
// Prone
|
// Prone
|
||||||
F32 proneForce; ///< Force used to accelerate player while prone
|
F32 proneForce; ///< Force used to accelerate player while prone
|
||||||
F32 maxProneForwardSpeed; ///< Maximum forward speed when prone
|
F32 maxProneForwardSpeed; ///< Maximum forward speed when prone
|
||||||
F32 maxProneBackwardSpeed; ///< Maximum backward speed when prone
|
F32 maxProneBackwardSpeed; ///< Maximum backward speed when prone
|
||||||
F32 maxProneSideSpeed; ///< Maximum side speed when prone
|
F32 maxProneSideSpeed; ///< Maximum side speed when prone
|
||||||
|
F32 proneYawScale; ///< Amount to scale yaw motion while prone -Skurps
|
||||||
|
F32 pronePitchScale; ///< Amount to scale pitch motion while prone -Skurps
|
||||||
|
|
||||||
// Jetting
|
// Jetting
|
||||||
F32 jetJumpForce;
|
F32 jetJumpForce;
|
||||||
|
|
@ -227,7 +237,7 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
ImpactWaterMedium,
|
ImpactWaterMedium,
|
||||||
ImpactWaterHard,
|
ImpactWaterHard,
|
||||||
ExitWater,
|
ExitWater,
|
||||||
Crawl,//Skurps
|
Crawl,//Skurps
|
||||||
MaxSounds
|
MaxSounds
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -252,6 +262,7 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
F32 speed; ///< Speed in m/s
|
F32 speed; ///< Speed in m/s
|
||||||
bool velocityScale; ///< Scale animation by velocity
|
bool velocityScale; ///< Scale animation by velocity
|
||||||
bool death; ///< Are we dying?
|
bool death; ///< Are we dying?
|
||||||
|
F32 angularSpeed; ///< Radians per frame -Skurps
|
||||||
};
|
};
|
||||||
enum {
|
enum {
|
||||||
// *** WARNING ***
|
// *** WARNING ***
|
||||||
|
|
@ -263,6 +274,8 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
BackBackwardAnim,
|
BackBackwardAnim,
|
||||||
SideLeftAnim,
|
SideLeftAnim,
|
||||||
SideRightAnim,
|
SideRightAnim,
|
||||||
|
TurnLeftAnim, //Skurps
|
||||||
|
TurnRightAnim, //Skurps
|
||||||
|
|
||||||
SprintRootAnim,
|
SprintRootAnim,
|
||||||
SprintForwardAnim,
|
SprintForwardAnim,
|
||||||
|
|
@ -275,12 +288,16 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
CrouchBackwardAnim,
|
CrouchBackwardAnim,
|
||||||
CrouchLeftAnim,
|
CrouchLeftAnim,
|
||||||
CrouchRightAnim,
|
CrouchRightAnim,
|
||||||
|
CrouchTurnLeftAnim, //Skurps
|
||||||
|
CrouchTurnRightAnim, //Skurps
|
||||||
|
|
||||||
ProneRootAnim,
|
ProneRootAnim,
|
||||||
ProneForwardAnim,
|
ProneForwardAnim,
|
||||||
ProneBackwardAnim,
|
ProneBackwardAnim,
|
||||||
ProneLeftAnim, //Skurps
|
ProneLeftAnim, //Skurps
|
||||||
ProneRightAnim, //Skurps
|
ProneRightAnim, //Skurps
|
||||||
|
ProneTurnLeftAnim, //Skurps
|
||||||
|
ProneTurnRightAnim, //Skurps
|
||||||
|
|
||||||
SwimRootAnim,
|
SwimRootAnim,
|
||||||
SwimForwardAnim,
|
SwimForwardAnim,
|
||||||
|
|
@ -294,13 +311,15 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
StandJumpAnim,
|
StandJumpAnim,
|
||||||
LandAnim,
|
LandAnim,
|
||||||
JetAnim,
|
JetAnim,
|
||||||
|
ProneInAnim, //Skurps
|
||||||
|
ProneOutAnim, //Skurps
|
||||||
|
DiveAnim, //Skurps
|
||||||
|
|
||||||
//
|
NumTableActionAnims = DiveAnim + 1, //Skurps
|
||||||
NumTableActionAnims = JetAnim + 1,
|
|
||||||
|
|
||||||
NumExtraActionAnims = 512 - NumTableActionAnims,
|
NumExtraActionAnims = 512 - NumTableActionAnims,
|
||||||
NumActionAnims = NumTableActionAnims + NumExtraActionAnims,
|
NumActionAnims = NumTableActionAnims + NumExtraActionAnims,
|
||||||
ActionAnimBits = 9,
|
ActionAnimBits = 10, // Skurps changed from 9
|
||||||
NullAnimation = (1 << ActionAnimBits) - 1
|
NullAnimation = (1 << ActionAnimBits) - 1
|
||||||
};
|
};
|
||||||
int mDynamicAnimsStart;
|
int mDynamicAnimsStart;
|
||||||
|
|
@ -374,6 +393,7 @@ struct PlayerData: public ShapeBaseData /*protected AssetPtrCallback < already i
|
||||||
void getGroundInfo(TSShapeInstance*,TSThread*,ActionAnimation*);
|
void getGroundInfo(TSShapeInstance*,TSThread*,ActionAnimation*);
|
||||||
bool isTableSequence(S32 seq);
|
bool isTableSequence(S32 seq);
|
||||||
bool isJumpAction(U32 action);
|
bool isJumpAction(U32 action);
|
||||||
|
bool isTurnAction(U32 action);//Skurps
|
||||||
|
|
||||||
static void initPersistFields();
|
static void initPersistFields();
|
||||||
void packData(BitStream* stream) override;
|
void packData(BitStream* stream) override;
|
||||||
|
|
@ -469,6 +489,8 @@ protected:
|
||||||
Point3F mHead; ///< Head rotation, uses only x & z
|
Point3F mHead; ///< Head rotation, uses only x & z
|
||||||
Point3F mRot; ///< Body rotation, uses only z
|
Point3F mRot; ///< Body rotation, uses only z
|
||||||
VectorF mVelocity; ///< Velocity
|
VectorF mVelocity; ///< Velocity
|
||||||
|
VectorF mAngularVelocity; ///< Angular Velocity (only z), Radians / Sec - Skurps
|
||||||
|
VectorF mAnimVelocity; ///< Skurps
|
||||||
Point3F mAnchorPoint; ///< Pos compression anchor
|
Point3F mAnchorPoint; ///< Pos compression anchor
|
||||||
S32 mImpactSound;
|
S32 mImpactSound;
|
||||||
|
|
||||||
|
|
@ -486,7 +508,8 @@ protected:
|
||||||
NullState,
|
NullState,
|
||||||
MoveState,
|
MoveState,
|
||||||
RecoverState,
|
RecoverState,
|
||||||
NumStateBits = 3
|
ProneRecoverState, // Skurps
|
||||||
|
NumStateBits = 4 // Skurps
|
||||||
};
|
};
|
||||||
ActionState mState; ///< What is the player doing? @see ActionState
|
ActionState mState; ///< What is the player doing? @see ActionState
|
||||||
bool mFalling; ///< Falling in mid-air?
|
bool mFalling; ///< Falling in mid-air?
|
||||||
|
|
@ -538,15 +561,19 @@ protected:
|
||||||
TSThread* mHeadHThread;
|
TSThread* mHeadHThread;
|
||||||
TSThread* mRecoilThread;
|
TSThread* mRecoilThread;
|
||||||
TSThread* mImageStateThread;
|
TSThread* mImageStateThread;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
bool mInMissionArea; ///< Are we in the mission area?
|
bool mInMissionArea; ///< Are we in the mission area?
|
||||||
//
|
//
|
||||||
S32 mRecoverTicks; ///< same as recoverTicks in the player datablock
|
S32 mRecoverTicks; ///< same as recoverTicks in the player datablock
|
||||||
|
|
||||||
U32 mReversePending;
|
U32 mReversePending;
|
||||||
F32 mRecoverDelay; ///< When bypassing the legacy recover system and only using the land sequence,
|
F32 mRecoverDelay; ///< When bypassing the legacy recover system and only using the land sequence,
|
||||||
/// this is how long the player will be in the land sequence.
|
/// this is how long the player will be in the land sequence.
|
||||||
|
|
||||||
|
F32 mProneRecoverDelay; ///< How long player takes to get up from Prone -Skurps
|
||||||
|
|
||||||
bool mInWater; ///< Is true if WaterCoverage is greater than zero
|
bool mInWater; ///< Is true if WaterCoverage is greater than zero
|
||||||
bool mSwimming; ///< Is true if WaterCoverage is above the swimming threshold
|
bool mSwimming; ///< Is true if WaterCoverage is above the swimming threshold
|
||||||
//
|
//
|
||||||
|
|
@ -644,7 +671,7 @@ protected:
|
||||||
virtual void updateAttachment();
|
virtual void updateAttachment();
|
||||||
// PATHSHAPE END
|
// PATHSHAPE END
|
||||||
///Update head animation
|
///Update head animation
|
||||||
void updateLookAnimation(F32 dT = 0.f);
|
void updateLookAnimation(F32 dt = 0.0f);
|
||||||
|
|
||||||
///Update other animations
|
///Update other animations
|
||||||
void updateAnimation(F32 dt);
|
void updateAnimation(F32 dt);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue