Merge pull request #936 from Azaezel/alpha402/vehicleCleanups

rigidshape and wheeledvehicle perf work
This commit is contained in:
Brian Roberts 2022-12-10 19:26:31 -06:00 committed by GitHub
commit abbfb634f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -1234,6 +1234,10 @@ collision, impact and contact forces are generated.
bool RigidShape::updateCollision(F32 dt) bool RigidShape::updateCollision(F32 dt)
{ {
PROFILE_SCOPE(RigidShape_updateCollision);
if (mRigid.atRest || mDisableMove || (getVelocity().lenSquared() < mDataBlock->contactTol * mDataBlock->contactTol)) return false;
// Update collision information // Update collision information
MatrixF mat,cmat; MatrixF mat,cmat;
mConvex.transform = &mat; mConvex.transform = &mat;
@ -1262,6 +1266,7 @@ on standard collision resolution formulas.
*/ */
bool RigidShape::resolveCollision(Rigid& ns,CollisionList& cList) bool RigidShape::resolveCollision(Rigid& ns,CollisionList& cList)
{ {
PROFILE_SCOPE(RigidShape_resolveCollision);
// Apply impulses to resolve collision // Apply impulses to resolve collision
bool collided = false; bool collided = false;
for (S32 i = 0; i < cList.getCount(); i++) for (S32 i = 0; i < cList.getCount(); i++)
@ -1314,6 +1319,7 @@ on the depth of penetration and the moment of inertia at the point of contact.
*/ */
bool RigidShape::resolveContacts(Rigid& ns,CollisionList& cList,F32 dt) bool RigidShape::resolveContacts(Rigid& ns,CollisionList& cList,F32 dt)
{ {
PROFILE_SCOPE(RigidShape_resolveContacts);
// Use spring forces to manage contact constraints. // Use spring forces to manage contact constraints.
bool collided = false; bool collided = false;
Point3F t,p(0,0,0),l(0,0,0); Point3F t,p(0,0,0),l(0,0,0);

View file

@ -799,7 +799,7 @@ void WheeledVehicle::advanceTime(F32 dt)
// Stick the wheels to the ground. This is purely so they look // Stick the wheels to the ground. This is purely so they look
// good while the vehicle is being interpolated. // good while the vehicle is being interpolated.
extendWheels(); //extendWheels();
// Update wheel angular position and slip, this is a client visual // Update wheel angular position and slip, this is a client visual
// feature only, it has no affect on the physics. // feature only, it has no affect on the physics.