Skip to content

Commit 3b82ddf

Browse files
authored
Small cleanup of morph bounding box setup (playcanvas#2029)
1 parent 96fa379 commit 3b82ddf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/resources/parser/glb-parser.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,8 @@ Object.assign(pc, function () {
575575
options.deltaPositions = getAccessorData(accessor, bufferViews, buffers);
576576

577577
if (accessor.hasOwnProperty('min') && accessor.hasOwnProperty('max')) {
578-
var min = accessor.min;
579-
var max = accessor.max;
580-
options.aabb = new pc.BoundingBox(
581-
new pc.Vec3((max[0] + min[0]) * 0.5, (max[1] + min[1]) * 0.5, (max[2] + min[2]) * 0.5),
582-
new pc.Vec3((max[0] - min[0]) * 0.5, (max[1] - min[1]) * 0.5, (max[2] - min[2]) * 0.5)
583-
);
578+
options.aabb = new pc.BoundingBox();
579+
options.aabb.setMinMax(new pc.Vec3(accessor.min), new pc.Vec3(accessor.max));
584580
}
585581

586582
// FIXME: assume that position, normal, tangent data all share the

0 commit comments

Comments
 (0)