Class: LibSL::LLVector3

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

Direct Known Subclasses

LLVector3d

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, z) ⇒ LLVector3

Returns a new instance of LLVector3.



326
327
328
# File 'lib/types.rb', line 326

def initialize(x, y, z)
	@x, @y, @z = x, y, z
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



325
326
327
# File 'lib/types.rb', line 325

def x
  @x
end

#yObject

Returns the value of attribute y.



325
326
327
# File 'lib/types.rb', line 325

def y
  @y
end

#zObject

Returns the value of attribute z.



325
326
327
# File 'lib/types.rb', line 325

def z
  @z
end

Class Method Details

.decode(data) ⇒ Object



316
317
318
319
# File 'lib/types.rb', line 316

def self.decode(data)
	data = data.unpack('e3a*')
	return self.new(data[0], data[1], data[2]), data[3]
end

Instance Method Details

#encodeObject



321
322
323
# File 'lib/types.rb', line 321

def encode()
	[@x, @y, @z].pack('e3')
end