Bad collisions
This commit is contained in:
16
src/Game.zig
16
src/Game.zig
@@ -56,7 +56,7 @@ player: Player,
|
||||
const max_textures = 1024;
|
||||
const max_point_lights = 1024;
|
||||
const max_directional_lights = 4;
|
||||
const chunk_descriptor_pool = 512;
|
||||
const chunk_descriptor_pool = 1024;
|
||||
|
||||
const camera_near_plane = 0.1;
|
||||
|
||||
@@ -180,25 +180,25 @@ pub fn init(allocator: std.mem.Allocator, engine: *Engine, swapchain: *Swapchain
|
||||
try vertex_buffer.write(engine, .{
|
||||
.elements = &.{
|
||||
.init(
|
||||
.init(-0.5, -0.5, 0),
|
||||
.init(0, 0, 0),
|
||||
.init(0, 1),
|
||||
.init(0, 0, 1),
|
||||
.init(1, 0, 0, -1),
|
||||
),
|
||||
.init(
|
||||
.init(0.5, -0.5, 0),
|
||||
.init(1, 0, 0),
|
||||
.init(1, 1),
|
||||
.init(0, 0, 1),
|
||||
.init(1, 0, 0, -1),
|
||||
),
|
||||
.init(
|
||||
.init(-0.5, 0.5, 0),
|
||||
.init(0, 1, 0),
|
||||
.init(0, 0),
|
||||
.init(0, 0, 1),
|
||||
.init(1, 0, 0, -1),
|
||||
),
|
||||
.init(
|
||||
.init(0.5, 0.5, 0),
|
||||
.init(1, 1, 0),
|
||||
.init(1, 0),
|
||||
.init(0, 0, 1),
|
||||
.init(1, 0, 0, -1),
|
||||
@@ -534,8 +534,8 @@ pub fn init(allocator: std.mem.Allocator, engine: *Engine, swapchain: *Swapchain
|
||||
const world_seed = engine.random.int(u64);
|
||||
std.log.info("Using world seed 0x{x:0<16}", .{world_seed});
|
||||
var it = Iterator2(i16).init(.{
|
||||
.min = .{ -8, -8 },
|
||||
.max = .{ 7, 7 },
|
||||
.min = .{ -12, -12 },
|
||||
.max = .{ 12, 12 },
|
||||
});
|
||||
while (it.next()) |chunk_coords2| {
|
||||
const chunk_coords3 = chunk_coords2 ++ [_]i16{0};
|
||||
@@ -697,7 +697,7 @@ pub fn deinit(self: *Game) void {
|
||||
}
|
||||
|
||||
pub fn update(self: *Game, dt: f32) void {
|
||||
self.player.update(dt);
|
||||
self.player.update(dt, &self.chunks);
|
||||
|
||||
self.render() catch |err| {
|
||||
std.log.err("Failed to render: {s}", .{@errorName(err)});
|
||||
|
||||
Reference in New Issue
Block a user