From 262f29447700db129ff3fa25315382d80581a41c Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Thu, 13 May 2021 21:23:12 -0400 Subject: Some slight number tweaks, going to move on to something more complicated for now --- .../2d/_collisions/rectangle_line/dist/output.wasm | Bin 50712 -> 50712 bytes frontend/2d/_collisions/rectangle_line/main.cpp | 8 ++++---- .../rectangle_rectangle/dist/output.wasm | Bin 55719 -> 55719 bytes .../2d/_collisions/rectangle_rectangle/main.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/2d/_collisions/rectangle_line/dist/output.wasm b/frontend/2d/_collisions/rectangle_line/dist/output.wasm index f23eebd..4c2d2a2 100755 Binary files a/frontend/2d/_collisions/rectangle_line/dist/output.wasm and b/frontend/2d/_collisions/rectangle_line/dist/output.wasm differ diff --git a/frontend/2d/_collisions/rectangle_line/main.cpp b/frontend/2d/_collisions/rectangle_line/main.cpp index 74e1ec2..25e124c 100644 --- a/frontend/2d/_collisions/rectangle_line/main.cpp +++ b/frontend/2d/_collisions/rectangle_line/main.cpp @@ -32,7 +32,7 @@ struct Rigidbody { } void applyGravity(float32 deltaTimeSeconds) { - velocity += (Vector2 { 0.f, -96.f } * deltaTimeSeconds); + velocity += (Vector2 { 0.f, -50.f } * deltaTimeSeconds); } void update(float32 deltaTimeSeconds) { @@ -88,7 +88,7 @@ struct Rectangle { shape.load(vertices, 6, renderer); body.reset(); - body.momentOfInertia = (1.f / 12.f) * body.mass * (width + height * height * height); + body.momentOfInertia = (1.f / 3.f) * body.mass * (width + height * height * height); } void update(float32 dtSeconds) { @@ -126,7 +126,7 @@ struct LineSegment { shape.load(vertices, 2, renderer); body.reset(); - body.mass = 1000000000.f; + body.mass = 10000000000000.f; body.cofOfRestition = 1.f; body.rotationalVelocity = 0; body.velocity = Vector2(); @@ -182,7 +182,7 @@ void load() { segmentList[3].load(&renderer, Vector4().fromColor(205, 178, 214, 255.f), Vector2 { 50.f, 150.f }, Vector2 { context.width - 50.f, 50.f }); rectangle.load(&renderer, Vector4 { 230.f, 182.f, 35.f, 255.f }, 64.f, 32.f); - rectangle.body.position = Vector2 { context.width / 3.f, context.height / 2.f }; + rectangle.body.position = Vector2 { context.width / 3.f, context.height - 100.f }; mainLoop.run(update); } diff --git a/frontend/2d/_collisions/rectangle_rectangle/dist/output.wasm b/frontend/2d/_collisions/rectangle_rectangle/dist/output.wasm index a6d85e9..f5eaef0 100755 Binary files a/frontend/2d/_collisions/rectangle_rectangle/dist/output.wasm and b/frontend/2d/_collisions/rectangle_rectangle/dist/output.wasm differ diff --git a/frontend/2d/_collisions/rectangle_rectangle/main.cpp b/frontend/2d/_collisions/rectangle_rectangle/main.cpp index 37cce89..99dafe5 100644 --- a/frontend/2d/_collisions/rectangle_rectangle/main.cpp +++ b/frontend/2d/_collisions/rectangle_rectangle/main.cpp @@ -33,7 +33,7 @@ struct Rigidbody { } void applyGravity(float32 deltaTimeSeconds) { - velocity += (Vector2 { 0.f, -96.f } * deltaTimeSeconds); + velocity += (Vector2 { 0.f, -50.f } * deltaTimeSeconds); } void update(float32 deltaTimeSeconds) { -- cgit v1.2.1