mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Merge pull request #1369 from Areloch/FixPathShapeNudgeRayTest
Adjusts the test behavior for when the player class tries to ray-check against PathShapes
This commit is contained in:
commit
b671b85d30
1 changed files with 6 additions and 3 deletions
|
|
@ -4762,14 +4762,16 @@ bool Player::step(Point3F *pos,F32 *maxStep,F32 time)
|
||||||
// PATHSHAPE
|
// PATHSHAPE
|
||||||
// This Function does a ray cast down to see if a pathshape object is below
|
// This Function does a ray cast down to see if a pathshape object is below
|
||||||
// If so, it will attempt to attach to it.
|
// If so, it will attempt to attach to it.
|
||||||
void Player::updateAttachment(){
|
void Player::updateAttachment()
|
||||||
|
{
|
||||||
Point3F rot, pos;
|
Point3F rot, pos;
|
||||||
RayInfo rInfo;
|
RayInfo rInfo;
|
||||||
MatrixF mat = getTransform();
|
MatrixF mat = getTransform();
|
||||||
mat.getColumn(3, &pos);
|
mat.getColumn(3, &pos);
|
||||||
|
disableCollision();
|
||||||
if (gServerContainer.castRay(Point3F(pos.x, pos.y, pos.z + 0.1f),
|
if (gServerContainer.castRay(Point3F(pos.x, pos.y, pos.z + 0.1f),
|
||||||
Point3F(pos.x, pos.y, pos.z - 1.0f ),
|
Point3F(pos.x, pos.y, pos.z - 1.0f ),
|
||||||
PathShapeObjectType, &rInfo))
|
sCollisionMoveMask, &rInfo))
|
||||||
{
|
{
|
||||||
if ((mJumpSurfaceLastContact < JumpSkipContactsMax) && !mSwimming)
|
if ((mJumpSurfaceLastContact < JumpSkipContactsMax) && !mSwimming)
|
||||||
setPosition(rInfo.point, getRotation());
|
setPosition(rInfo.point, getRotation());
|
||||||
|
|
@ -4793,12 +4795,13 @@ void Player::updateAttachment(){
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (getParent() !=NULL)
|
if (getParent() != NULL)
|
||||||
{
|
{
|
||||||
clearProcessAfter();
|
clearProcessAfter();
|
||||||
attachToParent(NULL);
|
attachToParent(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
enableCollision();
|
||||||
}
|
}
|
||||||
// PATHSHAPE END
|
// PATHSHAPE END
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue