diff --git a/ivp b/ivp index 82849306..e83263d0 160000 --- a/ivp +++ b/ivp @@ -1 +1 @@ -Subproject commit 82849306f728db57868d7a82fe7bcff333eb468c +Subproject commit e83263d03e0f46f69c94d1881d76f65bbdc03487 diff --git a/vphysics/physics_object.cpp b/vphysics/physics_object.cpp index c5838b9f..7693be3b 100644 --- a/vphysics/physics_object.cpp +++ b/vphysics/physics_object.cpp @@ -177,6 +177,11 @@ void CPhysicsObject::Wake( void ) m_pObject->ensure_in_simulation(); } +void CPhysicsObject::WakeNow( void ) +{ + m_pObject->ensure_in_simulation_now(); +} + // supported void CPhysicsObject::Sleep( void ) { @@ -643,7 +648,6 @@ void CPhysicsObject::SetInertia( const Vector &inertia ) ri.k[2] = IVP_Inline_Math::fabsd(ri.k[2]); if( ri.k[0] > 1e14f ) ri.k[0] = 1e14f; if( ri.k[1] > 1e14f ) ri.k[1] = 1e14f; if( ri.k[2] > 1e14f ) ri.k[2] = 1e14f; - if( ri.k[0] <= 0 ) ri.k[0] = 1.f; if( ri.k[1] <= 0 ) ri.k[1] = 1.f; if( ri.k[2] <= 0 ) ri.k[2] = 1.f; m_pObject->get_core()->set_rotation_inertia( &ri ); } @@ -1092,7 +1096,6 @@ void GetWorldCoordFromSynapse( IVP_Synapse_Friction *pfriction, IVP_U_Point &wor world.set(pfriction->get_contact_point()->get_contact_point_ws()); } - bool CPhysicsObject::GetContactPoint( Vector *contactPoint, IPhysicsObject **contactObject ) const { IVP_Synapse_Friction *pfriction = m_pObject->get_first_friction_synapse(); diff --git a/vphysics/physics_object.h b/vphysics/physics_object.h index a1c6f5e1..8f672dd6 100644 --- a/vphysics/physics_object.h +++ b/vphysics/physics_object.h @@ -112,6 +112,7 @@ public: unsigned short GetGameIndex( void ) const; void Wake(); + void WakeNow(); void Sleep(); void RecheckCollisionFilter(); void RecheckContactPoints(); diff --git a/vphysics/vcollide_parse.cpp b/vphysics/vcollide_parse.cpp index 527e1865..f480b76c 100644 --- a/vphysics/vcollide_parse.cpp +++ b/vphysics/vcollide_parse.cpp @@ -175,12 +175,7 @@ void CVPhysicsParse::ParseSolid( solid_t *pSolid, IVPhysicsKeyHandler *unknownKe else if ( !Q_stricmp( key, "inertia" ) ) { float inertia = atof(value); - if( inertia > 1e14f ) - pSolid->params.inertia = 1e14f; - else if( inertia <= 0 ) - pSolid->params.inertia = 1.f; - else - pSolid->params.inertia = inertia; + pSolid->params.inertia = (inertia > 1e14f) ? 1e14f : inertia; } else if ( !Q_stricmp( key, "damping" ) ) { @@ -475,12 +470,7 @@ void CVPhysicsParse::ParseVehicleWheel( vehicle_wheelparams_t &wheel ) else if ( !Q_stricmp( key, "inertia" ) ) { float inertia = atof(value); - if( inertia > 1e14f ) - wheel.inertia = 1e14f; - else if( inertia <= 0 ) - wheel.inertia = 1.f; - else - wheel.inertia = inertia; + wheel.inertia = (inertia > 1e14f) ? 1e14f : inertia; } else if ( !Q_stricmp( key, "damping" ) ) {