@galacean/engine-core 1.4.0-beta.1 → 1.4.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 +41 -35
- package/dist/main.js.map +1 -1
- package/dist/module.js +41 -35
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/physics/ContactPoint.d.ts +1 -1
- package/types/ui/UIUtils.d.ts +3 -1
package/dist/main.js
CHANGED
|
@@ -5865,8 +5865,6 @@ exports.Camera = /*#__PURE__*/ function(Component) {
|
|
|
5865
5865
|
//@ts-ignore
|
|
5866
5866
|
this._viewport._onValueChanged = null;
|
|
5867
5867
|
this.engine.canvas._sizeUpdateFlagManager.removeListener(this._onPixelViewportChanged);
|
|
5868
|
-
this._updateFlagManager = null;
|
|
5869
|
-
this._entity = null;
|
|
5870
5868
|
this._globalShaderMacro = null;
|
|
5871
5869
|
this._frustum = null;
|
|
5872
5870
|
this._renderPipeline = null;
|
|
@@ -10263,7 +10261,6 @@ exports.Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10263
10261
|
var material = materials[i];
|
|
10264
10262
|
material && this._addResourceReferCount(material, -1);
|
|
10265
10263
|
}
|
|
10266
|
-
this._entity = null;
|
|
10267
10264
|
this._globalShaderMacro = null;
|
|
10268
10265
|
this._bounds = null;
|
|
10269
10266
|
this._materials = null;
|
|
@@ -17620,7 +17617,6 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
17620
17617
|
this._setParent(null);
|
|
17621
17618
|
}
|
|
17622
17619
|
this.isActive = false;
|
|
17623
|
-
this._updateFlagManager = null;
|
|
17624
17620
|
};
|
|
17625
17621
|
/**
|
|
17626
17622
|
* @internal
|
|
@@ -20765,7 +20761,7 @@ exports.Collider = __decorate([
|
|
|
20765
20761
|
* Describes a contact point where the collision occurs.
|
|
20766
20762
|
*/ var ContactPoint = function ContactPoint() {
|
|
20767
20763
|
/** The position of the contact point between the shapes, in world space. */ this.position = new engineMath.Vector3();
|
|
20768
|
-
/** The normal of the contacting surfaces at the contact point. The normal direction points from the
|
|
20764
|
+
/** The normal of the contacting surfaces at the contact point. The normal direction points from the other shape to the self shape. */ this.normal = new engineMath.Vector3();
|
|
20769
20765
|
/** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */ this.impulse = new engineMath.Vector3();
|
|
20770
20766
|
};
|
|
20771
20767
|
|
|
@@ -20783,7 +20779,8 @@ exports.Collider = __decorate([
|
|
|
20783
20779
|
* You need to obtain the actual number of contact points from the function's return value.
|
|
20784
20780
|
*/ _proto.getContacts = function getContacts(outContacts) {
|
|
20785
20781
|
var nativeCollision = this._nativeCollision;
|
|
20786
|
-
var
|
|
20782
|
+
var smallerShapeId = Math.min(nativeCollision.shape0Id, nativeCollision.shape1Id);
|
|
20783
|
+
var factor = this.shape.id === smallerShapeId ? 1 : -1;
|
|
20787
20784
|
var nativeContactPoints = nativeCollision.getContacts();
|
|
20788
20785
|
var length = nativeContactPoints.size();
|
|
20789
20786
|
for(var i = 0; i < length; i++){
|
|
@@ -23364,6 +23361,8 @@ PointerEventEmitter._tempRay = new engineMath.Ray();
|
|
|
23364
23361
|
var currY = (latestEvent.clientY - top) * heightPixelRatio;
|
|
23365
23362
|
pointer.deltaPosition.set(currX - position.x, currY - position.y);
|
|
23366
23363
|
position.set(currX, currY);
|
|
23364
|
+
pointer.button = _pointerDec2BinMap[latestEvent.button] || PointerButton.None;
|
|
23365
|
+
pointer.pressedButtons = latestEvent.buttons;
|
|
23367
23366
|
for(var i = 0; i < length; i++){
|
|
23368
23367
|
var event = events[i];
|
|
23369
23368
|
switch(event.type){
|
|
@@ -24586,11 +24585,16 @@ var unlitVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#in
|
|
|
24586
24585
|
|
|
24587
24586
|
var UIUtils = /*#__PURE__*/ function() {
|
|
24588
24587
|
function UIUtils() {}
|
|
24589
|
-
UIUtils.renderOverlay = function renderOverlay(engine, uiCanvases) {
|
|
24588
|
+
UIUtils.renderOverlay = function renderOverlay(engine, scene, uiCanvases) {
|
|
24589
|
+
var canvas = engine.canvas, rhi = engine._hardwareRenderer, renderContext = engine._renderContext, batcherManager = engine._batcherManager;
|
|
24590
24590
|
var uiRenderQueue = this._renderQueue || (this._renderQueue = new RenderQueue(RenderQueueType.Transparent));
|
|
24591
24591
|
var virtualCamera = this._virtualCamera || (this._virtualCamera = new VirtualCamera());
|
|
24592
24592
|
var viewport = this._viewport || (this._viewport = new engineMath.Vector4(0, 0, 1, 1));
|
|
24593
|
-
|
|
24593
|
+
// @ts-ignore
|
|
24594
|
+
var camera = this._overlayCamera || (this._overlayCamera = new OverlayCamera());
|
|
24595
|
+
camera.engine = engine;
|
|
24596
|
+
camera.scene = scene;
|
|
24597
|
+
renderContext.camera = camera;
|
|
24594
24598
|
var _virtualCamera_projectionMatrix = virtualCamera.projectionMatrix, projectE = _virtualCamera_projectionMatrix.elements;
|
|
24595
24599
|
var _virtualCamera_viewMatrix = virtualCamera.viewMatrix, viewE = _virtualCamera_viewMatrix.elements;
|
|
24596
24600
|
projectE[0] = 2 / canvas.width, projectE[5] = 2 / canvas.height, projectE[10] = 0;
|
|
@@ -24598,8 +24602,8 @@ var UIUtils = /*#__PURE__*/ function() {
|
|
|
24598
24602
|
for(var i = 0, n = uiCanvases.length; i < n; i++){
|
|
24599
24603
|
var uiCanvas = uiCanvases.get(i);
|
|
24600
24604
|
if (uiCanvas) {
|
|
24601
|
-
var
|
|
24602
|
-
viewE[12] = -
|
|
24605
|
+
var position = uiCanvas.entity.transform.position;
|
|
24606
|
+
viewE[12] = -position.x, viewE[13] = -position.y;
|
|
24603
24607
|
engineMath.Matrix.multiply(virtualCamera.projectionMatrix, virtualCamera.viewMatrix, virtualCamera.viewProjectionMatrix);
|
|
24604
24608
|
renderContext.applyVirtualCamera(virtualCamera, false);
|
|
24605
24609
|
renderContext.rendererUpdateFlag |= ContextRendererUpdateFlag.ProjectionMatrix;
|
|
@@ -24615,6 +24619,14 @@ var UIUtils = /*#__PURE__*/ function() {
|
|
|
24615
24619
|
};
|
|
24616
24620
|
return UIUtils;
|
|
24617
24621
|
}();
|
|
24622
|
+
var OverlayCamera = function OverlayCamera() {
|
|
24623
|
+
// @ts-ignore
|
|
24624
|
+
this.instanceId = ++EngineObject._instanceIdCounter;
|
|
24625
|
+
this.shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
24626
|
+
this.enableFrustumCulling = true;
|
|
24627
|
+
this.cullingMask = Layer.Everything;
|
|
24628
|
+
this._globalShaderMacro = new ShaderMacroCollection();
|
|
24629
|
+
};
|
|
24618
24630
|
|
|
24619
24631
|
/**
|
|
24620
24632
|
* XRManager located in the main package, its implementation logic is XRManagerExtended in the sub-package engine-xr.
|
|
@@ -24941,25 +24953,25 @@ ShaderPool.init();
|
|
|
24941
24953
|
var cameras = componentsManager._activeCameras;
|
|
24942
24954
|
if (cameras.length === 0) {
|
|
24943
24955
|
Logger.debug("No active camera in scene.");
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
|
|
24953
|
-
|
|
24954
|
-
|
|
24955
|
-
}
|
|
24956
|
-
|
|
24957
|
-
|
|
24958
|
-
}
|
|
24956
|
+
} else {
|
|
24957
|
+
cameras.forEach(function(camera) {
|
|
24958
|
+
componentsManager.callCameraOnBeginRender(camera);
|
|
24959
|
+
// Update post process manager
|
|
24960
|
+
scene.postProcessManager._update(camera);
|
|
24961
|
+
camera.render();
|
|
24962
|
+
componentsManager.callCameraOnEndRender(camera);
|
|
24963
|
+
// Temp solution for webgl implement bug
|
|
24964
|
+
if (_this1._hardwareRenderer._options._forceFlush) {
|
|
24965
|
+
_this1._hardwareRenderer.flush();
|
|
24966
|
+
}
|
|
24967
|
+
}, function(camera, index) {
|
|
24968
|
+
camera._cameraIndex = index;
|
|
24969
|
+
});
|
|
24970
|
+
}
|
|
24959
24971
|
var uiCanvas = componentsManager._overlayCanvases;
|
|
24960
24972
|
if (uiCanvas.length > 0) {
|
|
24961
24973
|
componentsManager.sortOverlayUICanvases();
|
|
24962
|
-
UIUtils.renderOverlay(_this, uiCanvas);
|
|
24974
|
+
UIUtils.renderOverlay(_this, scene, uiCanvas);
|
|
24963
24975
|
}
|
|
24964
24976
|
};
|
|
24965
24977
|
var _this1 = this;
|
|
@@ -30135,11 +30147,7 @@ function _type_of(obj) {
|
|
|
30135
30147
|
if (transition.mute) continue;
|
|
30136
30148
|
if (transitionCollection.isSoloMode && !transition.solo) continue;
|
|
30137
30149
|
if (this._checkConditions(transition)) {
|
|
30138
|
-
|
|
30139
|
-
return transition;
|
|
30140
|
-
} else {
|
|
30141
|
-
return null;
|
|
30142
|
-
}
|
|
30150
|
+
return this._applyTransition(layerData, transition, aniUpdate);
|
|
30143
30151
|
}
|
|
30144
30152
|
}
|
|
30145
30153
|
};
|
|
@@ -30159,13 +30167,11 @@ function _type_of(obj) {
|
|
|
30159
30167
|
return true;
|
|
30160
30168
|
};
|
|
30161
30169
|
_proto._applyTransition = function _applyTransition(layerData, transition, aniUpdate) {
|
|
30162
|
-
// Need prepare first, it should crossFade when to exit
|
|
30163
|
-
var success = this._prepareCrossFadeByTransition(transition, layerData.layerIndex);
|
|
30164
30170
|
if (transition.isExit) {
|
|
30165
30171
|
this._checkAnyAndEntryState(layerData, 0, aniUpdate);
|
|
30166
|
-
return
|
|
30172
|
+
return null;
|
|
30167
30173
|
}
|
|
30168
|
-
return
|
|
30174
|
+
return this._prepareCrossFadeByTransition(transition, layerData.layerIndex) ? transition : null;
|
|
30169
30175
|
};
|
|
30170
30176
|
_proto._checkConditions = function _checkConditions(transition) {
|
|
30171
30177
|
var conditions = transition.conditions;
|