aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
commitd11708e398c2f6377d9eac2b1f7248c62faab569 (patch)
tree5778e794690c046ab4b0205d8f764960a5af168b /PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp
parentPhysX 3.4, APEX 1.4 patch release @21821222 (diff)
downloadphysx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.tar.xz
physx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.zip
PhysX 3.4, APEX 1.4 patch release @22017166
Diffstat (limited to 'PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp')
-rw-r--r--PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp b/PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp
index 3a0cc9c7..4ce57c13 100644
--- a/PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp
+++ b/PhysX_3.4/Source/SimulationController/src/ScBodySim.cpp
@@ -93,7 +93,7 @@ Sc::BodySim::BodySim(Scene& scene, BodyCore& core) :
hasPendingForce = (velmod->flags != 0) &&
(!velmod->getLinearVelModPerSec().isZero() || !velmod->getAngularVelModPerSec().isZero() ||
!velmod->getLinearVelModPerStep().isZero() || !velmod->getAngularVelModPerStep().isZero());
- mVelModState = velmod->flags;
+ mVelModState = velmod->flags;
velmod->flags = 0;
}
@@ -121,6 +121,12 @@ Sc::BodySim::BodySim(Scene& scene, BodyCore& core) :
}
}
+
+ //If a user add force or torque before the body is inserted into the scene,
+ //this logic will make sure pre solver stage apply external force/torque to the body
+ if(hasPendingForce && !isArticulationLink())
+ scene.getVelocityModifyMap().growAndSet(mNodeIndex.index());
+
PX_ASSERT(mActiveListIndex == SC_NOT_IN_SCENE_INDEX);
setActive(isAwake, ActorSim::AS_PART_OF_CREATION);
@@ -493,10 +499,10 @@ void Sc::BodySim::activateInteractions(PxU32 /*infoFlag*/)
Ps::prefetchLine(mInteractions[PxMin(i+1,nbInteractions-1)]);
Interaction* interaction = mInteractions[i];
- bool isNotIGControlled = interaction->getType() != Sc::InteractionType::eCONSTRAINTSHADER && interaction->getType() != Sc::InteractionType::eOVERLAP &&
+ bool isNotIGControlled = interaction->getType() != Sc::InteractionType::eOVERLAP &&
interaction->getType() != Sc::InteractionType::eMARKER;
- if (!interaction->readInteractionFlag(InteractionFlag::eIS_ACTIVE) && isNotIGControlled)
+ if (!interaction->readInteractionFlag(InteractionFlag::eIS_ACTIVE) && (isNotIGControlled))
{
const bool proceed = interaction->onActivate(NULL);
if (proceed && (interaction->getType() < InteractionType::eTRACKED_IN_SCENE_COUNT))
@@ -515,7 +521,7 @@ void Sc::BodySim::deactivateInteractions(PxU32 infoFlag)
Ps::prefetchLine(mInteractions[PxMin(i+1,nbInteractions-1)]);
Interaction* interaction = mInteractions[i];
- bool isNotIGControlled = interaction->getType() != Sc::InteractionType::eCONSTRAINTSHADER && interaction->getType() != Sc::InteractionType::eOVERLAP &&
+ bool isNotIGControlled = interaction->getType() != Sc::InteractionType::eOVERLAP &&
interaction->getType() != Sc::InteractionType::eMARKER;
if (interaction->readInteractionFlag(InteractionFlag::eIS_ACTIVE) && isNotIGControlled)