Files
node-metaverse/lib/classes/public/MeshData.ts
Casper Warden 76b080757b - 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
2018-11-15 03:22:07 +00:00

33 lines
847 B
TypeScript

import {UUID} from '../UUID';
import {SculptType} from '../..';
export class MeshData
{
meshData: UUID = UUID.zero();
type: SculptType = SculptType.None;
constructor(buf?: Buffer, pos?: number, length?: number)
{
if (buf !== undefined && pos !== undefined && length !== undefined)
{
if (length >= 17)
{
this.meshData = new UUID(buf, pos);
pos += 16;
this.type = buf.readUInt8(pos);
}
}
}
writeToBuffer(buf: Buffer, pos: number)
{
this.meshData.writeToBuffer(buf, pos); pos = pos + 16;
buf.writeUInt8(this.type, pos);
}
getBuffer(): Buffer
{
const buf = Buffer.allocUnsafe(17);
this.writeToBuffer(buf, 0);
return buf;
}
}