mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-06-01 18:46:39 +00:00
Update player.cpp
This commit is contained in:
parent
40f22dc792
commit
66a6c3dc87
1 changed files with 12 additions and 12 deletions
|
|
@ -1005,28 +1005,28 @@ void PlayerData::initPersistFields()
|
|||
"@brief Collision bounding box used when the player is swimming.\n\n"
|
||||
"@see boundingBox" );
|
||||
|
||||
// Damage collision boxes changed by Skurps
|
||||
addFieldV( "boxHeadPercentage", TypeRangedF32, Offset(boxHeadPercentage, PlayerData), &CommonValidators::PositiveFloat,
|
||||
// Damage collision boxes changed by Skurps
|
||||
addFieldV( "boxHeadPercentage", TypeRangedF32, Offset(boxHeadPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box height that represents the head.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
addFieldV( "boxTorsoPercentage", TypeRangedF32, Offset(boxTorsoPercentage, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "boxTorsoPercentage", TypeRangedF32, Offset(boxTorsoPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box height that represents the torso.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
addFieldV( "boxTorsoLeftPercentage", TypeRangedF32, Offset(boxTorsoLeftPercentage, PlayerData), &CommonValidators::NegDefaultF32,
|
||||
"@brief Percentage of the player's bounding box width from center that represents the left side of the torso (should be a negative float).\n\n"
|
||||
addFieldV( "boxTorsoLeftPercentage", TypeRangedF32, Offset(boxTorsoLeftPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box width from center that represents the left side of the torso.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
addFieldV( "boxTorsoRightPercentage", TypeRangedF32, Offset(boxTorsoRightPercentage, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "boxTorsoRightPercentage", TypeRangedF32, Offset(boxTorsoRightPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box width from center that represents the right side of the torso.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
addFieldV( "boxTorsoBackPercentage", TypeRangedF32, Offset(boxTorsoBackPercentage, PlayerData), &CommonValidators::NegDefaultF32,
|
||||
"@brief Percentage of the player's bounding box depth from center that represents the back side of the torso (should be a negative float).\n\n"
|
||||
addFieldV( "boxTorsoBackPercentage", TypeRangedF32, Offset(boxTorsoBackPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box depth from center that represents the back side of the torso.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
addFieldV( "boxTorsoFrontPercentage", TypeRangedF32, Offset(boxTorsoFrontPercentage, PlayerData), &CommonValidators::PositiveFloat,
|
||||
addFieldV( "boxTorsoFrontPercentage", TypeRangedF32, Offset(boxTorsoFrontPercentage, PlayerData), &CommonValidators::NormalizedFloat,
|
||||
"@brief Percentage of the player's bounding box depth from center that represents the front side of the torso.\n\n"
|
||||
"Used when computing the damage location.\n"
|
||||
"@see Player::getDamageLocation" );
|
||||
|
|
@ -2395,10 +2395,10 @@ void Player::getDamageLocation(const Point3F& in_rPos, const char *&out_rpVert,
|
|||
{
|
||||
F32 xWidth = boxSize.x;
|
||||
|
||||
//boxTorsoBackPercentage and boxTorsoLeftPercentage should both be negative floats
|
||||
F32 backPoint = yLength * mDataBlock->boxTorsoBackPercentage;
|
||||
//boxTorsoBackPercentage and boxTorsoLeftPercentage need to be flipped negative
|
||||
F32 backPoint = (yLength * mDataBlock->boxTorsoBackPercentage) * -1.0f;
|
||||
F32 frontPoint = yLength * mDataBlock->boxTorsoFrontPercentage;
|
||||
F32 leftPoint = xWidth * mDataBlock->boxTorsoLeftPercentage;
|
||||
F32 leftPoint = (xWidth * mDataBlock->boxTorsoLeftPercentage) * -1.0f;
|
||||
F32 rightPoint = xWidth * mDataBlock->boxTorsoRightPercentage;
|
||||
|
||||
S32 index = 0; //Middle hits are cases 0-2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue