splitt up definitions

This commit is contained in:
jonathan santis
2024-10-29 11:47:39 +01:00
parent 039cc7e912
commit 1d82a2cf42
2 changed files with 51 additions and 51 deletions

31
primitives.zig Normal file
View File

@@ -0,0 +1,31 @@
pub const Direction = struct {
x: i8 = 1,
y: i8 = 1,
z: i8 = 1,
};
pub const Point = struct {
x: i32,
y: i32,
z: i32,
direction: Direction, //for movement state
};
pub const Vec3 = struct {
a: Point,
b: Point,
c: Point,
};
pub const Triangle = struct {
bufa: *i32,
bufb: *i32,
bufc: *i32,
};
pub var vec = Vec3{
.a = Point{ .x = 20, .y = 30, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
.b = Point{ .x = 50, .y = 40, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
.c = Point{ .x = 30, .y = 1, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
};
pub var vec2 = Vec3{
.a = Point{ .x = 20, .y = 20, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
.b = Point{ .x = 50, .y = 30, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
.c = Point{ .x = 30, .y = 1, .z = 0, .direction = .{ .x = 1, .y = 1, .z = 1 } },
};