Skip to content

Commit 9c201bc

Browse files
committed
fix issue where scroll-scaling wasn't updating its local scale value; fix issue where media-loader wasn't setting the bounding box corrrectly in certain cases
1 parent 484b05e commit 9c201bc

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/components/media-loader.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AFRAME.registerComponent("media-loader", {
2121
this.showLoader = this.showLoader.bind(this);
2222
this.clearLoadingTimeout = this.clearLoadingTimeout.bind(this);
2323
this.shapeAdded = false;
24+
this.hasBakedShapes = false;
2425
},
2526

2627
setShapeAndScale(resize) {
@@ -31,7 +32,7 @@ AFRAME.registerComponent("media-loader", {
3132
if (this.el.body && this.shapeAdded && this.el.body.shapes.length > 1) {
3233
this.el.removeAttribute("shape");
3334
this.shapeAdded = false;
34-
} else if (this.el.body.shapes.length === 0) {
35+
} else if (!this.hasBakedShapes) {
3536
const center = new THREE.Vector3();
3637
const { min, max } = box;
3738
const halfExtents = {
@@ -75,6 +76,10 @@ AFRAME.registerComponent("media-loader", {
7576
this.loadingClip.play();
7677
}
7778
this.el.setObject3D("mesh", mesh);
79+
//check if the object has baked shape data and that it's not a spawner
80+
//if it is a spawner, this will ignore the baked shape data so that it resizes correctly
81+
//TODO: update DefaultEnvironment.json so this is not required
82+
this.hasBakedShapes = this.el.body.shapes.length > 0 && !this.el.components.hasOwnProperty("super-spawner");
7883
this.setShapeAndScale(true);
7984
delete this.showLoaderTimeout;
8085
},
@@ -149,6 +154,7 @@ AFRAME.registerComponent("media-loader", {
149154
"model-loaded",
150155
() => {
151156
this.clearLoadingTimeout();
157+
this.hasBakedShapes = this.el.body.shapes.length > (this.shapeAdded ? 1 : 0);
152158
this.setShapeAndScale(this.data.resize);
153159
},
154160
{ once: true }

src/components/super-networked-interactable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ AFRAME.registerComponent("super-networked-interactable", {
5555
if (NAF.utils.takeOwnership(this.networkedEl)) {
5656
this.el.setAttribute("body", { type: "dynamic" });
5757
this.counter.register(this.networkedEl);
58+
this.currentScale.copy(this.el.getAttribute("scale"));
5859
} else {
5960
this.el.emit("grab-end", { hand: this.hand });
6061
this.hand = null;

src/components/tools/pen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ AFRAME.registerComponent("pen", {
2525
"#9900FF",
2626
"#FF6600",
2727
"#FFFFFF",
28-
"#AAAAAA",
29-
"#777777",
28+
"#222222",
29+
"#111111",
3030
"#000000"
3131
]
3232
},

0 commit comments

Comments
 (0)