@math.gl/core 5.0.0-alpha.2 → 5.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/APACHE-2.0-LICENSE.txt +55 -0
- package/ARROW-NOTICE.txt +18 -0
- package/LICENSE +149 -40
- package/PROJ4-LICENSE.md +29 -0
- package/README.md +14 -0
- package/THIRD-PARTY-NOTICES.md +16 -0
- package/dist/classes/base/math-array.d.ts +1 -1
- package/dist/classes/base/math-array.d.ts.map +1 -1
- package/dist/classes/base/math-array.js +1 -1
- package/dist/classes/base/math-array.js.map +1 -1
- package/dist/classes/base/matrix.d.ts +1 -1
- package/dist/classes/base/matrix.d.ts.map +1 -1
- package/dist/classes/base/matrix.js +2 -2
- package/dist/classes/base/matrix.js.map +1 -1
- package/dist/classes/base/vector.d.ts +1 -1
- package/dist/classes/base/vector.d.ts.map +1 -1
- package/dist/classes/base/vector.js +2 -2
- package/dist/classes/base/vector.js.map +1 -1
- package/dist/classes/euler-types.js +1 -1
- package/dist/classes/euler-types.js.map +1 -1
- package/dist/classes/euler.d.ts +1 -1
- package/dist/classes/euler.d.ts.map +1 -1
- package/dist/classes/euler.js +4 -2
- package/dist/classes/euler.js.map +1 -1
- package/dist/classes/matrix3.d.ts +1 -1
- package/dist/classes/matrix3.d.ts.map +1 -1
- package/dist/classes/matrix3.js +2 -2
- package/dist/classes/matrix3.js.map +1 -1
- package/dist/classes/matrix4.d.ts +1 -1
- package/dist/classes/matrix4.d.ts.map +1 -1
- package/dist/classes/matrix4.js +2 -2
- package/dist/classes/matrix4.js.map +1 -1
- package/dist/classes/pose.d.ts +1 -1
- package/dist/classes/pose.d.ts.map +1 -1
- package/dist/classes/pose.js +2 -2
- package/dist/classes/pose.js.map +1 -1
- package/dist/classes/quaternion.d.ts +1 -1
- package/dist/classes/quaternion.d.ts.map +1 -1
- package/dist/classes/quaternion.js +2 -2
- package/dist/classes/quaternion.js.map +1 -1
- package/dist/classes/spherical-coordinates.js +2 -2
- package/dist/classes/spherical-coordinates.js.map +1 -1
- package/dist/classes/vector2.d.ts +1 -1
- package/dist/classes/vector2.d.ts.map +1 -1
- package/dist/classes/vector2.js +2 -2
- package/dist/classes/vector2.js.map +1 -1
- package/dist/classes/vector3.d.ts +1 -1
- package/dist/classes/vector3.d.ts.map +1 -1
- package/dist/classes/vector3.js +2 -2
- package/dist/classes/vector3.js.map +1 -1
- package/dist/classes/vector4.d.ts +1 -1
- package/dist/classes/vector4.d.ts.map +1 -1
- package/dist/classes/vector4.js +2 -2
- package/dist/classes/vector4.js.map +1 -1
- package/dist/expressions/expression-eval.d.ts +98 -0
- package/dist/expressions/expression-eval.d.ts.map +1 -0
- package/dist/expressions/expression-eval.js +302 -0
- package/dist/expressions/expression-eval.js.map +1 -0
- package/dist/expressions/function-libraries.d.ts +60 -0
- package/dist/expressions/function-libraries.d.ts.map +1 -0
- package/dist/expressions/function-libraries.js +69 -0
- package/dist/expressions/function-libraries.js.map +1 -0
- package/dist/expressions/function-registry.d.ts +93 -0
- package/dist/expressions/function-registry.d.ts.map +1 -0
- package/dist/expressions/function-registry.js +139 -0
- package/dist/expressions/function-registry.js.map +1 -0
- package/dist/expressions/get.d.ts +9 -0
- package/dist/expressions/get.d.ts.map +1 -0
- package/dist/expressions/get.js +32 -0
- package/dist/expressions/get.js.map +1 -0
- package/dist/expressions/index.cjs +1491 -0
- package/dist/expressions/index.cjs.map +6 -0
- package/dist/expressions/index.d.ts +7 -0
- package/dist/expressions/index.d.ts.map +1 -0
- package/dist/expressions/index.js +8 -0
- package/dist/expressions/index.js.map +1 -0
- package/dist/expressions/parse-expression-string.d.ts +21 -0
- package/dist/expressions/parse-expression-string.d.ts.map +1 -0
- package/dist/expressions/parse-expression-string.js +61 -0
- package/dist/expressions/parse-expression-string.js.map +1 -0
- package/dist/expressions/vendor/jsep/runtime.d.ts +3 -0
- package/dist/expressions/vendor/jsep/runtime.d.ts.map +1 -0
- package/dist/expressions/vendor/jsep/runtime.js +972 -0
- package/dist/expressions/vendor/jsep/runtime.js.map +1 -0
- package/dist/expressions/vendor/jsep/types.d.ts +141 -0
- package/dist/expressions/vendor/jsep/types.d.ts.map +1 -0
- package/dist/expressions/vendor/jsep/types.js +4 -0
- package/dist/expressions/vendor/jsep/types.js.map +1 -0
- package/dist/gl-matrix/common.d.ts +1 -1
- package/dist/gl-matrix/common.d.ts.map +1 -1
- package/dist/gl-matrix/common.js +5 -0
- package/dist/gl-matrix/common.js.map +1 -1
- package/dist/gl-matrix/mat3.d.ts.map +1 -1
- package/dist/gl-matrix/mat3.js +5 -0
- package/dist/gl-matrix/mat3.js.map +1 -1
- package/dist/gl-matrix/mat4.d.ts.map +1 -1
- package/dist/gl-matrix/mat4.js +5 -0
- package/dist/gl-matrix/mat4.js.map +1 -1
- package/dist/gl-matrix/quat.d.ts.map +1 -1
- package/dist/gl-matrix/quat.js +5 -0
- package/dist/gl-matrix/quat.js.map +1 -1
- package/dist/gl-matrix/vec2.d.ts +1 -1
- package/dist/gl-matrix/vec2.d.ts.map +1 -1
- package/dist/gl-matrix/vec2.js +5 -0
- package/dist/gl-matrix/vec2.js.map +1 -1
- package/dist/gl-matrix/vec3.d.ts.map +1 -1
- package/dist/gl-matrix/vec3.js +5 -0
- package/dist/gl-matrix/vec3.js.map +1 -1
- package/dist/gl-matrix/vec4.d.ts.map +1 -1
- package/dist/gl-matrix/vec4.js +5 -0
- package/dist/gl-matrix/vec4.js.map +1 -1
- package/dist/gl-matrix/wip/index.d.ts.map +1 -1
- package/dist/gl-matrix/wip/index.js +3 -1
- package/dist/gl-matrix/wip/index.js.map +1 -1
- package/dist/gl-matrix/wip/mat2.d.ts.map +1 -1
- package/dist/gl-matrix/wip/mat2.js +3 -1
- package/dist/gl-matrix/wip/mat2.js.map +1 -1
- package/dist/gl-matrix/wip/mat2d.d.ts.map +1 -1
- package/dist/gl-matrix/wip/mat2d.js +3 -1
- package/dist/gl-matrix/wip/mat2d.js.map +1 -1
- package/dist/gl-matrix/wip/quat2.d.ts.map +1 -1
- package/dist/gl-matrix/wip/quat2.js +3 -1
- package/dist/gl-matrix/wip/quat2.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/assert.js +1 -1
- package/dist/lib/assert.js.map +1 -1
- package/dist/lib/common.d.ts +1 -1
- package/dist/lib/common.d.ts.map +1 -1
- package/dist/lib/common.js +1 -1
- package/dist/lib/common.js.map +1 -1
- package/dist/lib/gl-matrix-extras.d.ts +1 -1
- package/dist/lib/gl-matrix-extras.d.ts.map +1 -1
- package/dist/lib/gl-matrix-extras.js +1 -1
- package/dist/lib/gl-matrix-extras.js.map +1 -1
- package/dist/lib/math-utils.d.ts.map +1 -1
- package/dist/lib/math-utils.js +2 -1
- package/dist/lib/math-utils.js.map +1 -1
- package/dist/lib/validators.d.ts +1 -1
- package/dist/lib/validators.d.ts.map +1 -1
- package/dist/lib/validators.js +1 -1
- package/dist/lib/validators.js.map +1 -1
- package/dist/local-frame.cjs +139 -0
- package/dist/local-frame.cjs.map +6 -0
- package/dist/local-frame.d.ts +39 -0
- package/dist/local-frame.d.ts.map +1 -0
- package/dist/local-frame.js +157 -0
- package/dist/local-frame.js.map +1 -0
- package/dist/mat3.cjs.map +1 -1
- package/dist/mat3.js +1 -1
- package/dist/mat3.js.map +1 -1
- package/dist/mat4.cjs.map +1 -1
- package/dist/mat4.js +1 -1
- package/dist/mat4.js.map +1 -1
- package/dist/quat.cjs.map +1 -1
- package/dist/quat.js +1 -1
- package/dist/quat.js.map +1 -1
- package/dist/spheroid.cjs +147 -0
- package/dist/spheroid.cjs.map +6 -0
- package/dist/spheroid.d.ts +21 -0
- package/dist/spheroid.d.ts.map +1 -0
- package/dist/spheroid.js +175 -0
- package/dist/spheroid.js.map +1 -0
- package/dist/types/array-types.d.ts +98 -0
- package/dist/types/array-types.d.ts.map +1 -0
- package/dist/types/array-types.js +6 -0
- package/dist/types/array-types.js.map +1 -0
- package/dist/types/bigint.d.ts +21 -0
- package/dist/types/bigint.d.ts.map +1 -0
- package/dist/types/bigint.js +65 -0
- package/dist/types/bigint.js.map +1 -0
- package/dist/types/bounds-types.d.ts +11 -0
- package/dist/types/bounds-types.d.ts.map +1 -0
- package/dist/types/bounds-types.js +17 -0
- package/dist/types/bounds-types.js.map +1 -0
- package/dist/types/float16.d.ts +32 -0
- package/dist/types/float16.d.ts.map +1 -0
- package/dist/types/float16.js +41 -0
- package/dist/types/float16.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/is-array.d.ts +22 -0
- package/dist/types/is-array.d.ts.map +1 -0
- package/dist/types/is-array.js +36 -0
- package/dist/types/is-array.js.map +1 -0
- package/dist/types/spheroid.d.ts +8 -0
- package/dist/types/spheroid.d.ts.map +1 -0
- package/dist/types/spheroid.js +5 -0
- package/dist/types/spheroid.js.map +1 -0
- package/dist/types/typed-array-brand.d.ts +2 -0
- package/dist/types/typed-array-brand.d.ts.map +1 -0
- package/dist/types/typed-array-brand.js +10 -0
- package/dist/types/typed-array-brand.js.map +1 -0
- package/dist/types.cjs +67 -0
- package/dist/types.cjs.map +6 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/vec2.cjs.map +1 -1
- package/dist/vec2.js +1 -1
- package/dist/vec2.js.map +1 -1
- package/dist/vec3.cjs.map +1 -1
- package/dist/vec3.js +1 -1
- package/dist/vec3.js.map +1 -1
- package/dist/vec4.cjs.map +1 -1
- package/dist/vec4.js +1 -1
- package/dist/vec4.js.map +1 -1
- package/package.json +28 -6
- package/src/classes/base/math-array.ts +2 -2
- package/src/classes/base/matrix.ts +3 -3
- package/src/classes/base/vector.ts +3 -3
- package/src/classes/euler-types.ts +1 -1
- package/src/classes/euler.ts +5 -3
- package/src/classes/matrix3.ts +3 -3
- package/src/classes/matrix4.ts +3 -3
- package/src/classes/pose.ts +3 -3
- package/src/classes/quaternion.ts +3 -3
- package/src/classes/spherical-coordinates.ts +2 -2
- package/src/classes/vector2.ts +3 -3
- package/src/classes/vector3.ts +3 -3
- package/src/classes/vector4.ts +3 -3
- package/src/expressions/expression-eval.ts +435 -0
- package/src/expressions/function-libraries.ts +123 -0
- package/src/expressions/function-registry.ts +171 -0
- package/src/expressions/get.ts +37 -0
- package/src/expressions/index.ts +22 -0
- package/src/expressions/parse-expression-string.ts +80 -0
- package/src/expressions/vendor/jsep/LICENSE.txt +23 -0
- package/src/expressions/vendor/jsep/README.md +22 -0
- package/src/expressions/vendor/jsep/runtime.ts +949 -0
- package/src/expressions/vendor/jsep/types.ts +179 -0
- package/src/gl-matrix/common.js +5 -0
- package/src/gl-matrix/mat3.ts +5 -0
- package/src/gl-matrix/mat4.ts +5 -0
- package/src/gl-matrix/quat.ts +5 -0
- package/src/gl-matrix/vec2.ts +6 -1
- package/src/gl-matrix/vec3.ts +5 -0
- package/src/gl-matrix/vec4.ts +5 -0
- package/src/gl-matrix/wip/index.js +3 -1
- package/src/gl-matrix/wip/mat2.js +3 -1
- package/src/gl-matrix/wip/mat2d.js +3 -1
- package/src/gl-matrix/wip/quat2.ts +3 -1
- package/src/index.ts +5 -3
- package/src/lib/assert.ts +1 -1
- package/src/lib/common.ts +2 -2
- package/src/lib/gl-matrix-extras.ts +2 -2
- package/src/lib/gl-matrix.d.ts +1 -1
- package/src/lib/math-utils.ts +2 -1
- package/src/lib/validators.ts +2 -2
- package/src/local-frame.ts +253 -0
- package/src/mat3.ts +1 -1
- package/src/mat4.ts +1 -1
- package/src/quat.ts +1 -1
- package/src/spheroid.ts +230 -0
- package/src/types/array-types.ts +148 -0
- package/src/types/bigint.ts +74 -0
- package/src/types/bounds-types.ts +29 -0
- package/src/types/float16.ts +47 -0
- package/src/types/index.ts +45 -0
- package/src/types/is-array.ts +41 -0
- package/src/types/spheroid.ts +11 -0
- package/src/types/typed-array-brand.ts +14 -0
- package/src/types.ts +5 -0
- package/src/vec2.ts +1 -1
- package/src/vec3.ts +1 -1
- package/src/vec4.ts +1 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// SPDX-FileCopyrightText: Copyright (c) 2013 Stephen Oney
|
|
3
|
+
|
|
4
|
+
declare namespace jsep {
|
|
5
|
+
export type baseTypes = string | number | boolean | RegExp | null | undefined | object;
|
|
6
|
+
export interface Expression {
|
|
7
|
+
type: string;
|
|
8
|
+
[key: string]: baseTypes | Expression | Array<baseTypes | Expression>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ArrayExpression extends Expression {
|
|
12
|
+
type: 'ArrayExpression';
|
|
13
|
+
/** The expression can be null in the case of array holes ([ , , ]) */
|
|
14
|
+
elements: Array<null | Expression>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface BinaryExpression extends Expression {
|
|
18
|
+
type: 'BinaryExpression';
|
|
19
|
+
operator: string;
|
|
20
|
+
left: Expression;
|
|
21
|
+
right: Expression;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CallExpression extends Expression {
|
|
25
|
+
type: 'CallExpression';
|
|
26
|
+
arguments: Expression[];
|
|
27
|
+
callee: Expression;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Compound extends Expression {
|
|
31
|
+
type: 'Compound';
|
|
32
|
+
body: Expression[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface SequenceExpression extends Expression {
|
|
36
|
+
type: 'SequenceExpression';
|
|
37
|
+
expressions: Expression[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ConditionalExpression extends Expression {
|
|
41
|
+
type: 'ConditionalExpression';
|
|
42
|
+
test: Expression;
|
|
43
|
+
consequent: Expression;
|
|
44
|
+
alternate: Expression;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface Identifier extends Expression {
|
|
48
|
+
type: 'Identifier';
|
|
49
|
+
name: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface Literal extends Expression {
|
|
53
|
+
type: 'Literal';
|
|
54
|
+
value: boolean | number | string | RegExp | null;
|
|
55
|
+
raw: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface MemberExpression extends Expression {
|
|
59
|
+
type: 'MemberExpression';
|
|
60
|
+
computed: boolean;
|
|
61
|
+
object: Expression;
|
|
62
|
+
property: Expression;
|
|
63
|
+
optional?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ThisExpression extends Expression {
|
|
67
|
+
type: 'ThisExpression';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface UnaryExpression extends Expression {
|
|
71
|
+
type: 'UnaryExpression';
|
|
72
|
+
operator: string;
|
|
73
|
+
argument: Expression;
|
|
74
|
+
prefix: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type ExpressionType =
|
|
78
|
+
'Compound'
|
|
79
|
+
| 'SequenceExpression'
|
|
80
|
+
| 'Identifier'
|
|
81
|
+
| 'MemberExpression'
|
|
82
|
+
| 'Literal'
|
|
83
|
+
| 'ThisExpression'
|
|
84
|
+
| 'CallExpression'
|
|
85
|
+
| 'UnaryExpression'
|
|
86
|
+
| 'BinaryExpression'
|
|
87
|
+
| 'ConditionalExpression'
|
|
88
|
+
| 'ArrayExpression';
|
|
89
|
+
|
|
90
|
+
export type CoreExpression =
|
|
91
|
+
ArrayExpression
|
|
92
|
+
| BinaryExpression
|
|
93
|
+
| CallExpression
|
|
94
|
+
| Compound
|
|
95
|
+
| SequenceExpression
|
|
96
|
+
| ConditionalExpression
|
|
97
|
+
| Identifier
|
|
98
|
+
| Literal
|
|
99
|
+
| MemberExpression
|
|
100
|
+
| ThisExpression
|
|
101
|
+
| UnaryExpression;
|
|
102
|
+
|
|
103
|
+
export type PossibleExpression = Expression | undefined;
|
|
104
|
+
export interface HookScope {
|
|
105
|
+
index: number;
|
|
106
|
+
readonly expr: string;
|
|
107
|
+
readonly char: string; // current character of the expression
|
|
108
|
+
readonly code: number; // current character code of the expression
|
|
109
|
+
gobbleSpaces: () => void;
|
|
110
|
+
gobbleExpressions: (untilICode?: number) => Expression[];
|
|
111
|
+
gobbleExpression: () => Expression;
|
|
112
|
+
gobbleBinaryOp: () => PossibleExpression;
|
|
113
|
+
gobbleBinaryExpression: () => PossibleExpression;
|
|
114
|
+
gobbleToken: () => PossibleExpression;
|
|
115
|
+
gobbleTokenProperty: (node: Expression) => Expression
|
|
116
|
+
gobbleNumericLiteral: () => PossibleExpression;
|
|
117
|
+
gobbleStringLiteral: () => PossibleExpression;
|
|
118
|
+
gobbleIdentifier: () => PossibleExpression;
|
|
119
|
+
gobbleArguments: (untilICode: number) => PossibleExpression;
|
|
120
|
+
gobbleGroup: () => Expression;
|
|
121
|
+
gobbleArray: () => PossibleExpression;
|
|
122
|
+
throwError: (msg: string) => never;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type HookType = 'gobble-expression' | 'after-expression' | 'gobble-token' | 'after-token' | 'gobble-spaces';
|
|
126
|
+
export type HookCallback = (this: HookScope, env: { node?: Expression }) => void;
|
|
127
|
+
type HookTypeObj = Partial<{ [key in HookType]: HookCallback}>
|
|
128
|
+
|
|
129
|
+
export interface IHooks extends HookTypeObj {
|
|
130
|
+
add(name: HookType, cb: HookCallback, first?: boolean): void;
|
|
131
|
+
add(obj: { [name in HookType]: HookCallback }, first?: boolean): void;
|
|
132
|
+
run(name: string, env: { context?: typeof jsep, node?: Expression }): void;
|
|
133
|
+
}
|
|
134
|
+
let hooks: IHooks;
|
|
135
|
+
|
|
136
|
+
export interface IPlugin {
|
|
137
|
+
name: string;
|
|
138
|
+
init: (this: typeof jsep) => void;
|
|
139
|
+
}
|
|
140
|
+
export interface IPlugins {
|
|
141
|
+
registered: { [name: string]: IPlugin };
|
|
142
|
+
register: (...plugins: IPlugin[]) => void;
|
|
143
|
+
}
|
|
144
|
+
let plugins: IPlugins;
|
|
145
|
+
|
|
146
|
+
let unary_ops: { [op: string]: any };
|
|
147
|
+
let binary_ops: { [op: string]: number };
|
|
148
|
+
let right_associative: Set<string>;
|
|
149
|
+
let additional_identifier_chars: Set<string>;
|
|
150
|
+
let literals: { [literal: string]: any };
|
|
151
|
+
let this_str: string;
|
|
152
|
+
|
|
153
|
+
function addBinaryOp(operatorName: string, precedence: number, rightToLeft?: boolean): void;
|
|
154
|
+
|
|
155
|
+
function addUnaryOp(operatorName: string): void;
|
|
156
|
+
|
|
157
|
+
function addLiteral(literalName: string, literalValue: any): void;
|
|
158
|
+
|
|
159
|
+
function addIdentifierChar(identifierName: string): void;
|
|
160
|
+
|
|
161
|
+
function removeBinaryOp(operatorName: string): void;
|
|
162
|
+
|
|
163
|
+
function removeUnaryOp(operatorName: string): void;
|
|
164
|
+
|
|
165
|
+
function removeLiteral(literalName: string): void;
|
|
166
|
+
|
|
167
|
+
function removeIdentifierChar(identifierName: string): void;
|
|
168
|
+
|
|
169
|
+
function removeAllBinaryOps(): void;
|
|
170
|
+
|
|
171
|
+
function removeAllUnaryOps(): void;
|
|
172
|
+
|
|
173
|
+
function removeAllLiterals(): void;
|
|
174
|
+
|
|
175
|
+
const version: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare function jsep(val: string | jsep.Expression): jsep.Expression;
|
|
179
|
+
export type {jsep as Jsep};
|
package/src/gl-matrix/common.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
package/src/gl-matrix/mat3.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
import * as glMatrix from './common.js';
|
|
2
7
|
|
|
3
8
|
/**
|
package/src/gl-matrix/mat4.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
package/src/gl-matrix/quat.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
package/src/gl-matrix/vec2.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
|
4
|
-
import type {NumericArray} from '
|
|
9
|
+
import type {NumericArray} from '../types';
|
|
5
10
|
import * as glMatrix from './common.js';
|
|
6
11
|
|
|
7
12
|
/**
|
package/src/gl-matrix/vec3.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
package/src/gl-matrix/vec4.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
1
6
|
// @eslint-disable
|
|
2
7
|
// @ts-nocheck
|
|
3
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c)
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
4
6
|
|
|
5
7
|
// @eslint-disable
|
|
6
8
|
// @ts-nocheck
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c)
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
4
6
|
|
|
5
7
|
// @ts-nocheck
|
|
6
8
|
/* eslint-disable */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c)
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
4
6
|
|
|
5
7
|
// @ts-nocheck
|
|
6
8
|
/* eslint-disable */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c)
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. (gl-matrix)
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
5
|
+
// SPDX-FileComment: Adapted from gl-matrix. See the repository LICENSE for upstream attribution and terms.
|
|
4
6
|
|
|
5
7
|
// @ts-nocheck
|
|
6
8
|
/* eslint-disable */
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
// types
|
|
6
6
|
export type {
|
|
@@ -16,9 +16,9 @@ export type {
|
|
|
16
16
|
NumberArray9,
|
|
17
17
|
NumberArray12,
|
|
18
18
|
NumberArray16
|
|
19
|
-
} from '
|
|
19
|
+
} from './types';
|
|
20
20
|
|
|
21
|
-
export type {isTypedArray, isNumberArray, isNumericArray} from '
|
|
21
|
+
export type {isTypedArray, isNumberArray, isNumericArray} from './types';
|
|
22
22
|
|
|
23
23
|
// classes
|
|
24
24
|
export {MathArray as _MathArray} from './classes/base/math-array';
|
|
@@ -68,3 +68,5 @@ export {
|
|
|
68
68
|
lerp,
|
|
69
69
|
withEpsilon
|
|
70
70
|
} from './lib/common';
|
|
71
|
+
|
|
72
|
+
export type {SpheroidParameters} from './types';
|
package/src/lib/assert.ts
CHANGED
package/src/lib/common.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
/* eslint-disable no-shadow */ // radians and degrees are common variable names
|
|
6
6
|
|
|
7
|
-
import type {NumericArray} from '
|
|
7
|
+
import type {NumericArray} from '../types';
|
|
8
8
|
|
|
9
9
|
import type {MathArray} from '../classes/base/math-array';
|
|
10
10
|
import {EPSILON14, TWO_PI, PI} from './math-utils';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
/* eslint-disable camelcase */
|
|
6
|
-
import {NumericArray} from '
|
|
6
|
+
import {NumericArray} from '../types';
|
|
7
7
|
// vec2 additions
|
|
8
8
|
|
|
9
9
|
export function vec2_transformMat4AsVector<T extends NumericArray>(
|
package/src/lib/gl-matrix.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
// Float16Array is declared in a separate TypeScript library. This reference affects types only.
|
|
6
6
|
// eslint-disable-next-line spaced-comment
|
package/src/lib/math-utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileComment: Original compatibility helpers for Cesium-derived tests.
|
|
4
5
|
|
|
5
6
|
// NOTE: Added to make Cesium-derived test cases work
|
|
6
7
|
// TODO: Determine if/how to keep
|
package/src/lib/validators.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// math.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {NumericArray} from '
|
|
5
|
+
import {NumericArray} from '../types';
|
|
6
6
|
import {config} from './common';
|
|
7
7
|
|
|
8
8
|
export function validateVector(v: NumericArray, length: number): boolean {
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileComment: Original factored ENU/NED basis, rotations and matrix commits. No CesiumJS or PROJ source is copied.
|
|
5
|
+
import type {NumericArray} from './types';
|
|
6
|
+
|
|
7
|
+
export type LocalFramePoint = {x: number; y: number; z: number};
|
|
8
|
+
export type LocalFrameAxis = 'east' | 'north' | 'up' | 'west' | 'south' | 'down';
|
|
9
|
+
/** East has zero Z. North is up × east; northZ is its horizontal radial factor. */
|
|
10
|
+
export type LocalFrameBasis = {
|
|
11
|
+
eastX: number;
|
|
12
|
+
eastY: number;
|
|
13
|
+
northZ: number;
|
|
14
|
+
upX: number;
|
|
15
|
+
upY: number;
|
|
16
|
+
upZ: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Setup-time scratch, initially the ENU basis at longitude/latitude zero. */
|
|
20
|
+
export function createLocalFrameBasis(): LocalFrameBasis {
|
|
21
|
+
return {eastX: 0, eastY: 1, northZ: 1, upX: 1, upY: 0, upZ: 0};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Angles in radians. Longitude is periodic; latitude must be within ±π/2. */
|
|
25
|
+
export function eastNorthUpBasis(
|
|
26
|
+
longitude: number,
|
|
27
|
+
latitude: number,
|
|
28
|
+
result: LocalFrameBasis
|
|
29
|
+
): boolean {
|
|
30
|
+
if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || Math.abs(latitude) > Math.PI / 2)
|
|
31
|
+
return false;
|
|
32
|
+
const sl = Math.sin(longitude),
|
|
33
|
+
cl = Math.cos(longitude);
|
|
34
|
+
const sp = Math.sin(latitude),
|
|
35
|
+
cp = Math.cos(latitude);
|
|
36
|
+
return commitBasis(result, -sl, cl, cp, cp * cl, cp * sl, sp);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Caller supplies finite unit east/up directions, east.z=0, mutually perpendicular,
|
|
41
|
+
* and an up direction whose horizontal component points radially outward.
|
|
42
|
+
* This form preserves supplied up components rather than inferring a geodetic footpoint.
|
|
43
|
+
* Finiteness is checked; orthonormality is a caller precondition, not certified here.
|
|
44
|
+
*/
|
|
45
|
+
export function eastNorthUpBasisFromDirections(
|
|
46
|
+
east: LocalFramePoint,
|
|
47
|
+
up: LocalFramePoint,
|
|
48
|
+
result: LocalFrameBasis
|
|
49
|
+
): boolean {
|
|
50
|
+
const ex = east.x,
|
|
51
|
+
ey = east.y,
|
|
52
|
+
ez = east.z;
|
|
53
|
+
const ux = up.x,
|
|
54
|
+
uy = up.y,
|
|
55
|
+
uz = up.z;
|
|
56
|
+
if (ez !== 0) return false;
|
|
57
|
+
return commitBasis(result, ex, ey, ux * ey - uy * ex, ux, uy, uz);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Rotate ENU offsets/velocities to fixed XYZ. Distances retain the input unit. */
|
|
61
|
+
export function localToFixed(
|
|
62
|
+
point: LocalFramePoint,
|
|
63
|
+
basis: LocalFrameBasis,
|
|
64
|
+
result: LocalFramePoint = point
|
|
65
|
+
): boolean {
|
|
66
|
+
const sl = -basis.eastX,
|
|
67
|
+
cl = basis.eastY,
|
|
68
|
+
sp = basis.upZ,
|
|
69
|
+
cp = basis.northZ;
|
|
70
|
+
const east = point.x,
|
|
71
|
+
north = point.y,
|
|
72
|
+
up = point.z;
|
|
73
|
+
// Retain the factored rotation order used by deformation; no intermediate vector.
|
|
74
|
+
const radial = up * cp - north * sp;
|
|
75
|
+
return commitPoint(
|
|
76
|
+
result,
|
|
77
|
+
radial * cl - east * sl,
|
|
78
|
+
radial * sl + east * cl,
|
|
79
|
+
up * sp + north * cp
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Transpose rotation, valid for the orthonormal ENU basis precondition. */
|
|
84
|
+
export function fixedToLocal(
|
|
85
|
+
point: LocalFramePoint,
|
|
86
|
+
basis: LocalFrameBasis,
|
|
87
|
+
result: LocalFramePoint = point
|
|
88
|
+
): boolean {
|
|
89
|
+
const ex = basis.eastX,
|
|
90
|
+
ey = basis.eastY,
|
|
91
|
+
nz = basis.northZ;
|
|
92
|
+
const ux = basis.upX,
|
|
93
|
+
uy = basis.upY,
|
|
94
|
+
uz = basis.upZ;
|
|
95
|
+
const x = point.x,
|
|
96
|
+
y = point.y,
|
|
97
|
+
z = point.z;
|
|
98
|
+
return commitPoint(
|
|
99
|
+
result,
|
|
100
|
+
x * ex + y * ey,
|
|
101
|
+
-x * uz * ey + y * uz * ex + z * nz,
|
|
102
|
+
x * ux + y * uy + z * uz
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Column-major affine matrix, with explicit signed local axes and fixed-space origin.
|
|
108
|
+
* Axis triples must be right handed (e.g. east/north/up or north/east/down).
|
|
109
|
+
* Translation uses the origin's distance unit. The basis itself has no origin.
|
|
110
|
+
* A failure leaves output unchanged; caller owns writable storage (a growable number array or a typed array of length ≥16).
|
|
111
|
+
*/
|
|
112
|
+
export function localFrameToMatrix(
|
|
113
|
+
basis: LocalFrameBasis,
|
|
114
|
+
origin: LocalFramePoint,
|
|
115
|
+
firstAxis: LocalFrameAxis,
|
|
116
|
+
secondAxis: LocalFrameAxis,
|
|
117
|
+
thirdAxis: LocalFrameAxis,
|
|
118
|
+
result: NumericArray
|
|
119
|
+
): boolean {
|
|
120
|
+
const first = axisCode(firstAxis),
|
|
121
|
+
second = axisCode(secondAxis),
|
|
122
|
+
third = axisCode(thirdAxis);
|
|
123
|
+
const a = Math.abs(first),
|
|
124
|
+
b = Math.abs(second),
|
|
125
|
+
c = Math.abs(third);
|
|
126
|
+
if (!a || !b || !c || a === b || a === c || b === c) return false;
|
|
127
|
+
const parity = (a % 3) + 1 === b ? 1 : -1;
|
|
128
|
+
if (
|
|
129
|
+
parity * Math.sign(first * second * third) !== 1 ||
|
|
130
|
+
(!Array.isArray(result) && result.length < 16)
|
|
131
|
+
)
|
|
132
|
+
return false;
|
|
133
|
+
const ex = basis.eastX,
|
|
134
|
+
ey = basis.eastY,
|
|
135
|
+
nz = basis.northZ;
|
|
136
|
+
const ux = basis.upX,
|
|
137
|
+
uy = basis.upY,
|
|
138
|
+
uz = basis.upZ;
|
|
139
|
+
const nx = -uz * ey,
|
|
140
|
+
ny = uz * ex;
|
|
141
|
+
const x = origin.x,
|
|
142
|
+
y = origin.y,
|
|
143
|
+
z = origin.z;
|
|
144
|
+
const ax = (a === 1 ? ex : a === 2 ? nx : ux) * Math.sign(first);
|
|
145
|
+
const ay = (a === 1 ? ey : a === 2 ? ny : uy) * Math.sign(first);
|
|
146
|
+
const az = (a === 1 ? 0 : a === 2 ? nz : uz) * Math.sign(first);
|
|
147
|
+
const bx = (b === 1 ? ex : b === 2 ? nx : ux) * Math.sign(second);
|
|
148
|
+
const by = (b === 1 ? ey : b === 2 ? ny : uy) * Math.sign(second);
|
|
149
|
+
const bz = (b === 1 ? 0 : b === 2 ? nz : uz) * Math.sign(second);
|
|
150
|
+
const cx = (c === 1 ? ex : c === 2 ? nx : ux) * Math.sign(third);
|
|
151
|
+
const cy = (c === 1 ? ey : c === 2 ? ny : uy) * Math.sign(third);
|
|
152
|
+
const cz = (c === 1 ? 0 : c === 2 ? nz : uz) * Math.sign(third);
|
|
153
|
+
if (
|
|
154
|
+
!Number.isFinite(ax) ||
|
|
155
|
+
!Number.isFinite(ay) ||
|
|
156
|
+
!Number.isFinite(az) ||
|
|
157
|
+
!Number.isFinite(bx) ||
|
|
158
|
+
!Number.isFinite(by) ||
|
|
159
|
+
!Number.isFinite(bz) ||
|
|
160
|
+
!Number.isFinite(cx) ||
|
|
161
|
+
!Number.isFinite(cy) ||
|
|
162
|
+
!Number.isFinite(cz) ||
|
|
163
|
+
!Number.isFinite(x) ||
|
|
164
|
+
!Number.isFinite(y) ||
|
|
165
|
+
!Number.isFinite(z)
|
|
166
|
+
)
|
|
167
|
+
return false;
|
|
168
|
+
if (
|
|
169
|
+
result instanceof Float32Array &&
|
|
170
|
+
(!Number.isFinite(Math.fround(ax)) ||
|
|
171
|
+
!Number.isFinite(Math.fround(ay)) ||
|
|
172
|
+
!Number.isFinite(Math.fround(az)) ||
|
|
173
|
+
!Number.isFinite(Math.fround(bx)) ||
|
|
174
|
+
!Number.isFinite(Math.fround(by)) ||
|
|
175
|
+
!Number.isFinite(Math.fround(bz)) ||
|
|
176
|
+
!Number.isFinite(Math.fround(cx)) ||
|
|
177
|
+
!Number.isFinite(Math.fround(cy)) ||
|
|
178
|
+
!Number.isFinite(Math.fround(cz)) ||
|
|
179
|
+
!Number.isFinite(Math.fround(x)) ||
|
|
180
|
+
!Number.isFinite(Math.fround(y)) ||
|
|
181
|
+
!Number.isFinite(Math.fround(z)))
|
|
182
|
+
)
|
|
183
|
+
return false;
|
|
184
|
+
// Snapshot every component before application setters can recursively change scratch.
|
|
185
|
+
result[0] = ax;
|
|
186
|
+
result[1] = ay;
|
|
187
|
+
result[2] = az;
|
|
188
|
+
result[3] = 0;
|
|
189
|
+
result[4] = bx;
|
|
190
|
+
result[5] = by;
|
|
191
|
+
result[6] = bz;
|
|
192
|
+
result[7] = 0;
|
|
193
|
+
result[8] = cx;
|
|
194
|
+
result[9] = cy;
|
|
195
|
+
result[10] = cz;
|
|
196
|
+
result[11] = 0;
|
|
197
|
+
result[12] = x;
|
|
198
|
+
result[13] = y;
|
|
199
|
+
result[14] = z;
|
|
200
|
+
result[15] = 1;
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
function axisCode(axis: LocalFrameAxis): number {
|
|
204
|
+
switch (axis) {
|
|
205
|
+
case 'east':
|
|
206
|
+
return 1;
|
|
207
|
+
case 'west':
|
|
208
|
+
return -1;
|
|
209
|
+
case 'north':
|
|
210
|
+
return 2;
|
|
211
|
+
case 'south':
|
|
212
|
+
return -2;
|
|
213
|
+
case 'up':
|
|
214
|
+
return 3;
|
|
215
|
+
case 'down':
|
|
216
|
+
return -3;
|
|
217
|
+
default:
|
|
218
|
+
return 0;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function commitBasis(
|
|
222
|
+
result: LocalFrameBasis,
|
|
223
|
+
ex: number,
|
|
224
|
+
ey: number,
|
|
225
|
+
nz: number,
|
|
226
|
+
ux: number,
|
|
227
|
+
uy: number,
|
|
228
|
+
uz: number
|
|
229
|
+
): boolean {
|
|
230
|
+
if (
|
|
231
|
+
!Number.isFinite(ex) ||
|
|
232
|
+
!Number.isFinite(ey) ||
|
|
233
|
+
!Number.isFinite(nz) ||
|
|
234
|
+
!Number.isFinite(ux) ||
|
|
235
|
+
!Number.isFinite(uy) ||
|
|
236
|
+
!Number.isFinite(uz)
|
|
237
|
+
)
|
|
238
|
+
return false;
|
|
239
|
+
result.eastX = ex;
|
|
240
|
+
result.eastY = ey;
|
|
241
|
+
result.northZ = nz;
|
|
242
|
+
result.upX = ux;
|
|
243
|
+
result.upY = uy;
|
|
244
|
+
result.upZ = uz;
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
function commitPoint(result: LocalFramePoint, x: number, y: number, z: number): boolean {
|
|
248
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z)) return false;
|
|
249
|
+
result.x = x;
|
|
250
|
+
result.y = y;
|
|
251
|
+
result.z = z;
|
|
252
|
+
return true;
|
|
253
|
+
}
|
package/src/mat3.ts
CHANGED
package/src/mat4.ts
CHANGED
package/src/quat.ts
CHANGED