From c5e5d7c939a2640763775b0688ed698c51ec28c1 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 24 May 2021 13:32:27 -0400 Subject: Applying force to the object using the mouse cursor --- 2d/_collisions/rectangle_rectangle/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '2d/_collisions/rectangle_rectangle/main.cpp') diff --git a/2d/_collisions/rectangle_rectangle/main.cpp b/2d/_collisions/rectangle_rectangle/main.cpp index 689ea11..6913749 100644 --- a/2d/_collisions/rectangle_rectangle/main.cpp +++ b/2d/_collisions/rectangle_rectangle/main.cpp @@ -411,12 +411,12 @@ void update(float32 deltaTimeSeconds, void* userData) { rect->body.position.y = 0.f; rect->body.velocity = rect->body.velocity - Vector2 { 0.f, 1.f } * (2 * (rect->body.velocity.dot(Vector2 { 0.f, 1.f }))); } - if (rect->body.position.x >= 640.f) { - rect->body.position.x = 640.f; + if (rect->body.position.x >= 800.f) { + rect->body.position.x = 800.f; rect->body.velocity = rect->body.velocity - Vector2 { -1.f, 0.f } * (2 * (rect->body.velocity.dot(Vector2{ -1.f, 0.f }))); } - if (rect->body.position.y >= 480.f) { - rect->body.position.y = 480.f; + if (rect->body.position.y >= 600.f) { + rect->body.position.y = 600.f; rect->body.velocity = rect->body.velocity - Vector2 { 0.f, -1.f } * (2 * (rect->body.velocity.dot(Vector2 { 0.f, -1.f }))) ; } } -- cgit v1.2.1