format
This commit is contained in:
parent
c0d5ea7f2f
commit
858402c6e0
1 changed files with 15 additions and 19 deletions
34
main.odin
34
main.odin
|
@ -39,9 +39,9 @@ draw :: proc(mdl: model.Model) {
|
|||
}
|
||||
|
||||
Object :: struct {
|
||||
model: model.Model,
|
||||
model: model.Model,
|
||||
transform: glm.mat4,
|
||||
update: proc(self: ^Object)
|
||||
update: proc(self: ^Object),
|
||||
}
|
||||
|
||||
Scene :: struct {
|
||||
|
@ -164,25 +164,21 @@ main :: proc() {
|
|||
kart := maybe_kart.?
|
||||
|
||||
scene: Scene
|
||||
append(
|
||||
&scene.objects,
|
||||
Object {
|
||||
model = sponza,
|
||||
update = proc(self: ^Object) {
|
||||
self.transform = glm.mat4Rotate({0, 1, 0}, f32(glfw.GetTime()) / 10) * glm.mat4Scale(glm.vec3(0.1))
|
||||
}
|
||||
append(&scene.objects, Object {
|
||||
model = sponza,
|
||||
update = proc(self: ^Object) {
|
||||
self.transform =
|
||||
glm.mat4Rotate({0, 1, 0}, f32(glfw.GetTime()) / 10) * glm.mat4Scale(glm.vec3(0.1))
|
||||
},
|
||||
)
|
||||
|
||||
append(
|
||||
&scene.objects,
|
||||
Object {
|
||||
model = kart,
|
||||
update = proc(self: ^Object) {
|
||||
self.transform = glm.mat4Rotate({0, 1, 0}, f32(glfw.GetTime()) / 10) * glm.mat4Translate({-1, 1, 0})
|
||||
}
|
||||
})
|
||||
|
||||
append(&scene.objects, Object {
|
||||
model = kart,
|
||||
update = proc(self: ^Object) {
|
||||
self.transform =
|
||||
glm.mat4Rotate({0, 1, 0}, f32(glfw.GetTime()) / 10) * glm.mat4Translate({-1, 1, 0})
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
prev_time: f64 = 0
|
||||
frame_times := make([dynamic]f64, 100)
|
||||
|
|
Loading…
Add table
Reference in a new issue