Skip to content

Commit

Permalink
Update examples/src/cows.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeokkim committed Nov 28, 2023
1 parent 8a0f605 commit 0bde9cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions examples/src/cows.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ static void InitExample(void) {

SetMousePosition(0.5f * SCREEN_WIDTH, 0.5f * SCREEN_HEIGHT);

world = frCreateWorld(frVector2ScalarMultiply(FR_WORLD_DEFAULT_GRAVITY,
0.0f),
CELL_SIZE);
world = frCreateWorld(FR_API_STRUCT_ZERO(frVector2), CELL_SIZE);

frSetWorldCollisionHandler(world,
(frCollisionHandler) {
Expand Down
13 changes: 6 additions & 7 deletions examples/src/raycast.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ static void InitExample(void) {
: GetRandomValue(0.53f * SCREEN_HEIGHT, SCREEN_HEIGHT)
};

frBody *object =
frBody *body =
frCreateBodyFromShape(FR_BODY_STATIC,
frVector2PixelsToUnits(position),
frCreateCircle(FR_API_STRUCT_ZERO(frMaterial),
0.22f * GetRandomValue(2, 4)));

frAddBodyToWorld(world, object);
frAddBodyToWorld(world, body);
}
}

Expand Down Expand Up @@ -186,11 +186,10 @@ static void UpdateExample(void) {

const int bodyCount = frGetBodyCountForWorld(world);

for (int i = 1; i < bodyCount; i++) {
frBody *object = frGetBodyFromWorld(world, i);

frDrawBodyLines(object, 2.0f, ColorAlpha(LIGHTGRAY, 0.95f));
}
for (int i = 1; i < bodyCount; i++)
frDrawBodyLines(frGetBodyFromWorld(world, i),
2.0f,
ColorAlpha(LIGHTGRAY, 0.95f));

frComputeRaycastForWorld(world, ray, OnRaycastQuery);

Expand Down

0 comments on commit 0bde9cb

Please sign in to comment.