mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Adds logic to temporarily disable collisions of mounted objects on Players so you don't try colliding with things that are mounted to you when moving.
This commit is contained in:
parent
775ca57047
commit
87ef9bf15e
1 changed files with 14 additions and 0 deletions
|
|
@ -6150,8 +6150,22 @@ void Player::updateWorkingCollisionSet()
|
||||||
mWorkingQueryBox.maxExtents += twolPoint;
|
mWorkingQueryBox.maxExtents += twolPoint;
|
||||||
|
|
||||||
disableCollision();
|
disableCollision();
|
||||||
|
|
||||||
|
//We temporarily disable the collisions of anything mounted to us so we don't accidentally walk into things we've attached to us
|
||||||
|
for (SceneObject *ptr = mMount.list; ptr; ptr = ptr->getMountLink())
|
||||||
|
{
|
||||||
|
ptr->disableCollision();
|
||||||
|
}
|
||||||
|
|
||||||
mConvex.updateWorkingList(mWorkingQueryBox,
|
mConvex.updateWorkingList(mWorkingQueryBox,
|
||||||
isGhost() ? sClientCollisionContactMask : sServerCollisionContactMask);
|
isGhost() ? sClientCollisionContactMask : sServerCollisionContactMask);
|
||||||
|
|
||||||
|
//And now re-enable the collisions of the mounted things
|
||||||
|
for (SceneObject *ptr = mMount.list; ptr; ptr = ptr->getMountLink())
|
||||||
|
{
|
||||||
|
ptr->enableCollision();
|
||||||
|
}
|
||||||
|
|
||||||
enableCollision();
|
enableCollision();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue