- Mesh upload support
- LLMesh asset decoding and encoding (inc. LLPhysicsConvex, LLSkin, LLSubMesh) - Query inventory folder by type - onSelectedObject event - fetchInventoryItem command - Fix packing/unpacking of object shape - Time sync with SimulatorViewerTimeMessage - Changed several classes to a .from style rather than setting up in the constructor (exception friendly) - Whole bunch of other improvements - Object building
This commit is contained in:
@@ -56,9 +56,16 @@ export class Vector3 extends vec3
|
||||
return false;
|
||||
}
|
||||
|
||||
constructor(buf?: Buffer | number[] | Vector3, pos?: number, double?: boolean)
|
||||
constructor(buf?: Buffer | number[] | Vector3 | vec3, pos?: number, double?: boolean)
|
||||
{
|
||||
if (buf instanceof Vector3)
|
||||
if (buf instanceof vec3)
|
||||
{
|
||||
super();
|
||||
this.x = buf.x;
|
||||
this.y = buf.y;
|
||||
this.z = buf.z;
|
||||
}
|
||||
else if (buf instanceof Vector3)
|
||||
{
|
||||
super();
|
||||
this.x = buf.x;
|
||||
@@ -117,6 +124,18 @@ export class Vector3 extends vec3
|
||||
{
|
||||
return '<' + this.x + ', ' + this.y + ', ' + this.z + '>';
|
||||
}
|
||||
|
||||
|
||||
getBuffer(double: boolean = false): Buffer
|
||||
{
|
||||
const buf = Buffer.allocUnsafe((double) ? 24 : 12);
|
||||
this.writeToBuffer(buf, 0, double);
|
||||
return buf;
|
||||
}
|
||||
compareApprox(vec: Vector3)
|
||||
{
|
||||
return vec.equals(this, 0.00001);
|
||||
}
|
||||
toArray()
|
||||
{
|
||||
return [this.x, this.y, this.z];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user