atl/sm/camera
import "atl/sm/camera"The game camera (sm.camera). Reading works anywhere; setters require a scripted state.
Functions
Section titled "Functions"func Position() sm.Vec3func Rotation() sm.Quatfunc Direction() sm.Vec3func Right() sm.Vec3func Up() sm.Vec3The camera's position, rotation and directions.
func Fov() float64func DefaultFov() float64The current and default field of view in degrees.
func DefaultPosition() sm.Vec3func DefaultRotation() sm.QuatThe camera's default position and rotation.
func CurrentState() intThe current state as a number (compare with State values).
func SetState(s State)Switches camera state. Set a scripted state (e.g. CutsceneTP) to control position, rotation and fov; set Default to give control back.
func SetStateByName(name string)Switches camera state by engine name (sm.camera.state[name]), for states not in the enum, e.g. "forcedFP".
func SetPosition(p sm.Vec3)func SetRotation(q sm.Quat)func SetDirection(d sm.Vec3)func SetFov(fov float64)Sets position, rotation, direction or fov while in a scripted state.
func Shake(strength float64)Shakes the camera with the given strength.
func SetPullback(step, seatedStep int)Sets the third person zoom steps (on foot / seated).
func SetSeatLockedPullback(distance float64)func SetSeatLockedUpOffset(offset float64)func SetSeatLockedLocalDirection(d sm.Vec3)func SetSeatLockedLocalUp(up sm.Vec3)Settings for SeatLockedCamera: pullback distance, up offset and local orientation.
func SetUnseatDirection(worldDirection *sm.Vec3)Which way the character faces after leaving the seat (nil for the default).
func SphereCast(radius float64, start, direction sm.Vec3) float64How far a sphere can travel from start along direction before hitting something.
type State intCamera modes (sm.camera.state).
const ( Default State = 1 CutsceneFP State = 2 CutsceneTP State = 3 ForcedTP State = 4 GyroSeatFP State = 5 GyroSeatTP State = 6 ScriptedTP State = 7 SeatLockedCamera State = 8)Pullback
Section titled "Pullback"type Pullback struct { Step, SeatedStep int}Third person zoom steps.
func ReadPullback() PullbackReads the third person zoom steps.