struct Rosegold::Look

Overview

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.

Defined in:

rosegold/world/look.cr

Constant Summary

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

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(yaw : Float32, pitch : Float32) #

[View source]

Class Method Detail

def self.from_rad(yaw_rad : Float32, pitch_rad : Float32) #

[View source]
def self.from_vec(vec : Vec3d | Vec3f) #

[View source]

Instance Method Detail

def down(angle : Float32 = 90) #

[View source]
def inspect(io) #

[View source]
def pitch : Float32 #

[View source]
def pitch_rad #

[View source]
def to_vec3 #

[View source]
def up(angle : Float32 = 90) #

[View source]
def with_pitch(pitch : Float32) #

[View source]
def with_pitch(pitch : Float64) #

[View source]
def with_yaw(yaw : Float32) #

[View source]
def with_yaw(yaw : Float64) #

[View source]
def yaw : Float32 #

[View source]
def yaw_rad #

[View source]