Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Camera

cinnabar:extension/camera@0.1.0

Opt-in local camera policy; requires the explicit camera grant.

Grants: camera.

Types

view-tilt

Degrees, each at most MAX_VIEW_TILT_DEGREES, added to the first-person view where the native damage shake applies; suppress-hurt-shake removes that shake. Positive pitch turns the view up. Positive roll turns it the way a native shake without direction does: the view’s right edge rises, so the world appears to turn clockwise. A native shake of angle a from hurt direction d is approximately roll a cos d and pitch -a sin d. Death rotation, view bob, look and movement are unchanged.

record view-tilt {
    roll: f32,
    pitch: f32,
    suppress-hurt-shake: bool,
}
MemberTypeDescription
rollf32
pitchf32
suppress-hurt-shakebool

damage-shake

The native damage shake of the local player’s last presented view, at full strength: before the player’s damage-shake setting, any mod view-tilt, or suppression. Degrees, using the view-tilt sign convention: a tilt of these angles that suppresses the native shake presents the same view. None while no shake is active, in third person, or outside gameplay. Like a tilt, it continues while a menu owns input.

record damage-shake {
    roll: f32,
    pitch: f32,
}
MemberTypeDescription
rollf32
pitchf32

Functions

set-view-tilt

set-view-tilt: func(tilt: option<view-tilt>) -> result<_, string>;

Current frame only, including while a menu owns input. None, omission, unload and failed callbacks restore the native view.

Types: view-tilt.

set-preserve-teleport-rotation

set-preserve-teleport-rotation: func(enabled: bool) -> result<_, string>;

Renew every frame. Only actual teleports preserve yaw/pitch; position and acknowledgments remain unchanged. Omission, no gameplay frame, or a failed callback restores server rotation.

set-view-scale

set-view-scale: func(fov-scale: f32, look-scale: f32) -> result<_, string>;

Current-frame FOV and look multipliers, independently bounded to 0.1..1 and 0.05..1. Renew only during focused, input-owned gameplay; 1/1 restores the player’s view. Omission, UI focus, unload, and failed callbacks restore both scales without changing saved settings or perspective.

read-damage-shake

read-damage-shake: func() -> result<option<damage-shake>, string>;

Requires the camera grant.

Types: damage-shake.