Skip to content

Commit 7545c04

Browse files
kevinrev26racsoraul
authored andcommitted
Z objects -bug- appear
1 parent e590b29 commit 7545c04

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ class Monster3DProfile extends Component {
8888
}
8989

9090
shouldComponentUpdate(newProps, newState){
91-
return !( this.props.path === newProps.path );
91+
//return !( this.props.path === newProps.path );
92+
//TODO find a way to update animations while update monsters
93+
// The select element is changing when you select the same value?
94+
return true;
9295
}
9396

9497
componentWillUnmount() {
@@ -155,6 +158,9 @@ class Monster3DProfile extends Component {
155158
this.camera.near = size / 1000
156159
this.camera.far = size * 1000
157160

161+
//restart position of monster
162+
//this.monster.position.set(0,0,0);
163+
158164
// set monster initial position
159165
this.monster.position.x += (this.monster.position.x - center.x)
160166
this.monster.position.y += (this.monster.position.y - center.y)
@@ -195,6 +201,8 @@ class Monster3DProfile extends Component {
195201

196202
// set camera initial position
197203
this.camera.lookAt(center)
204+
//default camera position:
205+
this.camera.position.set(0,0,0);
198206
this.camera.position.z += size
199207

200208
// set camera position relative to initial position
@@ -308,10 +316,12 @@ class Monster3DProfile extends Component {
308316
// darkens or lights the monster, and adds
309317
// or not, the sleeping z's model.
310318
monsterLightColor = (action) => {
319+
console.log(action);
311320
if (
312321
action === ActionType.SLEEPING ||
313322
action === ActionType.DEAD
314323
) {
324+
console.log("Sleeping or dead")
315325
this.darkenMonster()
316326
if (action !== ActionType.DEAD) {
317327
if (this.sleepingObject) {
@@ -324,6 +334,7 @@ class Monster3DProfile extends Component {
324334
this.sleepingMixer &&
325335
this.sleepingMixer.stopAllAction()
326336
this.camera.remove(this.sleepingObject)
337+
console.log("was the Sleeping object remove?")
327338
}
328339
} else {
329340
this.lightMonster()

0 commit comments

Comments
 (0)