2020-04-30 00:20:08 +02:00
|
|
|
module main
|
|
|
|
|
2020-04-30 14:02:14 +02:00
|
|
|
// Object bit
|
|
|
|
// size: 10x10x10 (?)
|
|
|
|
//
|
|
|
|
// XXX cannot be compound?
|
|
|
|
struct ObjectBit {
|
|
|
|
elem_type ElemType
|
|
|
|
}
|
|
|
|
|
2020-04-30 00:20:08 +02:00
|
|
|
struct Object {
|
|
|
|
mut:
|
|
|
|
name string
|
2020-04-30 00:34:02 +02:00
|
|
|
dim_x int // Approx.
|
2020-04-30 00:20:08 +02:00
|
|
|
dim_y int
|
|
|
|
dim_z int
|
|
|
|
elem &Elem // XXX use id/enum
|
|
|
|
|
|
|
|
// Position in the world
|
2020-04-30 11:05:32 +02:00
|
|
|
//pos_x int
|
|
|
|
//pos_y int
|
|
|
|
//pos_z int
|
|
|
|
|
|
|
|
// Flixible position in the world
|
|
|
|
transform &Transform
|
2020-04-30 14:02:14 +02:00
|
|
|
|
|
|
|
// Bits of object's voxel model
|
|
|
|
//bits [10][10]ObjectBit
|
2020-04-30 00:20:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn new_object() &Object {
|
2020-04-30 11:05:32 +02:00
|
|
|
o := &Object{
|
2020-09-05 13:06:27 +02:00
|
|
|
elem: &Elem(0),
|
2020-04-30 11:05:32 +02:00
|
|
|
transform: new_transform(),
|
|
|
|
}
|
2020-04-30 00:20:08 +02:00
|
|
|
return o
|
|
|
|
}
|