Class: Rgltf::Animation::Channel::Target

Inherits:
Properties::Base show all
Defined in:
lib/rgltf/properties/animation.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:, animation_index:, channel_index:) ⇒ Target

Returns a new instance of Target.

Raises:



50
51
52
53
54
55
56
57
58
# File 'lib/rgltf/properties/animation.rb', line 50

def initialize(json, document:, animation_index:, channel_index:)
  super(json, document:, owner_type: :animation_target)
  @node = optional_node(json['node'], document, animation_index, channel_index)
  @path = json.fetch('path').to_sym
  return if Channel::TARGET_PATHS.include?(json['path']) && node
  return if animation_pointer?(json)

  raise FormatError, "invalid animation target #{json.inspect}"
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



48
49
50
# File 'lib/rgltf/properties/animation.rb', line 48

def node
  @node
end

#pathObject (readonly)

Returns the value of attribute path.



48
49
50
# File 'lib/rgltf/properties/animation.rb', line 48

def path
  @path
end