import ../camera
, glm
#[
Currently, shapes can either be ortho, or perspective.
if they are ortho, we merely push the MVP.
so with actions, we just update the mvp.
But what about the camera???
]#
#[ proc rotate2*[T]( t: T
, x: float32
, y: float32
, z: float32 = 0.0
) =
case t.camKind
of Camera_Kind.Perspective:
t.camPersp.rotation += vec3f(x,y,z)
t.camPersp.updateViewMatrix
t.ubo.proj = t.camPersp.matrices.persp
t.ubo.view = t.camPersp.matrices.view
t.ubo.mvp = t.ubo.proj * t.ubo.view * t.ubo.model
t.camPersp.rotation += vec3f(x,y,z)
t.camPersp.updateViewMatrix
t.changed = true
of Camera_Kind.Ortho: discard ]#
proc translate*[T]( t: T
, dt: Vec3[float32]
) =
t.camera.pos += dt
t.camera.updated = true
t.camera.updateViewMatrix()
t.changed = true