add rigidbody.set/get_gravity_scale

This commit is contained in:
MihailRis
2024-07-09 02:24:00 +03:00
parent cb37d3b00c
commit b4cf00a8f1
4 changed files with 19 additions and 3 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ struct Hitbox {
float linearDamping;
bool verticalDamping = false;
bool grounded = false;
float gravityMultiplier = 1.0f;
float gravityScale = 1.0f;
Hitbox(glm::vec3 position, glm::vec3 halfsize);
};
+1 -1
View File
@@ -32,7 +32,7 @@ void PhysicsSolver::step(
const glm::vec3& half = hitbox->halfsize;
glm::vec3& pos = hitbox->position;
glm::vec3& vel = hitbox->velocity;
float gravityScale = hitbox->gravityMultiplier;
float gravityScale = hitbox->gravityScale;
bool prevGrounded = hitbox->grounded;
hitbox->grounded = false;