Class: MagicaVoxel::Camera
Overview
The Chunk type rCAM
Constant Summary
Constants inherited from Chunk
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
- #id ⇒ Object readonly
Instance Method Summary collapse
-
#angle ⇒ MagicalVoxel::Vector3
Angle.
-
#focus ⇒ MagicalVoxel::Vector3
Focus.
-
#fov ⇒ Number
Field of View.
-
#frustum ⇒ Number
Frustum.
-
#inspect ⇒ Object
:nodoc:.
-
#mode ⇒ String
Mode.
-
#radius ⇒ Number
Radius.
Methods inherited from Chunk
#each, header, #initialize, read
Constructor Details
This class inherits a constructor from MagicaVoxel::Chunk
Instance Attribute Details
#attributes ⇒ Object (readonly)
9 10 11 |
# File 'lib/magica_voxel/camera.rb', line 9 def attributes @attributes end |
Instance Method Details
#angle ⇒ MagicalVoxel::Vector3
Angle
34 35 36 |
# File 'lib/magica_voxel/camera.rb', line 34 def angle @angle ||= Vector3.new(*@attributes['_angle'].split.map(&:to_f)) end |
#focus ⇒ MagicalVoxel::Vector3
Focus
25 26 27 |
# File 'lib/magica_voxel/camera.rb', line 25 def focus @focus ||= Vector3.new(*@attributes['_focus'].split.map(&:to_f)) end |
#fov ⇒ Number
Field of View
61 62 63 |
# File 'lib/magica_voxel/camera.rb', line 61 def fov @fov ||= @attributes['_fov'].to_i end |
#frustum ⇒ Number
Frustum
52 53 54 |
# File 'lib/magica_voxel/camera.rb', line 52 def frustum @frustum ||= @attributes['_frustum'].to_f end |
#inspect ⇒ Object
:nodoc:
68 69 70 71 72 73 |
# File 'lib/magica_voxel/camera.rb', line 68 def inspect "#<MagicaVoxel::Camera id=#{id}, mode=#{mode}, " \ "focus=#{focus}, angle=#{angle}, " \ "radius=#{radius}, frustum=#{frustum}, " \ "fov=#{fov}>" end |
#mode ⇒ String
Mode
16 17 18 |
# File 'lib/magica_voxel/camera.rb', line 16 def mode @attributes['_mode'] end |
#radius ⇒ Number
Radius
43 44 45 |
# File 'lib/magica_voxel/camera.rb', line 43 def radius @radius ||= @attributes['_radius'].to_i end |