Adjust crash tresholds and roll velocity

This commit is contained in:
tovjemam 2026-05-09 23:44:40 +02:00
parent b045f76a26
commit 6baf06541e
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ private:
std::shared_ptr<const assets::Model> model_; std::shared_ptr<const assets::Model> model_;
net::ObjNum num_; net::ObjNum num_;
std::unique_ptr<btRigidBody> body_; std::unique_ptr<btRigidBody> body_;
float destr_th_ = 10.0f; float destr_th_ = 1.0f;
}; };
class MapInstance class MapInstance

View File

@ -294,7 +294,7 @@ void game::Vehicle::ProcessInput()
{ {
btVector3 ang_vel = physics_->GetBtBody().getAngularVelocity(); btVector3 ang_vel = physics_->GetBtBody().getAngularVelocity();
const float max_vel = 5.0f; const float max_vel = 1.0f;
btTransform trans = physics_->GetBtBody().getWorldTransform(); btTransform trans = physics_->GetBtBody().getWorldTransform();
btQuaternion quat = trans.getRotation(); btQuaternion quat = trans.getRotation();
@ -316,9 +316,9 @@ void game::Vehicle::ProcessInput()
new_ang_vel += world_roll; new_ang_vel += world_roll;
ang_vel = btVector3(new_ang_vel.x, new_ang_vel.y, new_ang_vel.z); ang_vel = btVector3(new_ang_vel.x, new_ang_vel.y, new_ang_vel.z);
physics_->GetBtBody().setAngularVelocity(ang_vel);
} }
physics_->GetBtBody().setAngularVelocity(ang_vel);
} }
} }
@ -333,7 +333,7 @@ void game::Vehicle::UpdateCrash()
} }
else else
{ {
if (crash_intensity_ > 1000.0f) if (crash_intensity_ > 300.0f)
{ {
float volume = RandomFloat(0.9f, 1.2f); float volume = RandomFloat(0.9f, 1.2f);
float pitch = RandomFloat(1.0f, 1.3f); float pitch = RandomFloat(1.0f, 1.3f);
@ -355,7 +355,7 @@ void game::Vehicle::UpdateCrash()
} }
PlaySound("crash", volume, pitch); PlaySound("crash", volume, pitch);
no_crash_frames_ = 7 + rand() % 10; no_crash_frames_ = 3 + rand() % 10;
} }
} }