@galacean/engine-core 1.1.0-beta.47 → 1.1.0-beta.49
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 +7 -3
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +7 -3
- package/dist/module.js +7 -3
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/physics/HitResult.d.ts +3 -0
package/dist/miniprogram.js
CHANGED
|
@@ -14488,7 +14488,9 @@ var Collision = function Collision() {
|
|
|
14488
14488
|
};
|
|
14489
14489
|
if (hitResult != undefined) {
|
|
14490
14490
|
var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
|
|
14491
|
-
|
|
14491
|
+
var hitShape = _this._scene.engine._physicalObjectsMap[idx];
|
|
14492
|
+
hitResult.entity = hitShape._collider.entity;
|
|
14493
|
+
hitResult.shape = hitShape;
|
|
14492
14494
|
hitResult.distance = distance;
|
|
14493
14495
|
hitResult.normal.copyFrom(normal);
|
|
14494
14496
|
hitResult.point.copyFrom(position);
|
|
@@ -14497,6 +14499,7 @@ var Collision = function Collision() {
|
|
|
14497
14499
|
return true;
|
|
14498
14500
|
} else {
|
|
14499
14501
|
hitResult.entity = null;
|
|
14502
|
+
hitResult.shape = null;
|
|
14500
14503
|
hitResult.distance = 0;
|
|
14501
14504
|
hitResult.point.set(0, 0, 0);
|
|
14502
14505
|
hitResult.normal.set(0, 0, 0);
|
|
@@ -15158,6 +15161,7 @@ exports.DynamicColliderConstraints = void 0;
|
|
|
15158
15161
|
/** The distance from the ray's origin to the impact point. */ this.distance = 0;
|
|
15159
15162
|
/** The impact point in world space where the ray hit the collider. */ this.point = new miniprogram.Vector3();
|
|
15160
15163
|
/** The normal of the surface the ray hit. */ this.normal = new miniprogram.Vector3();
|
|
15164
|
+
/** The shape of the collider that was hit. */ this.shape = null;
|
|
15161
15165
|
};
|
|
15162
15166
|
|
|
15163
15167
|
/**
|
|
@@ -22032,7 +22036,7 @@ var passNum = 0;
|
|
|
22032
22036
|
}
|
|
22033
22037
|
// make suer from the same renderer.
|
|
22034
22038
|
if (componentA.instanceId === componentB.instanceId) {
|
|
22035
|
-
return dataA.material._priority - dataB.material._priority
|
|
22039
|
+
return dataA.material._priority - dataB.material._priority;
|
|
22036
22040
|
} else {
|
|
22037
22041
|
var distanceDiff = componentA._distanceForSort - componentB._distanceForSort;
|
|
22038
22042
|
if (distanceDiff === 0) {
|
|
@@ -22055,7 +22059,7 @@ var passNum = 0;
|
|
|
22055
22059
|
}
|
|
22056
22060
|
// make suer from the same renderer.
|
|
22057
22061
|
if (componentA.instanceId === componentB.instanceId) {
|
|
22058
|
-
return dataA.material._priority - dataB.material._priority
|
|
22062
|
+
return dataA.material._priority - dataB.material._priority;
|
|
22059
22063
|
} else {
|
|
22060
22064
|
var distanceDiff = componentB._distanceForSort - componentA._distanceForSort;
|
|
22061
22065
|
if (distanceDiff === 0) {
|
package/dist/module.js
CHANGED
|
@@ -14483,7 +14483,9 @@ var Collision = function Collision() {
|
|
|
14483
14483
|
};
|
|
14484
14484
|
if (hitResult != undefined) {
|
|
14485
14485
|
var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
|
|
14486
|
-
|
|
14486
|
+
var hitShape = _this._scene.engine._physicalObjectsMap[idx];
|
|
14487
|
+
hitResult.entity = hitShape._collider.entity;
|
|
14488
|
+
hitResult.shape = hitShape;
|
|
14487
14489
|
hitResult.distance = distance;
|
|
14488
14490
|
hitResult.normal.copyFrom(normal);
|
|
14489
14491
|
hitResult.point.copyFrom(position);
|
|
@@ -14492,6 +14494,7 @@ var Collision = function Collision() {
|
|
|
14492
14494
|
return true;
|
|
14493
14495
|
} else {
|
|
14494
14496
|
hitResult.entity = null;
|
|
14497
|
+
hitResult.shape = null;
|
|
14495
14498
|
hitResult.distance = 0;
|
|
14496
14499
|
hitResult.point.set(0, 0, 0);
|
|
14497
14500
|
hitResult.normal.set(0, 0, 0);
|
|
@@ -15153,6 +15156,7 @@ var DynamicColliderConstraints;
|
|
|
15153
15156
|
/** The distance from the ray's origin to the impact point. */ this.distance = 0;
|
|
15154
15157
|
/** The impact point in world space where the ray hit the collider. */ this.point = new Vector3();
|
|
15155
15158
|
/** The normal of the surface the ray hit. */ this.normal = new Vector3();
|
|
15159
|
+
/** The shape of the collider that was hit. */ this.shape = null;
|
|
15156
15160
|
};
|
|
15157
15161
|
|
|
15158
15162
|
/**
|
|
@@ -22027,7 +22031,7 @@ var passNum = 0;
|
|
|
22027
22031
|
}
|
|
22028
22032
|
// make suer from the same renderer.
|
|
22029
22033
|
if (componentA.instanceId === componentB.instanceId) {
|
|
22030
|
-
return dataA.material._priority - dataB.material._priority
|
|
22034
|
+
return dataA.material._priority - dataB.material._priority;
|
|
22031
22035
|
} else {
|
|
22032
22036
|
var distanceDiff = componentA._distanceForSort - componentB._distanceForSort;
|
|
22033
22037
|
if (distanceDiff === 0) {
|
|
@@ -22050,7 +22054,7 @@ var passNum = 0;
|
|
|
22050
22054
|
}
|
|
22051
22055
|
// make suer from the same renderer.
|
|
22052
22056
|
if (componentA.instanceId === componentB.instanceId) {
|
|
22053
|
-
return dataA.material._priority - dataB.material._priority
|
|
22057
|
+
return dataA.material._priority - dataB.material._priority;
|
|
22054
22058
|
} else {
|
|
22055
22059
|
var distanceDiff = componentB._distanceForSort - componentA._distanceForSort;
|
|
22056
22060
|
if (distanceDiff === 0) {
|