Class: Google::Apis::PolyV1::Quaternion

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/poly_v1/classes.rb,
generated/google/apis/poly_v1/representations.rb,
generated/google/apis/poly_v1/representations.rb

Overview

A Quaternion. Please note: if in the response you see "w: 1" and nothing else this is the default value of [0, 0, 0, 1] where x,y, and z are 0.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Quaternion

Returns a new instance of Quaternion



528
529
530
# File 'generated/google/apis/poly_v1/classes.rb', line 528

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#wFloat

The scalar component. Corresponds to the JSON property w

Returns:

  • (Float)


511
512
513
# File 'generated/google/apis/poly_v1/classes.rb', line 511

def w
  @w
end

#xFloat

The x component. Corresponds to the JSON property x

Returns:

  • (Float)


516
517
518
# File 'generated/google/apis/poly_v1/classes.rb', line 516

def x
  @x
end

#yFloat

The y component. Corresponds to the JSON property y

Returns:

  • (Float)


521
522
523
# File 'generated/google/apis/poly_v1/classes.rb', line 521

def y
  @y
end

#zFloat

The z component. Corresponds to the JSON property z

Returns:

  • (Float)


526
527
528
# File 'generated/google/apis/poly_v1/classes.rb', line 526

def z
  @z
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



533
534
535
536
537
538
# File 'generated/google/apis/poly_v1/classes.rb', line 533

def update!(**args)
  @w = args[:w] if args.key?(:w)
  @x = args[:x] if args.key?(:x)
  @y = args[:y] if args.key?(:y)
  @z = args[:z] if args.key?(:z)
end