From f69bc5948a538c366eb006dc3478aae7e9ff00eb Mon Sep 17 00:00:00 2001 From: Rita1218 <145887023+Rita1218@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:24:03 +0800 Subject: [PATCH] Update rigid_body.cpp --- src/GameX/physics/rigid_body.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GameX/physics/rigid_body.cpp b/src/GameX/physics/rigid_body.cpp index 99a695e..f2539ac 100644 --- a/src/GameX/physics/rigid_body.cpp +++ b/src/GameX/physics/rigid_body.cpp @@ -1,13 +1,15 @@ #include "GameX/physics/rigid_body.h" -#include + namespace GameX::Physics { void RigidBody::Update(float delta_time) { position += velocity * delta_time; if (position.y < -20.0) { - std::cout << "GAME OVER" << std::endl; - exit(1); + position = ini_position + glm::vec3{0.0f, 5.0f, 0.0f}; + velocity = glm::vec3{0.0f, 0.0f, 0.0f}; + angular_velocity = glm::vec3{0.0f, 0.0f, 0.0f}; + orientation = glm::mat3{1.0f}; } orientation = Base::Rotate(angular_velocity * delta_time) * orientation; }