@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/module.js
CHANGED
|
@@ -5861,8 +5861,6 @@ var Camera = /*#__PURE__*/ function(Component) {
|
|
|
5861
5861
|
//@ts-ignore
|
|
5862
5862
|
this._viewport._onValueChanged = null;
|
|
5863
5863
|
this.engine.canvas._sizeUpdateFlagManager.removeListener(this._onPixelViewportChanged);
|
|
5864
|
-
this._updateFlagManager = null;
|
|
5865
|
-
this._entity = null;
|
|
5866
5864
|
this._globalShaderMacro = null;
|
|
5867
5865
|
this._frustum = null;
|
|
5868
5866
|
this._renderPipeline = null;
|
|
@@ -10259,7 +10257,6 @@ var Renderer = /*#__PURE__*/ function(Component) {
|
|
|
10259
10257
|
var material = materials[i];
|
|
10260
10258
|
material && this._addResourceReferCount(material, -1);
|
|
10261
10259
|
}
|
|
10262
|
-
this._entity = null;
|
|
10263
10260
|
this._globalShaderMacro = null;
|
|
10264
10261
|
this._bounds = null;
|
|
10265
10262
|
this._materials = null;
|
|
@@ -17616,7 +17613,6 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
17616
17613
|
this._setParent(null);
|
|
17617
17614
|
}
|
|
17618
17615
|
this.isActive = false;
|
|
17619
|
-
this._updateFlagManager = null;
|
|
17620
17616
|
};
|
|
17621
17617
|
/**
|
|
17622
17618
|
* @internal
|
|
@@ -20761,7 +20757,7 @@ Collider = __decorate([
|
|
|
20761
20757
|
* Describes a contact point where the collision occurs.
|
|
20762
20758
|
*/ var ContactPoint = function ContactPoint() {
|
|
20763
20759
|
/** The position of the contact point between the shapes, in world space. */ this.position = new Vector3();
|
|
20764
|
-
/** The normal of the contacting surfaces at the contact point. The normal direction points from the
|
|
20760
|
+
/** 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 Vector3();
|
|
20765
20761
|
/** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */ this.impulse = new Vector3();
|
|
20766
20762
|
};
|
|
20767
20763
|
|
|
@@ -20779,7 +20775,8 @@ Collider = __decorate([
|
|
|
20779
20775
|
* You need to obtain the actual number of contact points from the function's return value.
|
|
20780
20776
|
*/ _proto.getContacts = function getContacts(outContacts) {
|
|
20781
20777
|
var nativeCollision = this._nativeCollision;
|
|
20782
|
-
var
|
|
20778
|
+
var smallerShapeId = Math.min(nativeCollision.shape0Id, nativeCollision.shape1Id);
|
|
20779
|
+
var factor = this.shape.id === smallerShapeId ? 1 : -1;
|
|
20783
20780
|
var nativeContactPoints = nativeCollision.getContacts();
|
|
20784
20781
|
var length = nativeContactPoints.size();
|
|
20785
20782
|
for(var i = 0; i < length; i++){
|
|
@@ -23360,6 +23357,8 @@ PointerEventEmitter._tempRay = new Ray();
|
|
|
23360
23357
|
var currY = (latestEvent.clientY - top) * heightPixelRatio;
|
|
23361
23358
|
pointer.deltaPosition.set(currX - position.x, currY - position.y);
|
|
23362
23359
|
position.set(currX, currY);
|
|
23360
|
+
pointer.button = _pointerDec2BinMap[latestEvent.button] || PointerButton.None;
|
|
23361
|
+
pointer.pressedButtons = latestEvent.buttons;
|
|
23363
23362
|
for(var i = 0; i < length; i++){
|
|
23364
23363
|
var event = events[i];
|
|
23365
23364
|
switch(event.type){
|
|
@@ -24582,11 +24581,16 @@ var unlitVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#in
|
|
|
24582
24581
|
|
|
24583
24582
|
var UIUtils = /*#__PURE__*/ function() {
|
|
24584
24583
|
function UIUtils() {}
|
|
24585
|
-
UIUtils.renderOverlay = function renderOverlay(engine, uiCanvases) {
|
|
24584
|
+
UIUtils.renderOverlay = function renderOverlay(engine, scene, uiCanvases) {
|
|
24585
|
+
var canvas = engine.canvas, rhi = engine._hardwareRenderer, renderContext = engine._renderContext, batcherManager = engine._batcherManager;
|
|
24586
24586
|
var uiRenderQueue = this._renderQueue || (this._renderQueue = new RenderQueue(RenderQueueType.Transparent));
|
|
24587
24587
|
var virtualCamera = this._virtualCamera || (this._virtualCamera = new VirtualCamera());
|
|
24588
24588
|
var viewport = this._viewport || (this._viewport = new Vector4(0, 0, 1, 1));
|
|
24589
|
-
|
|
24589
|
+
// @ts-ignore
|
|
24590
|
+
var camera = this._overlayCamera || (this._overlayCamera = new OverlayCamera());
|
|
24591
|
+
camera.engine = engine;
|
|
24592
|
+
camera.scene = scene;
|
|
24593
|
+
renderContext.camera = camera;
|
|
24590
24594
|
var _virtualCamera_projectionMatrix = virtualCamera.projectionMatrix, projectE = _virtualCamera_projectionMatrix.elements;
|
|
24591
24595
|
var _virtualCamera_viewMatrix = virtualCamera.viewMatrix, viewE = _virtualCamera_viewMatrix.elements;
|
|
24592
24596
|
projectE[0] = 2 / canvas.width, projectE[5] = 2 / canvas.height, projectE[10] = 0;
|
|
@@ -24594,8 +24598,8 @@ var UIUtils = /*#__PURE__*/ function() {
|
|
|
24594
24598
|
for(var i = 0, n = uiCanvases.length; i < n; i++){
|
|
24595
24599
|
var uiCanvas = uiCanvases.get(i);
|
|
24596
24600
|
if (uiCanvas) {
|
|
24597
|
-
var
|
|
24598
|
-
viewE[12] = -
|
|
24601
|
+
var position = uiCanvas.entity.transform.position;
|
|
24602
|
+
viewE[12] = -position.x, viewE[13] = -position.y;
|
|
24599
24603
|
Matrix.multiply(virtualCamera.projectionMatrix, virtualCamera.viewMatrix, virtualCamera.viewProjectionMatrix);
|
|
24600
24604
|
renderContext.applyVirtualCamera(virtualCamera, false);
|
|
24601
24605
|
renderContext.rendererUpdateFlag |= ContextRendererUpdateFlag.ProjectionMatrix;
|
|
@@ -24611,6 +24615,14 @@ var UIUtils = /*#__PURE__*/ function() {
|
|
|
24611
24615
|
};
|
|
24612
24616
|
return UIUtils;
|
|
24613
24617
|
}();
|
|
24618
|
+
var OverlayCamera = function OverlayCamera() {
|
|
24619
|
+
// @ts-ignore
|
|
24620
|
+
this.instanceId = ++EngineObject._instanceIdCounter;
|
|
24621
|
+
this.shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
24622
|
+
this.enableFrustumCulling = true;
|
|
24623
|
+
this.cullingMask = Layer.Everything;
|
|
24624
|
+
this._globalShaderMacro = new ShaderMacroCollection();
|
|
24625
|
+
};
|
|
24614
24626
|
|
|
24615
24627
|
/**
|
|
24616
24628
|
* XRManager located in the main package, its implementation logic is XRManagerExtended in the sub-package engine-xr.
|
|
@@ -24937,25 +24949,25 @@ ShaderPool.init();
|
|
|
24937
24949
|
var cameras = componentsManager._activeCameras;
|
|
24938
24950
|
if (cameras.length === 0) {
|
|
24939
24951
|
Logger.debug("No active camera in scene.");
|
|
24940
|
-
|
|
24941
|
-
|
|
24942
|
-
|
|
24943
|
-
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
}
|
|
24952
|
-
|
|
24953
|
-
|
|
24954
|
-
}
|
|
24952
|
+
} else {
|
|
24953
|
+
cameras.forEach(function(camera) {
|
|
24954
|
+
componentsManager.callCameraOnBeginRender(camera);
|
|
24955
|
+
// Update post process manager
|
|
24956
|
+
scene.postProcessManager._update(camera);
|
|
24957
|
+
camera.render();
|
|
24958
|
+
componentsManager.callCameraOnEndRender(camera);
|
|
24959
|
+
// Temp solution for webgl implement bug
|
|
24960
|
+
if (_this1._hardwareRenderer._options._forceFlush) {
|
|
24961
|
+
_this1._hardwareRenderer.flush();
|
|
24962
|
+
}
|
|
24963
|
+
}, function(camera, index) {
|
|
24964
|
+
camera._cameraIndex = index;
|
|
24965
|
+
});
|
|
24966
|
+
}
|
|
24955
24967
|
var uiCanvas = componentsManager._overlayCanvases;
|
|
24956
24968
|
if (uiCanvas.length > 0) {
|
|
24957
24969
|
componentsManager.sortOverlayUICanvases();
|
|
24958
|
-
UIUtils.renderOverlay(_this, uiCanvas);
|
|
24970
|
+
UIUtils.renderOverlay(_this, scene, uiCanvas);
|
|
24959
24971
|
}
|
|
24960
24972
|
};
|
|
24961
24973
|
var _this1 = this;
|
|
@@ -30131,11 +30143,7 @@ function _type_of(obj) {
|
|
|
30131
30143
|
if (transition.mute) continue;
|
|
30132
30144
|
if (transitionCollection.isSoloMode && !transition.solo) continue;
|
|
30133
30145
|
if (this._checkConditions(transition)) {
|
|
30134
|
-
|
|
30135
|
-
return transition;
|
|
30136
|
-
} else {
|
|
30137
|
-
return null;
|
|
30138
|
-
}
|
|
30146
|
+
return this._applyTransition(layerData, transition, aniUpdate);
|
|
30139
30147
|
}
|
|
30140
30148
|
}
|
|
30141
30149
|
};
|
|
@@ -30155,13 +30163,11 @@ function _type_of(obj) {
|
|
|
30155
30163
|
return true;
|
|
30156
30164
|
};
|
|
30157
30165
|
_proto._applyTransition = function _applyTransition(layerData, transition, aniUpdate) {
|
|
30158
|
-
// Need prepare first, it should crossFade when to exit
|
|
30159
|
-
var success = this._prepareCrossFadeByTransition(transition, layerData.layerIndex);
|
|
30160
30166
|
if (transition.isExit) {
|
|
30161
30167
|
this._checkAnyAndEntryState(layerData, 0, aniUpdate);
|
|
30162
|
-
return
|
|
30168
|
+
return null;
|
|
30163
30169
|
}
|
|
30164
|
-
return
|
|
30170
|
+
return this._prepareCrossFadeByTransition(transition, layerData.layerIndex) ? transition : null;
|
|
30165
30171
|
};
|
|
30166
30172
|
_proto._checkConditions = function _checkConditions(transition) {
|
|
30167
30173
|
var conditions = transition.conditions;
|