Class: Rgltf::Camera::Perspective
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Camera::Perspective
- Defined in:
- lib/rgltf/properties/camera.rb
Instance Attribute Summary collapse
-
#aspect_ratio ⇒ Object
readonly
Returns the value of attribute aspect_ratio.
-
#yfov ⇒ Object
readonly
Returns the value of attribute yfov.
-
#zfar ⇒ Object
readonly
Returns the value of attribute zfar.
-
#znear ⇒ Object
readonly
Returns the value of attribute znear.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:) ⇒ Perspective
constructor
A new instance of Perspective.
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:) ⇒ Perspective
Returns a new instance of Perspective.
29 30 31 32 33 34 35 |
# File 'lib/rgltf/properties/camera.rb', line 29 def initialize(json, document:) super(json, document:, owner_type: :camera_perspective) @aspect_ratio = json['aspectRatio'] @yfov = json.fetch('yfov') @zfar = json['zfar'] @znear = json.fetch('znear') end |
Instance Attribute Details
#aspect_ratio ⇒ Object (readonly)
Returns the value of attribute aspect_ratio.
27 28 29 |
# File 'lib/rgltf/properties/camera.rb', line 27 def aspect_ratio @aspect_ratio end |
#yfov ⇒ Object (readonly)
Returns the value of attribute yfov.
27 28 29 |
# File 'lib/rgltf/properties/camera.rb', line 27 def yfov @yfov end |
#zfar ⇒ Object (readonly)
Returns the value of attribute zfar.
27 28 29 |
# File 'lib/rgltf/properties/camera.rb', line 27 def zfar @zfar end |
#znear ⇒ Object (readonly)
Returns the value of attribute znear.
27 28 29 |
# File 'lib/rgltf/properties/camera.rb', line 27 def znear @znear end |