Skip to content

Commit 855436b

Browse files
committed
Merge branch 'master' of https://github.com/playcanvas/engine
2 parents 8b2751b + 102aa44 commit 855436b

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

src/resources/animation.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ Object.assign(pc, function () {
2626
};
2727

2828
if (url.load.startsWith('blob:')) {
29-
options.responseType = pc.Http.ResponseType.JSON;
29+
if (pc.path.getExtension(url.original).toLowerCase() === '.glb') {
30+
options.responseType = pc.Http.ResponseType.ARRAY_BUFFER;
31+
} else {
32+
options.responseType = pc.Http.ResponseType.JSON;
33+
}
3034
}
3135

3236
pc.http.get(url.load, options, function (err, response) {
@@ -39,7 +43,7 @@ Object.assign(pc, function () {
3943
},
4044

4145
open: function (url, data) {
42-
if (pc.path.getExtension(url) === '.glb') {
46+
if (pc.path.getExtension(url).toLowerCase() === '.glb') {
4347
var glb = pc.GlbParser.parse("filename.glb", data, null);
4448
if (!glb) {
4549
return null;

src/resources/model.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ Object.assign(pc, function () {
4646
};
4747

4848
if (url.load.startsWith('blob:')) {
49-
options.responseType = pc.Http.ResponseType.JSON;
49+
if (pc.path.getExtension(url.original).toLowerCase() === '.glb') {
50+
options.responseType = pc.Http.ResponseType.ARRAY_BUFFER;
51+
} else {
52+
options.responseType = pc.Http.ResponseType.JSON;
53+
}
5054
}
5155

5256
pc.http.get(url.load, options, function (err, response) {

src/resources/parser/glb-parser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ Object.assign(pc, function () {
254254
vertexDesc.push({
255255
semantic: semantic,
256256
components: getNumComponents(accessor.type),
257-
type: getComponentType(accessor.componentType)
257+
type: getComponentType(accessor.componentType),
258+
normalize: accessor.normalized
258259
});
259260
// store the info we'll need to copy this data into the vertex buffer
260261
var size = getNumComponents(accessor.type) * getComponentSizeInBytes(accessor.componentType);
@@ -331,7 +332,8 @@ Object.assign(pc, function () {
331332
values: values,
332333
numComponents: attribute.num_components(),
333334
componentSizeInBytes: componentSizeInBytes,
334-
storageType: storageType
335+
storageType: storageType,
336+
normalized: attribute.normalized()
335337
};
336338
};
337339

@@ -349,7 +351,7 @@ Object.assign(pc, function () {
349351
semantic: semantic,
350352
components: attributeInfo.numComponents,
351353
type: attributeInfo.storageType,
352-
normalize: semanticMap[attrib].normalize
354+
normalize: attributeInfo.normalized
353355
});
354356

355357
// store the info we'll need to copy this data into the vertex buffer

src/scene/particle-system/particle-emitter.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,16 +384,19 @@ Object.assign(pc, function () {
384384
this.prevWorldBoundsSize.copy(this.worldBoundsSize);
385385
this.prevWorldBoundsCenter.copy(this.worldBounds.center);
386386

387-
var recalculateLocalBounds = false;
388-
if (this.emitterShape === pc.EMITTERSHAPE_BOX) {
389-
recalculateLocalBounds = !this.emitterExtents.equals(this.prevEmitterExtents);
390-
} else {
391-
recalculateLocalBounds = !(this.emitterRadius === this.prevEmitterRadius);
392-
}
393-
if (recalculateLocalBounds) {
394-
this.calculateLocalBounds();
387+
if (!this.useCpu) {
388+
var recalculateLocalBounds = false;
389+
if (this.emitterShape === pc.EMITTERSHAPE_BOX) {
390+
recalculateLocalBounds = !this.emitterExtents.equals(this.prevEmitterExtents);
391+
} else {
392+
recalculateLocalBounds = !(this.emitterRadius === this.prevEmitterRadius);
393+
}
394+
if (recalculateLocalBounds) {
395+
this.calculateLocalBounds();
396+
}
395397
}
396398

399+
397400
var nodeWT = this.node.getWorldTransform();
398401
if (this.localSpace) {
399402
this.worldBoundsNoTrail.copy(this.localBounds);
@@ -1088,9 +1091,7 @@ Object.assign(pc, function () {
10881091

10891092
this.simTimeTotal += delta;
10901093

1091-
if (!this.useCpu) {
1092-
this.calculateWorldBounds();
1093-
}
1094+
this.calculateWorldBounds();
10941095

10951096
if (this._isAnimated()) {
10961097
var tilesParams = this.animTilesParams;

0 commit comments

Comments
 (0)