Skip to content

Commit

Permalink
Reduce collision detection range, Readd cursor grab
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueStaggo committed Nov 24, 2024
1 parent 78a7b19 commit e72ca92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VoxelThing.Client/src/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Game : GameWindow
public const int DefaultWindowHeight = ScreenDimensions.VirtualHeight * 2;
public const int TicksPerSecond = 20;
public const double TickRate = 1.0 / TicksPerSecond;
public const bool EnableCursorGrab = false;
public const bool EnableCursorGrab = true;
public const bool OpenGlDebugging = SharedConstants.Debug; // Only enable this if your drivers support OpenGL 4.3+

public static double TimeElapsed => GLFW.GetTime();
Expand Down
12 changes: 6 additions & 6 deletions VoxelThing.Game/src/Worlds/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ public List<Aabb> GetSurroundingCollision(Aabb box)
{
List<Aabb> boxes = [];

int minX = (int)Math.Floor(box.MinX - 1.0);
int minY = (int)Math.Floor(box.MinY - 1.0);
int minZ = (int)Math.Floor(box.MinZ - 1.0);
int maxX = (int)Math.Floor(box.MaxX + 2.0);
int maxY = (int)Math.Floor(box.MaxY + 2.0);
int maxZ = (int)Math.Floor(box.MaxZ + 2.0);
int minX = (int)Math.Floor(box.MinX);
int minY = (int)Math.Floor(box.MinY);
int minZ = (int)Math.Floor(box.MinZ);
int maxX = (int)Math.Ceiling(box.MaxX);
int maxY = (int)Math.Ceiling(box.MaxY);
int maxZ = (int)Math.Ceiling(box.MaxZ);

for (int x = minX; x < maxX; x++)
for (int y = minY; y < maxY; y++)
Expand Down

0 comments on commit e72ca92

Please sign in to comment.