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.
96 lines • 2.66 kB
JavaScript
import { ATypedArrayTuple } from "../a-typed-array-tuple.js";
import { getVec4Ctor } from "./get-vec4-ctor.js";
import { populateTypedArrayConstructorMap } from "../../../runtime/rtti-interop.js";
/**
* @public
* Vector 4.
*
* @remarks
* See static properties for constructors. Instances are not an extension of this class, but of the static members.
*/
export class Vec4 extends ATypedArrayTuple {
static getCtor(ctor) {
return Vec4.constructors.get(ctor);
}
/**
* Component-wise equals.
*/
isEqualTo(_other) {
throw new Error();
}
/**
* @param _packedRGBA - The number to be unpacked.
* @param _normalize - If true, normalize components between 0 - 1.
*/
setRGBAColor(_packedRGBA, _normalize) {
throw new Error();
}
/**
* @param _normalized - Format of the color stored in the Vec4, if true 0 - 1, else 0 - 255.
*/
getPackedRGBAColor(_normalized) {
throw new Error();
}
getX() {
throw new Error();
}
getY() {
throw new Error();
}
getZ() {
throw new Error();
}
getW() {
throw new Error();
}
update(_x, _y, _z, _w) {
throw new Error();
}
setX(_x) {
throw new Error();
}
setY(_y) {
throw new Error();
}
setZ(_z) {
throw new Error();
}
setW(_w) {
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();
}
}
Vec4.f64 = getVec4Ctor(Float64Array);
Vec4.f32 = getVec4Ctor(Float32Array);
Vec4.i64 = null; // not supported
Vec4.u64 = null; // not supported
Vec4.u32 = getVec4Ctor(Uint32Array);
Vec4.i32 = getVec4Ctor(Int32Array);
Vec4.u16 = getVec4Ctor(Uint16Array);
Vec4.i16 = getVec4Ctor(Int16Array);
Vec4.u8c = getVec4Ctor(Uint8ClampedArray);
Vec4.u8 = getVec4Ctor(Uint8Array);
Vec4.i8 = getVec4Ctor(Int8Array);
Vec4.constructors = populateTypedArrayConstructorMap(Vec4);
//# sourceMappingURL=vec4.js.map