pub struct Camera {
pub position: [f32; 3],
pub right: [f32; 3],
pub down: [f32; 3],
pub forward: [f32; 3],
pub fov_y_rad: f32,
}Expand description
World-space camera state in the voxlap convention (Z = down).
right, down, forward form a right-handed orthonormal basis;
position is in voxel-world units. fov_y_rad is the vertical
field-of-view in radians — voxlap’s default is roughly 60°
(std::f32::consts::FRAC_PI_3).
Fields§
§position: [f32; 3]Eye position in world voxel units (1 voxel = 1 world unit).
right: [f32; 3]Unit basis vector toward screen-right. Must satisfy
right × down == forward (right-handed) or frustum culling
silently rejects sprites.
down: [f32; 3]Unit basis vector toward screen-down. In the voxlap convention
+z points down (z = 0 sky, z = 255 bedrock), so a level camera
has down = [0, 0, 1].
forward: [f32; 3]Unit view direction (into the screen); the third leg of the
right-handed right/down/forward basis.
fov_y_rad: f32Vertical field of view in radians, (0, π). Default is
FRAC_PI_3 (≈60°, voxlap’s default); the horizontal FOV
follows from the render aspect ratio.