class Prism::Transform

Overview

Handles positional transformations

Included Modules

Defined in:

prism/transform.cr:6
prism/transform.cr:70

Constructors

Instance Method Summary

Instance methods inherited from module Prism::Maths

barry_centric_weight(p1 : Vector3f, p2 : Vector3f, p3 : Vector3f, pos : Vector2f) : Float32 barry_centric_weight, to_rad(degree : Float32) : Float32 to_rad

Constructor Detail

def self.new(x : Float32, y : Float32, z : Float32) #

[View source]
def self.new #

[View source]

Instance Method Detail

def elevate_by(amount : Float32) #

Changes the object's elevation by the distance


[View source]
def elevate_to(position : Float32) #

Elevates the object to the exact position


[View source]
def get_look_at_direction(point : Vector3f, up : Vector3f) : Quaternion #

Creates a transformation to look at a point This is handy for applying some form of lerp'ing.


[View source]
def get_transformation : Matrix4f #

Returns the transformation


[View source]
def look_at(point : Vector3f, up : Vector3f) #

Rotates to look at the point


[View source]
def look_at(transform : Prism::Transform) #

Rotates to look at the transform


[View source]
def look_at(object : Prism::Entity) #

Rotates to look at the object


[View source]
def move_east(distance : Float32) #

Moves the shape towards east by the distance


[View source]
def move_north(distance : Float32) #

Moves the shape towards north by the distance


[View source]
def move_south(distance : Float32) #

[View source]
def move_to(x : Float32, y : Float32, z : Float32) #

[View source]
def move_to(entity : Crash::Entity) #

[View source]
def move_west(distance : Float32) #

[View source]

[View source]
def pos=(pos : Prism::Maths::Vector3f) #

[View source]

[View source]
def rot=(rot : Prism::Maths::Quaternion) #

[View source]
def rotate(axis : Vector3f, angle : Float32) #

[View source]
def rotate_x_axis(angle : Angle) #

Rotates the shape around the x-axis


[View source]
def rotate_y_axis(angle : Angle) #

Rotates the shape around the y-axis


[View source]
def rotate_z_axis(angle : Angle) #

Rotates the shape around the z-axis


[View source]
def scale(factor : Float32) #

[View source]

[View source]
def scale=(scale : Prism::Maths::Vector3f) #

[View source]