begin work on object and array of struct
This commit is contained in:
@@ -4,15 +4,15 @@ pub const Direction = struct {
|
||||
z: i8 = 1,
|
||||
};
|
||||
pub const Point = struct {
|
||||
x: i32,
|
||||
y: i32,
|
||||
z: i32,
|
||||
x: i32 = 0,
|
||||
y: i32 = 0,
|
||||
z: i32 = 0,
|
||||
direction: Direction, //for movement state
|
||||
};
|
||||
pub const Vec3 = struct {
|
||||
a: Point,
|
||||
b: Point,
|
||||
c: Point,
|
||||
a: Point = .{ .x = 0, .y = 0, .z = 0, .direction = .{ .x = 0, .y = 0, .z = 0 } },
|
||||
b: Point = .{ .x = 0, .y = 0, .z = 0, .direction = .{ .x = 0, .y = 0, .z = 0 } },
|
||||
c: Point = .{ .x = 0, .y = 0, .z = 0, .direction = .{ .x = 0, .y = 0, .z = 0 } },
|
||||
};
|
||||
pub const Triangle = struct {
|
||||
bufa: *i32,
|
||||
@@ -29,3 +29,4 @@ pub var vec2 = Vec3{
|
||||
.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 } },
|
||||
};
|
||||
pub var vec3: [10]Vec3 = undefined;
|
||||
|
||||
Reference in New Issue
Block a user