Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest main to dev/0.7 #751

Merged
merged 24 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2eccca9
fix: normal attributer is need in unlit (#637)
zhuxudong Feb 17, 2022
b28c936
fix: physx bug (#651)
yangfengzzz Feb 17, 2022
55ce80f
v0.6.7
GuoLei1990 Feb 17, 2022
a704854
fix: get pixel buffer use mip level should right shift (#656)
gz65555 Mar 2, 2022
070e621
Update AnimatorState.ts (#657)
luzhuang Mar 2, 2022
ffe530c
Rename `ability` to `component`. (#608)
eyworldwide Mar 2, 2022
bec99aa
fix: resize max uniform vector count (#660)
zhuxudong Mar 2, 2022
339a4a5
fix(2d): can not update world position for sprite renderer when call …
singlecoder Mar 3, 2022
5140986
refactor: remove Promise.finally (#671)
Cleam Mar 3, 2022
5de3857
fix: use linear color space in gltf (#674)
zhuxudong Mar 4, 2022
16baed7
Fix Background Draw (#675)
gz65555 Mar 4, 2022
1eff3c2
fix: break texcoor to avoid `_vertexSlotChanged` error (#684)
zhuxudong Mar 10, 2022
89ad3eb
v0.6.8
GuoLei1990 Mar 14, 2022
b940b04
fix: scene romove entity bug (#698)
GuoLei1990 Mar 21, 2022
89f7517
fix: position is deleted from entity (#699)
zhuxudong Mar 22, 2022
f077f1b
fix: make free control not depend on scene (#724)
zhuxudong Apr 2, 2022
c2e238e
refactor: opt code
GuoLei1990 Apr 20, 2022
9112ca8
Merge branch 'dev/0.7' of github.com:oasis-engine/engine into dev/0.7
GuoLei1990 Apr 21, 2022
e528ee3
fix: constrain min shininess to `1e-4` (#749)
susiwen8 Apr 22, 2022
94a6a75
Merge branch 'dev/0.7' of github.com:oasis-engine/engine into dev/0.7
GuoLei1990 Apr 22, 2022
470117a
Add a ts-ignore (#679)
eyworldwide Apr 22, 2022
4e28061
Merge branch 'main' into dev/0.7
GuoLei1990 Apr 22, 2022
a904314
refactor: fix code
GuoLei1990 Apr 22, 2022
2cf421b
refactor: opt code
GuoLei1990 Apr 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/controls/src/FreeControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class FreeControl extends Script {
this.camera = entity;
// @ts-ignore
// @todo In the future, the dependence on html elements will be removed and realized through the input of the packaging engine.
this.mainElement = this.scene.engine.canvas._webCanvas;
this.mainElement = this.engine.canvas._webCanvas;
this.domElement = document;

this.movementSpeed = 1.0;
Expand Down
10 changes: 6 additions & 4 deletions packages/core/src/RenderPipeline/BasicRenderPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ export class BasicRenderPipeline {
} else {
this._opaqueQueue.render(camera, pass.replaceMaterial, pass.mask);
this._alphaTestQueue.render(camera, pass.replaceMaterial, pass.mask);
if (background.mode === BackgroundMode.Sky) {
this._drawSky(engine, camera, background.sky);
} else if (background.mode === BackgroundMode.Texture && background.texture) {
this._drawBackgroundTexture(engine, background);
if (camera.clearFlags === CameraClearFlags.DepthColor) {
if (background.mode === BackgroundMode.Sky) {
this._drawSky(engine, camera, background.sky);
} else if (background.mode === BackgroundMode.Texture && background.texture) {
this._drawBackgroundTexture(engine, background);
}
}
this._transparentQueue.render(camera, pass.replaceMaterial, pass.mask);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class Scene extends EngineObject {
removeRootEntity(entity: Entity): void {
if (entity._isRoot && entity._scene == this) {
this._removeEntity(entity);
this._isActiveInEngine && entity._processInActive();
this._isActiveInEngine && entity._isActiveInHierarchy && entity._processInActive();
Entity._traverseSetOwnerScene(entity, null);
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/asset/ResourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ export class ResourceManager {
promise
.then((res: EngineObject) => {
if (loader.useCache) this._addAsset(url, res);
delete this._loadingPromises[url];
})
.catch((err: Error) => Promise.reject(err))
.finally(() => {
.catch((err: Error) => {
Promise.reject(err)
delete this._loadingPromises[url];
});
return promise;
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/asset/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ function requestRes<T>(url: string, config: RequestConfig): AssetPromise<T> {
xhr.setRequestHeader(name, headers[name]);
});
}
xhr.send(config.body as any);
// @ts-ignore
xhr.send(config.body as XMLHttpRequestBodyInit);
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/material/BlinnPhongMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class BlinnPhongMaterial extends BaseMaterial {
}

set shininess(value: number) {
this.shaderData.setFloat(BlinnPhongMaterial._shininessProp, value);
this.shaderData.setFloat(BlinnPhongMaterial._shininessProp, Math.max(value, 1e-4));
}

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/core/tests/material/BlinnPhongMaterial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ describe("BlinnPhongMaterial", () => {
material.specularTexture = null;
material.emissiveTexture = null;
material.normalTexture = null;
material.shininess = 0;

expect(material.baseTexture).toBeNull();
expect(material.specularTexture).toBeNull();
expect(material.emissiveTexture).toBeNull();
expect(material.normalTexture).toBeNull();
expect(material.shininess).toBe(1e-4);
});

it("clone", () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/loader/src/gltf/parser/MeshParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,19 @@ export class MeshParser extends Parser {
case "TEXCOORD_3":
const texturecoords3 = GLTFUtil.floatBufferToVector2Array(<Float32Array>bufferData);
mesh.setUVs(texturecoords3, 3);
break;
case "TEXCOORD_4":
const texturecoords4 = GLTFUtil.floatBufferToVector2Array(<Float32Array>bufferData);
mesh.setUVs(texturecoords4, 4);
break;
case "TEXCOORD_5":
const texturecoords5 = GLTFUtil.floatBufferToVector2Array(<Float32Array>bufferData);
mesh.setUVs(texturecoords5, 5);
break;
case "TEXCOORD_6":
const texturecoords6 = GLTFUtil.floatBufferToVector2Array(<Float32Array>bufferData);
mesh.setUVs(texturecoords6, 6);
break;
case "TEXCOORD_7":
const texturecoords7 = GLTFUtil.floatBufferToVector2Array(<Float32Array>bufferData);
mesh.setUVs(texturecoords7, 7);
Expand Down
2 changes: 1 addition & 1 deletion packages/physics-physx/src/shape/PhysXBoxColliderShape.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IBoxColliderShape } from "@oasis-engine/design";
import { Vector3 } from "oasis-engine";
import { PhysXPhysics } from "../PhysXPhysics";
import { PhysXColliderShape } from "./PhysXColliderShape";
import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial";
import { PhysXColliderShape } from "./PhysXColliderShape";

/**
* Box collider shape in PhysX.
Expand Down