rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
86 lines • 2.33 kB
JavaScript
import { ATypedArrayTuple } from "../a-typed-array-tuple.js";
import { getVec3Ctor } from "./get-vec3-ctor.js";
import { populateTypedArrayConstructorMap } from "../../../runtime/rtti-interop.js";
/**
* @public
* Vector 3.
*
* @remarks
* See static properties for constructors. Instances are not an extension of this class, but of the static members.
*/
export class Vec3 extends ATypedArrayTuple {
static getCtor(ctor) {
return Vec3.constructors.get(ctor);
}
/**
* Component-wise equals.
*/
isEqualTo(_other) {
throw new Error();
}
getX() {
throw new Error();
}
getY() {
throw new Error();
}
getZ() {
throw new Error();
}
getMagnitude() {
throw new Error();
}
getMagnitudeSquared() {
throw new Error();
}
dotProduct(_vec) {
throw new Error();
}
update(_x, _y, _z) {
throw new Error();
}
setX(_x) {
throw new Error();
}
setY(_y) {
throw new Error();
}
setZ(_z) {
throw new Error();
}
getLoggableValue() {
throw new Error();
}
/**
* If endianness is not supplied the platform's endianness will be used.
*/
copyFromBuffer(_memoryDataView, _pointer, _littleEndian) {
throw new Error();
}
/**
* If endianness is not supplied the platform's endianness will be used.
*/
copyToBuffer(_memoryDataView, _pointer, _littleEndian) {
throw new Error();
}
/**
* Although the typed array tuples extend a typed array, they are not structurally compatible.
* This function returns the argument passed without modification but cast as the underlying storage type, e.g. Float32Array.
*/
castToBaseType() {
throw new Error();
}
}
Vec3.f64 = getVec3Ctor(Float64Array);
Vec3.f32 = getVec3Ctor(Float32Array);
Vec3.i64 = null; // not supported
Vec3.u64 = null; // not supported
Vec3.u32 = getVec3Ctor(Uint32Array);
Vec3.i32 = getVec3Ctor(Int32Array);
Vec3.u16 = getVec3Ctor(Uint16Array);
Vec3.i16 = getVec3Ctor(Int16Array);
Vec3.u8c = getVec3Ctor(Uint8ClampedArray);
Vec3.u8 = getVec3Ctor(Uint8Array);
Vec3.i8 = getVec3Ctor(Int8Array);
Vec3.constructors = populateTypedArrayConstructorMap(Vec3);
//# sourceMappingURL=vec3.js.map