Class: LibSL::LLVector4

Inherits:
Object
  • Object
show all
Defined in:
lib/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#aObject

Returns the value of attribute a.



352
353
354
# File 'lib/types.rb', line 352

def a
  @a
end

#bObject

Returns the value of attribute b.



352
353
354
# File 'lib/types.rb', line 352

def b
  @b
end

#cObject

Returns the value of attribute c.



352
353
354
# File 'lib/types.rb', line 352

def c
  @c
end

#dObject

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

#encodeObject



348
349
350
# File 'lib/types.rb', line 348

def encode()
	[@a, @b, @c, @d].pack('e4')
end