No matching definitions.

raylib/camera

src/raylib/camera.tur
defn

camera-3d

(camera-3d [px :float py :float pz :float tx :float ty :float tz :float ux :float uy :float uz :float fovy :float proj :int] :int)

construct a 3D perspective or orthographic camera.

px py pz -- camera position (world space)
tx ty tz -- camera target / look-at point (world space)
ux uy uz -- up vector (usually 0 1 0)
fovyvertical field of view in degrees (ignored in ortho mode)
projprojection mode (0=PERSPECTIVE 1=ORTHOGRAPHIC)

Opaque :int handle to a heap-allocated Camera3D struct.

(let [cam (camera-3d 0.0 10.0 10.0
                       0.0  0.0  0.0
                       0.0  1.0  0.0
                       45.0 0)]
    ...)

Since: P3

defn

camera-2d

(camera-2d [ox :float oy :float tx :float ty :float rotation :float zoom :float] :int)

construct a 2D camera with offset, target, rotation, and zoom.

ox oy -- viewport offset (pixels, usually screen-center for centering)
tx ty -- camera target in world space
rotationrotation in degrees
zoomzoom factor (1.0 = no zoom)

Opaque :int handle to a heap-allocated Camera2D struct.

(let [cam (camera-2d 400.0 300.0 0.0 0.0 0.0 1.0)] ...)

Since: P3

defn

update-camera

(update-camera [camera :int mode :int] :void)

update a camera's position and orientation each frame.

cameraCamera3D handle to update in place
modecamera movement mode (see file header for constants)
(update-camera cam 1)  ; 1 = CAMERA_FREE

Since: P3