class Prism::Camera

Included Modules

Defined in:

prism/camera.cr

Constructors

Instance Method Summary

Instance methods inherited from module Prism::InputReceiver

input!(tick : RenderLoop::Tick, input : RenderLoop::Input, entity : Crash::Entity) input!

Constructor Detail

def self.new(fov : Angle, aspect : Float32, z_near : Float32, z_far : Float32) #

[View source]
def self.new #

Creates a camera with default values


[View source]

Instance Method Detail

def aspect=(aspect_ratio : Float32) #

changes the aspect ratio


[View source]
def get_projection : Matrix4f #

Returns the projection matrix. This represents the projection of entities on the screen. In other words, things get bigger or smaller as they get closing to the screen or farther away.


[View source]
def input!(tick : RenderLoop::Tick, input : RenderLoop::Input, entity : Crash::Entity) #
Description copied from module Prism::InputReceiver

Receives input events from the InputSubscriber


[View source]
def sync_aspect_ratio=(sync_aspect_ratio : Bool) #

Controls whether or not the camera should automatically sync it's aspect ratio with the window size.


[View source]