Class: LibSL::LLVector4
- Inherits:
-
Object
- Object
- LibSL::LLVector4
- Defined in:
- lib/types.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
Returns the value of attribute a.
-
#b ⇒ Object
Returns the value of attribute b.
-
#c ⇒ Object
Returns the value of attribute c.
-
#d ⇒ Object
Returns the value of attribute d.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(a, b, c, d) ⇒ LLVector4
constructor
A new instance of LLVector4.
Constructor Details
#initialize(a, b, c, d) ⇒ LLVector4
Returns a new instance of LLVector4.
353 354 355 |
# File 'lib/types.rb', line 353 def initialize(a, b, c, d) @a, @b, @c, @d = a, b, c, d end |
Instance Attribute Details
#a ⇒ Object
Returns the value of attribute a.
352 353 354 |
# File 'lib/types.rb', line 352 def a @a end |
#b ⇒ Object
Returns the value of attribute b.
352 353 354 |
# File 'lib/types.rb', line 352 def b @b end |
#c ⇒ Object
Returns the value of attribute c.
352 353 354 |
# File 'lib/types.rb', line 352 def c @c end |
#d ⇒ Object
Returns the value of attribute d.
352 353 354 |
# File 'lib/types.rb', line 352 def d @d end |
Class Method Details
.decode(data) ⇒ Object
343 344 345 346 |
# File 'lib/types.rb', line 343 def self.decode(data) data = data.unpack('e4a*') return self.new(data[0], data[1], data[2], data[3]), data[4] end |
Instance Method Details
#encode ⇒ Object
348 349 350 |
# File 'lib/types.rb', line 348 def encode() [@a, @b, @c, @d].pack('e4') end |