struct

Rosegold::Look

Inherits Struct / Value / Object

The unit circle of yaw on the XZ-plane has 0° at (0, 1), 90° at (-1, 0), 180° at (0, -1) and 270° at (1, 0).

Yaw is not clamped to between 0° and 360°; any number is valid, including negative numbers and numbers greater than 360°.

Pitch 0 is looking straight ahead, -90° is looking straight up, and 90° is looking straight down.

There are an infinite number of "down"/"up" looks with different yaw; use e.g. NORTH.down.

Constants

EAST = self.new(270, 0)
NORTH = self.new(180, 0)
SOUTH = self.new(0, 0)
WEST = self.new(90, 0)

Constructors

new(yaw : Float32, pitch : Float32)
Source

Class methods

from_rad(yaw_rad : Float32, pitch_rad : Float32)
Source
from_vec(vec : Vec3d | Vec3f)
Source

Instance methods

down(angle : Float32 = 90)
Source
inspect(io)
Source
pitch
Source
pitch_rad
Source
to_vec3
Source
up(angle : Float32 = 90)
Source
with_pitch(pitch : Float32)
Source
with_pitch(pitch : Float64)
Source
with_yaw(yaw : Float32)
Source
with_yaw(yaw : Float64)
Source
yaw_rad
Source