update vertical damping & add rigidbody:get_vdamping
This commit is contained in:
@@ -54,7 +54,7 @@ struct Hitbox {
|
||||
glm::vec3 velocity;
|
||||
float linearDamping = 0.5;
|
||||
float friction = 1.0f;
|
||||
bool verticalDamping = false;
|
||||
float verticalDamping = 1.0f;
|
||||
bool grounded = false;
|
||||
float gravityScale = 1.0f;
|
||||
bool crouching = false;
|
||||
|
||||
@@ -86,8 +86,8 @@ void PhysicsSolver::step(
|
||||
}
|
||||
vel.x /= 1.0f + delta * linearDamping;
|
||||
vel.z /= 1.0f + delta * linearDamping;
|
||||
if (hitbox.verticalDamping) {
|
||||
vel.y /= 1.0f + delta * linearDamping;
|
||||
if (hitbox.verticalDamping > 0.0f) {
|
||||
vel.y /= 1.0f + delta * linearDamping * hitbox.verticalDamping;
|
||||
}
|
||||
|
||||
AABB aabb;
|
||||
|
||||
Reference in New Issue
Block a user