Class: Camera3

Inherits:
CameraBase show all
Includes:
Movable3
Defined in:
lib/moon/packages/twod/camera3.rb

Overview

3D Point Camera

Instance Attribute Summary collapse

Attributes inherited from CameraBase

#obj, #speed, #ticks, #view

Instance Method Summary collapse

Methods included from Movable3

#backward, #down, #forward, #left, #move_distance, #moveto, #right, #up

Methods inherited from CameraBase

#follow, #screen_to_world, #screen_to_world_reduce, #update, #velocity, #world_to_screen

Methods included from Moon::Transitionable

#key_transition, #remove_transitions, #transition

Methods included from Moon::TransitionHost

#add_transition, #finish_transitions, #remove_transition, #remove_transitions, #update_transitions

Instance Attribute Details

#positionMoon::Vector3

Returns:


8
# File 'lib/moon/packages/twod/camera3.rb', line 8

field :position, type: Moon::Vector3, default: proc{ |t| t.model.new }

#tilesizeMoon::Vector3

Returns:


11
# File 'lib/moon/packages/twod/camera3.rb', line 11

field :tilesize, type: Moon::Vector3, default: proc{ |t| t.model.new(32, 32, 32) }

Instance Method Details

#view_offsetMoon::Vector3

Returns the point offset in a 3D space

Returns:


17
18
19
# File 'lib/moon/packages/twod/camera3.rb', line 17

def view_offset
  @position + Moon::Vector3[@view.position, 0]
end