@vertexvis/geometry 0.21.1-testing.4 → 0.21.1-testing.6
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/dist/bundle.cjs.js +27 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +27 -1
- package/dist/bundle.esm.js.map +1 -1
- package/dist/cdn/bundle.esm.js +27 -1
- package/dist/cdn/bundle.esm.js.map +1 -1
- package/dist/cdn/bundle.esm.min.js +2 -2
- package/dist/cdn/bundle.esm.min.js.map +1 -1
- package/dist/cdn/matrix4.d.ts +14 -0
- package/dist/cdn/vector3.d.ts +0 -1
- package/dist/matrix4.d.ts +14 -0
- package/dist/vector3.d.ts +0 -1
- package/package.json +3 -3
package/dist/cdn/bundle.esm.js
CHANGED
|
@@ -588,6 +588,32 @@ function makeLookAtView(position, lookAt, up) {
|
|
|
588
588
|
];
|
|
589
589
|
/* eslint-enable prettier/prettier */
|
|
590
590
|
}
|
|
591
|
+
/**
|
|
592
|
+
* Matrix becomes a combination of translation and rotation.
|
|
593
|
+
*
|
|
594
|
+
* Matrix becomes a combination of a translation to the position of 'eye' and a
|
|
595
|
+
* rotation matrix which orients an object to point towards 'center' along its
|
|
596
|
+
* z-axis. Use this function if you want an object to look at a point from
|
|
597
|
+
* another point in space.
|
|
598
|
+
*
|
|
599
|
+
* @param position The position of the object.
|
|
600
|
+
* @param lookAt The point which the object is looking at.
|
|
601
|
+
* @param up The direction which the object considers up.
|
|
602
|
+
* @returns A matrix.
|
|
603
|
+
*/
|
|
604
|
+
function makeLookAt(position, lookAt, up) {
|
|
605
|
+
var z = normalize(subtract(position, lookAt));
|
|
606
|
+
var x = normalize(cross(up, z));
|
|
607
|
+
var y = cross(z, x);
|
|
608
|
+
/* eslint-disable prettier/prettier */
|
|
609
|
+
return [
|
|
610
|
+
x.x, x.y, x.z, 0,
|
|
611
|
+
y.x, y.y, y.z, 0,
|
|
612
|
+
z.x, z.y, z.z, 0,
|
|
613
|
+
position.x, position.y, position.z, 1
|
|
614
|
+
];
|
|
615
|
+
/* eslint-enable prettier/prettier */
|
|
616
|
+
}
|
|
591
617
|
/**
|
|
592
618
|
* Returns the inverse of the given matrix. If the determinate of the matrix is
|
|
593
619
|
* zero, then a zero matrix is returned.
|
|
@@ -796,6 +822,7 @@ var matrix4 = /*#__PURE__*/Object.freeze({
|
|
|
796
822
|
makePerspective: makePerspective,
|
|
797
823
|
makeOrthographic: makeOrthographic,
|
|
798
824
|
makeLookAtView: makeLookAtView,
|
|
825
|
+
makeLookAt: makeLookAt,
|
|
799
826
|
invert: invert,
|
|
800
827
|
lookAt: lookAt,
|
|
801
828
|
multiply: multiply$2,
|
|
@@ -1474,7 +1501,6 @@ function rotateAboutAxis(angle, point, axisDirection, axisPosition) {
|
|
|
1474
1501
|
}
|
|
1475
1502
|
/**
|
|
1476
1503
|
* Returns a vector that is multiplied with a matrix.
|
|
1477
|
-
* Is it v*m or m*v?
|
|
1478
1504
|
*/
|
|
1479
1505
|
function transformMatrix$1(vector, m) {
|
|
1480
1506
|
var x = vector.x, y = vector.y, z = vector.z;
|