class Mittsu::Camera
Attributes
matrix_world_inverse[RW]
projection_matrix[RW]
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/mittsu/cameras/camera.rb, line 5 def initialize super @type = 'Camera' @matrix_world_inverse = Matrix4.new @projection_matrix = Matrix4.new end
Public Instance Methods
clone(camera = Camera.new)
click to toggle source
Calls superclass method
# File lib/mittsu/cameras/camera.rb, line 25 def clone(camera = Camera.new) super camera.matrix_world_inverse.copy(@matrix_world_inverse) camera.projection_matrix.copy(@projection_matrix) camera end
get_world_direction(target = Vector3.new)
click to toggle source
# File lib/mittsu/cameras/camera.rb, line 13 def get_world_direction(target = Vector3.new) @_quaternion ||= Quaternion.new self.get_world_quaternion(@_quaternion) target.set(0.0, 0.0, -1.0).apply_quaternion(@_quaternion) end
look_at(vector)
click to toggle source
# File lib/mittsu/cameras/camera.rb, line 19 def look_at(vector) @_m1 ||= Matrix4.new @_m1.look_at(@position, vector, @up) @quaternion.set_from_rotation_matrix(@_m1) end