UNPKG

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.

132 lines 3.4 kB
import { ATypedArrayTuple } from "../a-typed-array-tuple.js"; import { getVec2Ctor } from "./get-vec2-ctor.js"; import { populateTypedArrayConstructorMap } from "../../../runtime/rtti-interop.js"; /** * @public * Vector 2. * * @remarks * See static properties for constructors. Instances are not an extension of this class, but of the static members. */ export class Vec2 extends ATypedArrayTuple { static getCtor(ctor) { return Vec2.constructors.get(ctor); } /** * Component-wise equals. */ isEqualTo(_other) { throw new Error(); } getX() { throw new Error(); } getY() { throw new Error(); } getMagnitude() { throw new Error(); } getMagnitudeSquared() { throw new Error(); } update(_x, _y) { throw new Error(); } setX(_x) { throw new Error(); } setY(_y) { throw new Error(); } add(_vec, _result) { throw new Error(); } subtract(_vec, _result) { throw new Error(); } scalarMultiply(_value, _result) { throw new Error(); } /** * Multiply `this` by `_value`. */ vec2Multiply(_value, _result) { throw new Error(); } scalarDivide(_value, _result) { throw new Error(); } /** * Divide `this` by `_value`. */ vec2Divide(_value, _result) { throw new Error(); } /** * Returns a unit vector in the direction of this vector. */ normalize(_result) { throw new Error(); } /** * Returns the normal to this vector. */ getNormal(_result) { throw new Error(); } dotProduct(_vec) { throw new Error(); } mat3Multiply(_mat, _result) { throw new Error(); } /** * If this point is outside of the range, set that dimension to the extrema of the range. * @param _range - The range to be bound to, inclusive. */ bound2d(_range) { throw new Error(); } /** * Shifts this position by the arguments. */ translate2d(_dx, _dy) { 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(); } } Vec2.f64 = getVec2Ctor(Float64Array); Vec2.f32 = getVec2Ctor(Float32Array); Vec2.i64 = null; // not supported Vec2.u64 = null; // not supported Vec2.u32 = getVec2Ctor(Uint32Array); Vec2.i32 = getVec2Ctor(Int32Array); Vec2.u16 = getVec2Ctor(Uint16Array); Vec2.i16 = getVec2Ctor(Int16Array); Vec2.u8c = getVec2Ctor(Uint8ClampedArray); Vec2.u8 = getVec2Ctor(Uint8Array); Vec2.i8 = getVec2Ctor(Int8Array); Vec2.constructors = populateTypedArrayConstructorMap(Vec2); //# sourceMappingURL=vec2.js.map