@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
67 lines • 2.57 kB
JavaScript
// automatically generated by the FlatBuffers compiler, do not modify
import * as flatbuffers from 'flatbuffers';
import { Transform } from './transform.js';
export class SyncedTransformModel {
bb = null;
bb_pos = 0;
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsSyncedTransformModel(bb, obj) {
return (obj || new SyncedTransformModel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsSyncedTransformModel(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new SyncedTransformModel()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
guid(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
/**
* if the transform interpolation should be fast, this is true when the send interval is low and we want to have snappy transforms
*/
fast() {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
transform(obj) {
const offset = this.bb.__offset(this.bb_pos, 8);
return offset ? (obj || new Transform()).__init(this.bb_pos + offset, this.bb) : null;
}
/**
* if the server should not save this info
*/
dontSave() {
const offset = this.bb.__offset(this.bb_pos, 10);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
static startSyncedTransformModel(builder) {
builder.startObject(4);
}
static addGuid(builder, guidOffset) {
builder.addFieldOffset(0, guidOffset, 0);
}
static addFast(builder, fast) {
builder.addFieldInt8(1, +fast, +false);
}
static addTransform(builder, transformOffset) {
builder.addFieldStruct(2, transformOffset, 0);
}
static addDontSave(builder, dontSave) {
builder.addFieldInt8(3, +dontSave, +false);
}
static endSyncedTransformModel(builder) {
const offset = builder.endObject();
return offset;
}
static finishSyncedTransformModelBuffer(builder, offset) {
builder.finish(offset);
}
static finishSizePrefixedSyncedTransformModelBuffer(builder, offset) {
builder.finish(offset, undefined, true);
}
}
//# sourceMappingURL=synced-transform-model.js.map