@galacean/engine 1.4.0-beta.2 → 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/browser.js +39 -27
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -10868,8 +10868,6 @@
|
|
|
10868
10868
|
//@ts-ignore
|
|
10869
10869
|
this._viewport._onValueChanged = null;
|
|
10870
10870
|
this.engine.canvas._sizeUpdateFlagManager.removeListener(this._onPixelViewportChanged);
|
|
10871
|
-
this._updateFlagManager = null;
|
|
10872
|
-
this._entity = null;
|
|
10873
10871
|
this._globalShaderMacro = null;
|
|
10874
10872
|
this._frustum = null;
|
|
10875
10873
|
this._renderPipeline = null;
|
|
@@ -15137,7 +15135,6 @@
|
|
|
15137
15135
|
var material = materials[i];
|
|
15138
15136
|
material && this._addResourceReferCount(material, -1);
|
|
15139
15137
|
}
|
|
15140
|
-
this._entity = null;
|
|
15141
15138
|
this._globalShaderMacro = null;
|
|
15142
15139
|
this._bounds = null;
|
|
15143
15140
|
this._materials = null;
|
|
@@ -22443,7 +22440,6 @@
|
|
|
22443
22440
|
this._setParent(null);
|
|
22444
22441
|
}
|
|
22445
22442
|
this.isActive = false;
|
|
22446
|
-
this._updateFlagManager = null;
|
|
22447
22443
|
};
|
|
22448
22444
|
/**
|
|
22449
22445
|
* @internal
|
|
@@ -25558,7 +25554,7 @@
|
|
|
25558
25554
|
* Describes a contact point where the collision occurs.
|
|
25559
25555
|
*/ var ContactPoint = function ContactPoint() {
|
|
25560
25556
|
/** The position of the contact point between the shapes, in world space. */ this.position = new Vector3();
|
|
25561
|
-
/** The normal of the contacting surfaces at the contact point. The normal direction points from the
|
|
25557
|
+
/** 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();
|
|
25562
25558
|
/** 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();
|
|
25563
25559
|
};
|
|
25564
25560
|
/**
|
|
@@ -25575,7 +25571,8 @@
|
|
|
25575
25571
|
* You need to obtain the actual number of contact points from the function's return value.
|
|
25576
25572
|
*/ _proto.getContacts = function getContacts(outContacts) {
|
|
25577
25573
|
var nativeCollision = this._nativeCollision;
|
|
25578
|
-
var
|
|
25574
|
+
var smallerShapeId = Math.min(nativeCollision.shape0Id, nativeCollision.shape1Id);
|
|
25575
|
+
var factor = this.shape.id === smallerShapeId ? 1 : -1;
|
|
25579
25576
|
var nativeContactPoints = nativeCollision.getContacts();
|
|
25580
25577
|
var length = nativeContactPoints.size();
|
|
25581
25578
|
for(var i = 0; i < length; i++){
|
|
@@ -28131,6 +28128,8 @@
|
|
|
28131
28128
|
var currY = (latestEvent.clientY - top) * heightPixelRatio;
|
|
28132
28129
|
pointer.deltaPosition.set(currX - position.x, currY - position.y);
|
|
28133
28130
|
position.set(currX, currY);
|
|
28131
|
+
pointer.button = _pointerDec2BinMap[latestEvent.button] || PointerButton.None;
|
|
28132
|
+
pointer.pressedButtons = latestEvent.buttons;
|
|
28134
28133
|
for(var i = 0; i < length; i++){
|
|
28135
28134
|
var event = events[i];
|
|
28136
28135
|
switch(event.type){
|
|
@@ -29298,11 +29297,16 @@
|
|
|
29298
29297
|
}();
|
|
29299
29298
|
var UIUtils = /*#__PURE__*/ function() {
|
|
29300
29299
|
function UIUtils() {}
|
|
29301
|
-
UIUtils.renderOverlay = function renderOverlay(engine, uiCanvases) {
|
|
29300
|
+
UIUtils.renderOverlay = function renderOverlay(engine, scene, uiCanvases) {
|
|
29301
|
+
var canvas = engine.canvas, rhi = engine._hardwareRenderer, renderContext = engine._renderContext, batcherManager = engine._batcherManager;
|
|
29302
29302
|
var uiRenderQueue = this._renderQueue || (this._renderQueue = new RenderQueue(RenderQueueType.Transparent));
|
|
29303
29303
|
var virtualCamera = this._virtualCamera || (this._virtualCamera = new VirtualCamera());
|
|
29304
29304
|
var viewport = this._viewport || (this._viewport = new Vector4(0, 0, 1, 1));
|
|
29305
|
-
|
|
29305
|
+
// @ts-ignore
|
|
29306
|
+
var camera = this._overlayCamera || (this._overlayCamera = new OverlayCamera());
|
|
29307
|
+
camera.engine = engine;
|
|
29308
|
+
camera.scene = scene;
|
|
29309
|
+
renderContext.camera = camera;
|
|
29306
29310
|
var _virtualCamera_projectionMatrix = virtualCamera.projectionMatrix, projectE = _virtualCamera_projectionMatrix.elements;
|
|
29307
29311
|
var _virtualCamera_viewMatrix = virtualCamera.viewMatrix, viewE = _virtualCamera_viewMatrix.elements;
|
|
29308
29312
|
projectE[0] = 2 / canvas.width, projectE[5] = 2 / canvas.height, projectE[10] = 0;
|
|
@@ -29310,8 +29314,8 @@
|
|
|
29310
29314
|
for(var i = 0, n = uiCanvases.length; i < n; i++){
|
|
29311
29315
|
var uiCanvas = uiCanvases.get(i);
|
|
29312
29316
|
if (uiCanvas) {
|
|
29313
|
-
var
|
|
29314
|
-
viewE[12] = -
|
|
29317
|
+
var position = uiCanvas.entity.transform.position;
|
|
29318
|
+
viewE[12] = -position.x, viewE[13] = -position.y;
|
|
29315
29319
|
Matrix.multiply(virtualCamera.projectionMatrix, virtualCamera.viewMatrix, virtualCamera.viewProjectionMatrix);
|
|
29316
29320
|
renderContext.applyVirtualCamera(virtualCamera, false);
|
|
29317
29321
|
renderContext.rendererUpdateFlag |= ContextRendererUpdateFlag.ProjectionMatrix;
|
|
@@ -29327,6 +29331,14 @@
|
|
|
29327
29331
|
};
|
|
29328
29332
|
return UIUtils;
|
|
29329
29333
|
}();
|
|
29334
|
+
var OverlayCamera = function OverlayCamera() {
|
|
29335
|
+
// @ts-ignore
|
|
29336
|
+
this.instanceId = ++EngineObject._instanceIdCounter;
|
|
29337
|
+
this.shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
29338
|
+
this.enableFrustumCulling = true;
|
|
29339
|
+
this.cullingMask = Layer.Everything;
|
|
29340
|
+
this._globalShaderMacro = new ShaderMacroCollection();
|
|
29341
|
+
};
|
|
29330
29342
|
/**
|
|
29331
29343
|
* XRManager located in the main package, its implementation logic is XRManagerExtended in the sub-package engine-xr.
|
|
29332
29344
|
*/ var XRManager = /*#__PURE__*/ function() {
|
|
@@ -29651,25 +29663,25 @@
|
|
|
29651
29663
|
var cameras = componentsManager._activeCameras;
|
|
29652
29664
|
if (cameras.length === 0) {
|
|
29653
29665
|
Logger.debug("No active camera in scene.");
|
|
29654
|
-
|
|
29655
|
-
|
|
29656
|
-
|
|
29657
|
-
|
|
29658
|
-
|
|
29659
|
-
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29663
|
-
|
|
29664
|
-
|
|
29665
|
-
}
|
|
29666
|
-
|
|
29667
|
-
|
|
29668
|
-
}
|
|
29666
|
+
} else {
|
|
29667
|
+
cameras.forEach(function(camera) {
|
|
29668
|
+
componentsManager.callCameraOnBeginRender(camera);
|
|
29669
|
+
// Update post process manager
|
|
29670
|
+
scene.postProcessManager._update(camera);
|
|
29671
|
+
camera.render();
|
|
29672
|
+
componentsManager.callCameraOnEndRender(camera);
|
|
29673
|
+
// Temp solution for webgl implement bug
|
|
29674
|
+
if (_this1._hardwareRenderer._options._forceFlush) {
|
|
29675
|
+
_this1._hardwareRenderer.flush();
|
|
29676
|
+
}
|
|
29677
|
+
}, function(camera, index) {
|
|
29678
|
+
camera._cameraIndex = index;
|
|
29679
|
+
});
|
|
29680
|
+
}
|
|
29669
29681
|
var uiCanvas = componentsManager._overlayCanvases;
|
|
29670
29682
|
if (uiCanvas.length > 0) {
|
|
29671
29683
|
componentsManager.sortOverlayUICanvases();
|
|
29672
|
-
UIUtils.renderOverlay(_this, uiCanvas);
|
|
29684
|
+
UIUtils.renderOverlay(_this, scene, uiCanvas);
|
|
29673
29685
|
}
|
|
29674
29686
|
};
|
|
29675
29687
|
var _this1 = this;
|
|
@@ -49945,7 +49957,7 @@
|
|
|
49945
49957
|
], EXT_texture_webp);
|
|
49946
49958
|
|
|
49947
49959
|
//@ts-ignore
|
|
49948
|
-
var version = "1.4.0
|
|
49960
|
+
var version = "1.4.0";
|
|
49949
49961
|
console.log("Galacean engine version: " + version);
|
|
49950
49962
|
for(var key in CoreObjects){
|
|
49951
49963
|
Loader.registerClass(key, CoreObjects[key]);
|