diff options
| author | Ray <[email protected]> | 2019-05-14 17:57:45 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-14 17:57:45 +0200 |
| commit | 5a27bcaf7115e46a5123e9857007d940998f0650 (patch) | |
| tree | 7179c6a1b4d700c9685dd51cc76cb2b2c90b9609 /examples/src/physac/physics_restitution.c | |
| parent | 423fdd699225ee9686c44a606bf83272b4c77802 (diff) | |
| download | raylib.com-5a27bcaf7115e46a5123e9857007d940998f0650.tar.gz raylib.com-5a27bcaf7115e46a5123e9857007d940998f0650.zip | |
Review examples collection -WIP-
WARNING: Examples list has been reviewed but examples haven't been recompiled yet... that's not trivial...
Diffstat (limited to 'examples/src/physac/physics_restitution.c')
| -rw-r--r-- | examples/src/physac/physics_restitution.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/src/physac/physics_restitution.c b/examples/src/physac/physics_restitution.c index 2be8f42..3231d0c 100644 --- a/examples/src/physac/physics_restitution.c +++ b/examples/src/physac/physics_restitution.c @@ -7,16 +7,18 @@ * * Use the following line to compile: * -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread -* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition +* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static / +* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm / +* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -* Copyright (c) 2017 Victor Fisac +* Copyright (c) 2016-2018 Victor Fisac * ********************************************************************************************/ #include "raylib.h" #define PHYSAC_IMPLEMENTATION +#define PHYSAC_NO_THREADS #include "physac.h" int main() @@ -50,6 +52,9 @@ int main() circleC->restitution = 1; SetTargetFPS(60); + + // Restitution demo needs a very tiny physics time step for a proper simulation + SetPhysicsTimeStep(1.0/60.0/100 * 1000); //-------------------------------------------------------------------------------------- // Main game loop @@ -57,6 +62,8 @@ int main() { // Update //---------------------------------------------------------------------------------- + RunPhysicsStep(); + if (IsKeyPressed('R')) // Reset physics input { // Reset circles physics bodies position and velocity @@ -120,4 +127,3 @@ int main() return 0; } - |
