@galacean/engine-math 0.0.0-experimental-0.9-plus.5 → 0.0.0-experimental-1.0-xr.0
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/main.js +44 -0
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +44 -0
- package/dist/module.js +44 -0
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/types/CollisionUtil.d.ts +7 -0
package/dist/main.js
CHANGED
|
@@ -1128,6 +1128,50 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
1128
1128
|
return true;
|
|
1129
1129
|
};
|
|
1130
1130
|
/**
|
|
1131
|
+
* Get the containment type between a frustum and a point.
|
|
1132
|
+
* @param frustum - The frustum
|
|
1133
|
+
* @param point - The point
|
|
1134
|
+
* @returns The containment type
|
|
1135
|
+
*/ CollisionUtil.frustumContainsPoint = function frustumContainsPoint(frustum, point) {
|
|
1136
|
+
var distance = CollisionUtil.distancePlaneAndPoint(frustum.near, point);
|
|
1137
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1138
|
+
return exports.ContainmentType.Intersects;
|
|
1139
|
+
} else if (distance < 0) {
|
|
1140
|
+
return exports.ContainmentType.Disjoint;
|
|
1141
|
+
}
|
|
1142
|
+
distance = CollisionUtil.distancePlaneAndPoint(frustum.far, point);
|
|
1143
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1144
|
+
return exports.ContainmentType.Intersects;
|
|
1145
|
+
} else if (distance < 0) {
|
|
1146
|
+
return exports.ContainmentType.Disjoint;
|
|
1147
|
+
}
|
|
1148
|
+
distance = CollisionUtil.distancePlaneAndPoint(frustum.left, point);
|
|
1149
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1150
|
+
return exports.ContainmentType.Intersects;
|
|
1151
|
+
} else if (distance < 0) {
|
|
1152
|
+
return exports.ContainmentType.Disjoint;
|
|
1153
|
+
}
|
|
1154
|
+
distance = CollisionUtil.distancePlaneAndPoint(frustum.right, point);
|
|
1155
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1156
|
+
return exports.ContainmentType.Intersects;
|
|
1157
|
+
} else if (distance < 0) {
|
|
1158
|
+
return exports.ContainmentType.Disjoint;
|
|
1159
|
+
}
|
|
1160
|
+
distance = CollisionUtil.distancePlaneAndPoint(frustum.top, point);
|
|
1161
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1162
|
+
return exports.ContainmentType.Intersects;
|
|
1163
|
+
} else if (distance < 0) {
|
|
1164
|
+
return exports.ContainmentType.Disjoint;
|
|
1165
|
+
}
|
|
1166
|
+
distance = CollisionUtil.distancePlaneAndPoint(frustum.bottom, point);
|
|
1167
|
+
if (Math.abs(distance) < MathUtil.zeroTolerance) {
|
|
1168
|
+
return exports.ContainmentType.Intersects;
|
|
1169
|
+
} else if (distance < 0) {
|
|
1170
|
+
return exports.ContainmentType.Disjoint;
|
|
1171
|
+
}
|
|
1172
|
+
return exports.ContainmentType.Contains;
|
|
1173
|
+
};
|
|
1174
|
+
/**
|
|
1131
1175
|
* Get the containment type between a frustum and a box (AABB).
|
|
1132
1176
|
* @param frustum - The frustum
|
|
1133
1177
|
* @param box - The box
|