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.
136 lines • 3.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Vec2 = void 0;
const a_typed_array_tuple_js_1 = require("../a-typed-array-tuple.js");
const get_vec2_ctor_js_1 = require("./get-vec2-ctor.js");
const rtti_interop_js_1 = require("../../../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.
*/
class Vec2 extends a_typed_array_tuple_js_1.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();
}
}
exports.Vec2 = Vec2;
Vec2.f64 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Float64Array);
Vec2.f32 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Float32Array);
Vec2.i64 = null; // not supported
Vec2.u64 = null; // not supported
Vec2.u32 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Uint32Array);
Vec2.i32 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Int32Array);
Vec2.u16 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Uint16Array);
Vec2.i16 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Int16Array);
Vec2.u8c = (0, get_vec2_ctor_js_1.getVec2Ctor)(Uint8ClampedArray);
Vec2.u8 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Uint8Array);
Vec2.i8 = (0, get_vec2_ctor_js_1.getVec2Ctor)(Int8Array);
Vec2.constructors = (0, rtti_interop_js_1.populateTypedArrayConstructorMap)(Vec2);
//# sourceMappingURL=vec2.js.map