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 main to dev/0.5 #472

Merged
merged 82 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9e9d6d9
refactor(2d): opt pixels per unit value
singlecoder Apr 12, 2021
53fe76a
refactor(2d): change rect to region in Sprite
singlecoder Apr 12, 2021
fea984a
refactor(2d): modify recomment
singlecoder Apr 12, 2021
ba38c08
fix: fix conflicts
singlecoder Apr 22, 2021
6795be8
perf(renderqueue): opt the problem of unstable sorting in the renderi…
singlecoder Apr 22, 2021
ce6999f
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder Apr 27, 2021
0f6145a
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 7, 2021
dd4d0ed
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 10, 2021
2eda587
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 10, 2021
d41e7bc
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 20, 2021
b436ed9
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 21, 2021
43b176c
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 26, 2021
aead8f5
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder May 28, 2021
c764159
refactor: fix gltf is not show
gz65555 May 31, 2021
f1757a3
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder Jun 8, 2021
27dc97d
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder Jun 10, 2021
d78bfda
feat(control): modify orthographicSize
singlecoder Jun 10, 2021
50805b4
feat: opt code for ortho contorl (#325)
singlecoder Jun 10, 2021
fb79ed3
Merge branch 'dev/0.4' of https://github.com/oasis-engine/engine into…
singlecoder Jun 10, 2021
54b7eb0
v0.4.0-alpha.0
GuoLei1990 Jun 10, 2021
0f20ec7
Merge branch 'main' of https://github.com/oasis-engine/engine into te…
singlecoder Jun 11, 2021
91e1c89
feat(test): add test for gltf parser
singlecoder Jun 11, 2021
2fc190c
feat(test): revert code
singlecoder Jun 11, 2021
db85788
feat(test): revert code
singlecoder Jun 11, 2021
636fc01
feat(test): fix test error
singlecoder Jun 11, 2021
df8d418
refactor: delete tween package (#329)
GuoLei1990 Jun 11, 2021
43c8d3f
refactor: add test for gltf parser (#328)
singlecoder Jun 11, 2021
29a06d8
Merge branch 'main' of https://github.com/oasis-engine/engine into te…
singlecoder Jun 12, 2021
3420180
feat(test): change test to tests
singlecoder Jun 12, 2021
d5e8fd7
Merge pull request #332 from singlecoder/test/gltf
eyworldwide Jun 12, 2021
eb49d20
Merge branch 'oasis-engine:main' into main
gz65555 Jun 15, 2021
bfe3078
feat: scene edit
czizzy Jun 16, 2021
227e572
Merge pull request #338 from czizzy/feat/sceneloader-scene-edit
czizzy Jun 16, 2021
cc33f44
refactor: temp sovle compile error in server (#339)
GuoLei1990 Jun 16, 2021
7d6b7fa
v0.4.0-alpha.1
GuoLei1990 Jun 16, 2021
4f4f873
Merge branch 'main' of github.com:oasis-engine/engine into main
gz65555 Jun 16, 2021
0962bd7
Merge branch 'main' of github.com:gz65555/engine-1 into main
gz65555 Jun 16, 2021
4a06c8c
v0.4.0-alpha.2
GuoLei1990 Jun 16, 2021
49be3e1
docs: add badge for unit tests (#333)
gz65555 Jun 16, 2021
fa99553
ci: modify babel config for jest to avoid warning (#340)
gz65555 Jun 16, 2021
2c2660f
Update README links
GuoLei1990 Jun 17, 2021
672331f
fix: set vertex count (#341)
zhuxudong Jun 17, 2021
9d67138
v0.4.0
GuoLei1990 Jun 17, 2021
f89a6de
fix: fix modle set prop error (#343)
singlecoder Jun 17, 2021
1009ed5
v0.4.1
GuoLei1990 Jun 17, 2021
f82c88a
fix: fix bug of `GLTFModle` (#346)
GuoLei1990 Jun 21, 2021
c8e3d94
Merge branch 'main' of github.com:oasis-engine/engine into main
gz65555 Jun 21, 2021
ed0803a
v0.4.2
GuoLei1990 Jun 21, 2021
3c26bed
fix: geometry set material invalid (#353)
singlecoder Jun 23, 2021
6a3706d
v0.4.3
GuoLei1990 Jun 23, 2021
0a8e47a
Merge branch 'main' of github.com:oasis-engine/engine into main
gz65555 Jun 29, 2021
aa3717e
feat: add scene sky parser
gz65555 Jul 1, 2021
2ffdbd6
Merge pull request #361 from gz65555/main
czizzy Jul 1, 2021
0ea6374
v0.4.4
GuoLei1990 Jul 1, 2021
2a02d47
refactor: fix sky update null
gz65555 Jul 1, 2021
54604a7
Merge branch 'main' of github.com:oasis-engine/engine into main
gz65555 Jul 1, 2021
bfb12d7
Merge pull request #362 from gz65555/main
czizzy Jul 1, 2021
c72e593
v0.4.5
GuoLei1990 Jul 1, 2021
05259c0
docs: fix build doc error
gz65555 Jul 2, 2021
9c4a149
Merge branch 'oasis-engine:main' into main
gz65555 Jul 2, 2021
d439208
Merge pull request #365 from gz65555/main
eyworldwide Jul 3, 2021
6f88282
feat: add LuminanceAlpha format to support ar frame buffer data (#371)
zhuxudong Jul 6, 2021
c463daf
v0.4.6
GuoLei1990 Jul 6, 2021
84eecc9
opt: opt gl api use (#368)
singlecoder Jul 8, 2021
178416d
v0.4.7
GuoLei1990 Jul 8, 2021
9297dd6
fix: translate bug (#375)
GuoLei1990 Jul 12, 2021
82099f1
v0.4.8
GuoLei1990 Jul 12, 2021
6948c94
Create FUNDING.yml
GuoLei1990 Jul 14, 2021
d8fdd1f
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
113397f
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
98a0b53
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
635eeba
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
7f30a83
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
e0e0d8a
Update FUNDING.yml
GuoLei1990 Jul 14, 2021
3ca7beb
fix: fix gl active texture error (#406)
singlecoder Jul 22, 2021
8585af9
v0.4.9
GuoLei1990 Jul 22, 2021
731a74d
fix: load gltf has no material (#408)
czizzy Jul 30, 2021
550c201
v0.4.10
GuoLei1990 Jul 30, 2021
d9e5106
v0.4.11
GuoLei1990 Jul 30, 2021
e8c4c58
fix: image reference (#432)
PlateArmourProgrammer Aug 16, 2021
f4e6398
v0.4.12
GuoLei1990 Aug 16, 2021
3144549
Merge branch 'main' into dev/0.5
GuoLei1990 Sep 2, 2021
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
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [oasis-engine]
open_collective: oasis
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ npm run bootstrap
Then, to build the source, using npm:

```sh
npm run build
npm run b:all
```

## Links
Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ export class Scene extends EngineObject {
Scene.sceneFeatureManager.addObject(this);
shaderData._addRefCount(1);
this.ambientLight = new AmbientLight(this);

// @todo: this is device macro,should add when compile shader.
if (this._engine._hardwareRenderer.canIUse(GLCapabilityType.shaderTextureLod)) {
shaderData.enableMacro("HAS_TEX_LOD");
}
if (this._engine._hardwareRenderer.canIUse(GLCapabilityType.standardDerivatives)) {
shaderData.enableMacro("HAS_DERIVATIVES");
}
}

/**
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,7 @@ export class Transform extends Component {

private _translate(translation: Vector3, relativeToLocal: boolean = true): void {
if (relativeToLocal) {
const rotationMat = Transform._tempMat40;
Matrix.rotationQuaternion(this.rotationQuaternion, rotationMat);
Vector3.transformCoordinate(translation, rotationMat, Transform._tempVec3);
this.position = this._position.add(Transform._tempVec3);
this.position = this._position.add(translation);
} else {
this.worldPosition = this._worldPosition.add(translation);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/asset/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function requestImage<T>(url: string, config: RequestConfig): AssetPromise<T> {
requestAnimationFrame(() => {
//@ts-ignore
resolve(img);
img.onload = null;
img.onerror = null;
img.onabort = null;
});
clearTimeout(timeoutId);
};
Expand Down
10 changes: 9 additions & 1 deletion packages/core/src/shader/Shader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GLCapabilityType } from "../base/Constant";
import { Engine } from "../Engine";
import { ShaderFactory } from "../shaderlib/ShaderFactory";
import { ShaderDataGroup } from "./enums/ShaderDataGroup";
Expand Down Expand Up @@ -157,7 +158,7 @@ export class Shader {
Shader._getNamesByMacros(macroCollection, macroNameList);
const macroNameStr = ShaderFactory.parseCustomMacros(macroNameList);
const versionStr = isWebGL2 ? "#version 300 es" : "#version 100";
const precisionStr = `
let precisionStr = `
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
Expand All @@ -171,6 +172,13 @@ export class Shader {
#endif
`;

if (engine._hardwareRenderer.canIUse(GLCapabilityType.shaderTextureLod)) {
precisionStr += "#define HAS_TEX_LOD\n";
}
if (engine._hardwareRenderer.canIUse(GLCapabilityType.standardDerivatives)) {
precisionStr += "#define HAS_DERIVATIVES\n";
}

let vertexSource = ShaderFactory.parseIncludes(
` ${versionStr}
${precisionStr}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/shader/ShaderProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export class ShaderProgram {
return null;
}

if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
if (Logger.isEnabled && !gl.getProgramParameter(program, gl.LINK_STATUS)) {
Logger.error("Could not link WebGL program. \n" + gl.getProgramInfoLog(program));
gl.deleteProgram(program);
return null;
Expand Down Expand Up @@ -291,7 +291,7 @@ export class ShaderProgram {
return null;
}

if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
if (Logger.isEnabled && !gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
Logger.error(
`Could not compile WebGL shader.\n${gl.getShaderInfoLog(shader)}`,
ShaderProgram._addLineNum(shaderSource)
Expand Down
8 changes: 2 additions & 6 deletions packages/core/src/shaderlib/ShaderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { Logger } from "../base/Logger";
class ShaderFactory {
static parseCustomMacros(macros: string[]) {
return (
"#define O3_CUSTOM_MACROS_START\n" +
macros.map((m) => `#define ${m}\n`).join("") +
"#define O3_CUSTOM_MACROS_END\n"
macros.map((m) => `#define ${m}\n`).join("")
);
}

Expand All @@ -33,9 +31,7 @@ class ShaderFactory {
* */
static parseExtension(extensions: string[]) {
return (
`#define O3_EXTENSION_START\n` +
extensions.map((e) => `#extension ${e} : enable\n`).join("") +
`#define O3_EXTENSION_END\n`
extensions.map((e) => `#extension ${e} : enable\n`).join("")
);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/texture/enums/TextureFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export enum TextureFormat {
R5G6B5,
/** Transparent format,8 bits. */
Alpha8,
/** Luminance/alpha in RGB channel, alpha in A channel. */
LuminanceAlpha,
/** RGBA format,32 bits per channel. */
R32G32B32A32,
/** RGB compressed format。*/
Expand Down
3 changes: 3 additions & 0 deletions packages/loader/src/gltf/GLTFUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ export class GLTFUtil {
// Call requestAnimationFrame to avoid iOS's bug.
requestAnimationFrame(() => {
resolve(img);
img.onload = null;
img.onerror = null;
img.onabort = null;
});
};
});
Expand Down
16 changes: 7 additions & 9 deletions packages/loader/src/scene-loader/AbilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class AbilityManager {
} else if (type === "Model") {
// TODO
(ability as any).setProps(abilityProps);
if (abilityProps.material) {
(ability as any).material = abilityProps.material;
}
} else {
for (let k in abilityProps) {
if (abilityProps[k] !== null) {
Expand All @@ -54,16 +57,11 @@ export class AbilityManager {

@pluginHook({ before: "beforeAbilityUpdated", after: "abilityUpdated" })
public update(id: string, key: string, value: any) {
if (this.get(id).constructor === Model) {
// TODO
if (value && this.checkIsAsset(value)) {
(this.get(id) as any).setProp(key, this.oasis.resourceManager.get(value.id).resource);
} else {
(this.get(id) as any).updateProp(key, value);
}
if (value && this.checkIsAsset(value)) {
this.get(id)[key] = this.oasis.resourceManager.get(value.id).resource;
} else {
if (value && this.checkIsAsset(value)) {
this.get(id)[key] = this.oasis.resourceManager.get(value.id).resource;
if (this.get(id).constructor === Model) {
(this.get(id) as any).updateProp(key, value);
} else {
this.get(id)[key] = value;
}
Expand Down
14 changes: 13 additions & 1 deletion packages/loader/src/scene-loader/SceneManager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PrimitiveMesh, SkyBoxMaterial } from "@oasis-engine/core";
import { Oasis } from "./Oasis";
import { pluginHook } from "./plugins/PluginManager";

Expand Down Expand Up @@ -25,7 +26,18 @@ export class SceneManager {

private setProp(field, key, prop) {
const scene = this.oasis.engine.sceneManager.activeScene;
if (scene[field]) {
if (field === "background" && key === "skyboxTexture") {
const sky = scene.background.sky;
if (prop) {
sky.mesh = PrimitiveMesh.createCuboid(scene.engine, 2, 2, 2);
const skyMaterial = new SkyBoxMaterial(scene.engine);
skyMaterial.textureCubeMap = this.oasis.resourceManager.get(prop.id).resource;
sky.material = skyMaterial;
} else {
sky.mesh = null;
sky.material = null;
}
} else if (scene[field]) {
if (prop && prop.type === "asset") {
scene[field][key] = this.oasis.resourceManager.get(prop.id).resource;
} else {
Expand Down
114 changes: 58 additions & 56 deletions packages/loader/src/scene-loader/resources/GLTFResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ import { UnlitMaterialResource } from "./UnlitMaterialResource";

export class GLTFResource extends SchemaResource {
load(resourceManager: ResourceManager, assetConfig: AssetConfig, oasis: Oasis): Promise<any> {
return resourceManager
.load<any>({ url: assetConfig.url, type: AssetType.Prefab })
.then((res) => {
const gltf = res;
if (assetConfig.props) {
gltf.newMaterial = (assetConfig.props as any).newMaterial;
gltf.animatorControllers = (assetConfig.props as any).animatorControllers;
}
this._resource = gltf;
});
return resourceManager.load<any>({ url: assetConfig.url, type: AssetType.Prefab }).then((res) => {
const gltf = res;
if (assetConfig.props) {
gltf.newMaterial = (assetConfig.props as any).newMaterial;
gltf.animatorControllers = (assetConfig.props as any).animatorControllers;
}
this._resource = gltf;
});
}

loadWithAttachedResources(
Expand All @@ -53,33 +51,35 @@ export class GLTFResource extends SchemaResource {
}
}
};
for (let i = 0; i < materials.length; i++) {
const material = materials[i];
let materialResource = null;
let type = "";

if (material instanceof PBRMaterial) {
materialResource = new PBRMaterialResource(this.resourceManager);
type = "PBRMaterial";
} else if (material instanceof UnlitMaterial) {
materialResource = new UnlitMaterialResource(this.resourceManager);
type = "UnlitMaterial";
} else if (material instanceof PBRSpecularMaterial) {
materialResource = new PBRSpecularMaterialResource(this.resourceManager);
type = "PBRSpecularMaterial";
} else {
materialResource = new BlinnPhongMaterialResource(this.resourceManager);
type = "BlinnPhongMaterial";
}
if (materials?.length) {
for (let i = 0; i < materials.length; i++) {
const material = materials[i];
let materialResource = null;
let type = "";

if (material instanceof PBRMaterial) {
materialResource = new PBRMaterialResource(this.resourceManager);
type = "PBRMaterial";
} else if (material instanceof UnlitMaterial) {
materialResource = new UnlitMaterialResource(this.resourceManager);
type = "UnlitMaterial";
} else if (material instanceof PBRSpecularMaterial) {
materialResource = new PBRSpecularMaterialResource(this.resourceManager);
type = "PBRSpecularMaterial";
} else {
materialResource = new BlinnPhongMaterialResource(this.resourceManager);
type = "BlinnPhongMaterial";
}

this._attachedResources.push(materialResource);
materialLoadPromises.push(
materialResource.loadWithAttachedResources(resourceManager, {
type,
name: material.name,
resource: material
})
);
this._attachedResources.push(materialResource);
materialLoadPromises.push(
materialResource.loadWithAttachedResources(resourceManager, {
type,
name: material.name,
resource: material
})
);
}
}

if (_animationsIndices.length) {
Expand Down Expand Up @@ -113,23 +113,25 @@ export class GLTFResource extends SchemaResource {
newMaterial.push(matStructure);
});
});
const loadAttachedController = animatorControllerLoadPromise ? animatorControllerLoadPromise.then((res) => {
const { animatorControllers } = result.structure.props;
const controllerStructure = res.structure;
const controllerResource = res.resources[controllerStructure.index];
result.resources.push(controllerResource as any);
controllerStructure.index = result.resources.length - 1;
const { animationClips } = controllerStructure.props;
if (animationClips) {
for (let i = 0, length = animationClips.length; i < length; ++i) {
const clipStructure = animationClips[i];
const clipResource = res.resources[clipStructure.index];
result.resources.push(clipResource);
clipStructure.index = result.resources.length - 1;
}
}
animatorControllers.push(controllerStructure);
}) : Promise.resolve();
const loadAttachedController = animatorControllerLoadPromise
? animatorControllerLoadPromise.then((res) => {
const { animatorControllers } = result.structure.props;
const controllerStructure = res.structure;
const controllerResource = res.resources[controllerStructure.index];
result.resources.push(controllerResource as any);
controllerStructure.index = result.resources.length - 1;
const { animationClips } = controllerStructure.props;
if (animationClips) {
for (let i = 0, length = animationClips.length; i < length; ++i) {
const clipStructure = animationClips[i];
const clipResource = res.resources[clipStructure.index];
result.resources.push(clipResource);
clipStructure.index = result.resources.length - 1;
}
}
animatorControllers.push(controllerStructure);
})
: Promise.resolve();
Promise.all([loadAttachedMaterial, loadAttachedController]).then(() => {
resolve(result);
});
Expand Down Expand Up @@ -175,7 +177,7 @@ export class GLTFResource extends SchemaResource {
newMaterials[i] = mtlResource.resource;
} else {
Logger.warn(
`GLTFResource: ${ this.meta.name } can't find asset "material", which id is: ${ newMaterialsConfig[i].id }`
`GLTFResource: ${this.meta.name} can't find asset "material", which id is: ${newMaterialsConfig[i].id}`
);
}
}
Expand Down Expand Up @@ -203,11 +205,11 @@ export class GLTFResource extends SchemaResource {
for (let i = 0, length = animatorControllers.length; i < length; i++) {
const animatorControllerAsset = animatorControllers[i];
const controllerResource = <AnimatorControllerResource>this.resourceManager.get(animatorControllerAsset.id);
controllerResource.gltf= this._resource;
controllerResource.gltf = this._resource;
if (controllerResource) {
this._attachedResources.push(controllerResource);
} else {
`GLTFResource: ${ this.meta.name } can't find asset "animatorController", which id is: ${ animatorControllerAsset.id }`
`GLTFResource: ${this.meta.name} can't find asset "animatorController", which id is: ${animatorControllerAsset.id}`;
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/loader/src/scene-loader/resources/TextureResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export class TextureResource extends SchemaResource {
setMeta() {
if (this.resource) {
this._meta.name = this.resource.name;
if (this.resource.image) {
this._meta.url = this.resource.image.src;
}
}
}
}
6 changes: 3 additions & 3 deletions packages/loader/src/scene-loader/temp.compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function handleComponents(props) {
const k = keys[i];
const v = props[k];

if (Array.isArray(v) && typeof v[0] !== 'object') {
if (Array.isArray(v) && typeof v[0] !== "object") {
if (["color", "diffuseColor", "specularColor"].indexOf(k) !== -1) {
props[k] = new Color(v[0], v[1], v[2], v[3]);
} else if (v.length === 4) {
Expand All @@ -54,7 +54,7 @@ function handleSceneProps(props) {
const k = keys[i];
const v = props[k];

if (Array.isArray(v) && typeof v[0] !== 'object') {
if (Array.isArray(v) && typeof v[0] !== "object") {
if (/color/i.test(k)) {
props[k] = new Color(v[0], v[1], v[2], v[3]);
} else if (v.length === 4) {
Expand Down Expand Up @@ -84,7 +84,7 @@ function handleAssets(props: any = {}) {
continue;
}

if (Array.isArray(value) && typeof value[0] !== 'object') {
if (Array.isArray(value) && typeof value[0] !== "object") {
if (["emissiveColor", "diffuseColor", "specularColor", "baseColor"].indexOf(key) !== -1) {
props[key] = new Color(value[0], value[1], value[2], value[3]);
} else if (value.length === 4) {
Expand Down
2 changes: 1 addition & 1 deletion packages/loader/tests/gltf/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ describe("AnimationClipLoader Test", () => {
expect(animations.length === 1).toEqual(true);
const animation = animations[0];
expect(animation.name === "animation_AnimatedCube").toEqual(true);
expect(animation._curves.length).toEqual(1);
expect(animation.curveBindings.length).toEqual(1);
});
});
Loading