@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.
40 lines • 1.32 kB
JavaScript
// automatically generated by the FlatBuffers compiler, do not modify
import { Vec3 } from './vec3.js';
export class Transform {
bb = null;
bb_pos = 0;
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
position(obj) {
return (obj || new Vec3()).__init(this.bb_pos, this.bb);
}
rotation(obj) {
return (obj || new Vec3()).__init(this.bb_pos + 12, this.bb);
}
scale(obj) {
return (obj || new Vec3()).__init(this.bb_pos + 24, this.bb);
}
static sizeOf() {
return 36;
}
static createTransform(builder, position_x, position_y, position_z, rotation_x, rotation_y, rotation_z, scale_x, scale_y, scale_z) {
builder.prep(4, 36);
builder.prep(4, 12);
builder.writeFloat32(scale_z);
builder.writeFloat32(scale_y);
builder.writeFloat32(scale_x);
builder.prep(4, 12);
builder.writeFloat32(rotation_z);
builder.writeFloat32(rotation_y);
builder.writeFloat32(rotation_x);
builder.prep(4, 12);
builder.writeFloat32(position_z);
builder.writeFloat32(position_y);
builder.writeFloat32(position_x);
return builder.offset();
}
}
//# sourceMappingURL=transform.js.map