Minor Update - Object Rendering change

+ RenderPass (render object in a vector)
This commit is contained in:
2025-01-11 13:53:35 +01:00
parent bce659e55d
commit 915c0cdd7f
9 changed files with 220 additions and 155 deletions

View File

@@ -28,7 +28,7 @@ void Physics::SetGravity(XMVECTOR gravity)
}
// Apply gravity to an object
void Physics::ApplyGravity(Object* object, float dragValue, float frameTime)
void Physics::ApplyGravity(Object* object, float dragValue)
{
if (object == nullptr) // Verify if the object is not null
{
@@ -53,7 +53,7 @@ void Physics::ApplyGravity(Object* object, float dragValue, float frameTime)
XMVECTOR velocity = object->GetVelocity();
// Update the velocity with the object's acceleration
velocity += object->GetAcceleration() * frameTime;
velocity += object->GetAcceleration();
// Set the new velocity
object->SetVelocity(velocity);
@@ -174,5 +174,4 @@ bool Physics::SphereCubeOverlap(Object* cube, Object* sphere)
float radius = XMVectorGetX(XMVector3Length(scale2));
return distance < radius;
}
}