aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-11-20 11:35:52 -0600
committerSheikh Dawood Abdul Ajees <[email protected]>2017-11-20 11:35:52 -0600
commit3cc1861221d761b7f0301b9b61de4e1aa18c09f4 (patch)
treea51eb808016e1710a4bbd537000a493250602944 /PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp
parentPhysX 3.4.1, APEX 1.4.1 Release @22845541 (diff)
downloadphysx-3.4-3cc1861221d761b7f0301b9b61de4e1aa18c09f4.tar.xz
physx-3.4-3cc1861221d761b7f0301b9b61de4e1aa18c09f4.zip
PhysX 3.4.1, APEX 1.4.1 Release @23131702
Diffstat (limited to 'PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp')
-rw-r--r--PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp b/PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp
index 632f53d4..c6d3f7c1 100644
--- a/PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp
+++ b/PhysX_3.4/Source/PhysXExtensions/src/ExtD6JointSolverPrep.cpp
@@ -68,7 +68,7 @@ namespace Ext
PxTransform cB2w = bB2w.transform(data.c2b[1]);
body0WorldOffset = cB2w.p-bA2w.p;
- ConstraintHelper g(constraints, cA2w.p-bA2w.p, cB2w.p-bB2w.p);
+ ConstraintHelper g(constraints, cB2w.p-bA2w.p, cB2w.p-bB2w.p);
if(cA2w.q.dot(cB2w.q)<0) // minimum dist quat (equiv to flipping cB2bB.q, which we don't use anywhere)
cB2w.q = -cB2w.q;
@@ -147,7 +147,8 @@ namespace Ext
if(limited & SWING1_FLAG && limited & SWING2_FLAG)
{
- Cm::ConeLimitHelper coneHelper(data.tqSwingZ, data.tqSwingY, data.tqSwingPad);
+ const PxReal pad = data.swingLimit.isSoft() ? 0.0f : data.tqSwingPad;
+ Cm::ConeLimitHelper coneHelper(data.tqSwingZ, data.tqSwingY, pad);
PxVec3 axis;
PxReal error;
@@ -163,26 +164,16 @@ namespace Ext
if(limited & SWING1_FLAG)
{
if(locked & SWING2_FLAG)
- {
g.quarterAnglePair(Ps::tanHalf(swing.y, swing.w), -data.tqSwingY, data.tqSwingY, tqPad, aY, limit);
- }
else
- {
- PxReal dot=-aZ.dot(bX);
- g.halfAnglePair(Ps::tanHalf(dot, 1-dot*dot), -data.thSwingY, data.thSwingY, thPad, aZ.cross(bX), limit);
- }
+ g.halfAnglePair(tanHalfFromSin(-aZ.dot(bX)), -data.thSwingY, data.thSwingY, thPad, aZ.cross(bX), limit);
}
if(limited & SWING2_FLAG)
{
if(locked & SWING1_FLAG)
- {
g.quarterAnglePair(Ps::tanHalf(swing.z, swing.w), -data.tqSwingZ, data.tqSwingZ, tqPad, aZ, limit);
- }
else
- {
- PxReal dot=aY.dot(bX);
- g.halfAnglePair(Ps::tanHalf(dot, 1-dot*dot), -data.thSwingZ, data.thSwingZ, thPad, -aY.cross(bX), limit);
- }
+ g.halfAnglePair(tanHalfFromSin(aY.dot(bX)), -data.thSwingZ, data.thSwingZ, thPad, -aY.cross(bX), limit);
}
}