Class: Rgltf::Camera::Perspective

Inherits:
Properties::Base show all
Defined in:
lib/rgltf/properties/camera.rb

Instance Attribute Summary collapse

Attributes inherited from Properties::Base

#extensions, #extras, #index, #name, #owner_type, #source_json

Instance Method Summary collapse

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_ratioObject (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

#yfovObject (readonly)

Returns the value of attribute yfov.



27
28
29
# File 'lib/rgltf/properties/camera.rb', line 27

def yfov
  @yfov
end

#zfarObject (readonly)

Returns the value of attribute zfar.



27
28
29
# File 'lib/rgltf/properties/camera.rb', line 27

def zfar
  @zfar
end

#znearObject (readonly)

Returns the value of attribute znear.



27
28
29
# File 'lib/rgltf/properties/camera.rb', line 27

def znear
  @znear
end