Camera

:= []

Builds the Camera that your game puts in Scene.camera. The View type has the same shape as Vocabulary.Camera.

world_up : Vec3

+y, the up that look_at and follow give. To turn the camera over, replace up with a record update.

look_at : Vec3, Vec3 -> View

A View from eye that looks at target, with world_up and default_fov_y.

follow : Vec3, Vec3 -> View

A View that looks at target from target plus offset. Give it the player's position each step, and the camera follows the player.

Vec3 : { x : F32, y : F32, z : F32 }

A point or a direction in 3D. +y is up.

View : { eye : Vec3, target : Vec3, up : Vec3, fov_y : F32 }

Where the eye is, the point it looks at, the up direction and the vertical field of view in radians.