mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-25 20:10:19 +02:00
actually delete lights now that it doesnt crash
This commit is contained in:
parent
11aaeb1ec0
commit
1b1edf6f7a
1 changed files with 6 additions and 24 deletions
|
@ -122,7 +122,7 @@ var USE_ENTITY_LASERS_FOR_MOVING = true;
|
||||||
var USE_OVERLAY_LINES_FOR_SEARCHING = true;
|
var USE_OVERLAY_LINES_FOR_SEARCHING = true;
|
||||||
var USE_PARTICLE_BEAM_FOR_SEARCHING = false;
|
var USE_PARTICLE_BEAM_FOR_SEARCHING = false;
|
||||||
var USE_PARTICLE_BEAM_FOR_MOVING = false;
|
var USE_PARTICLE_BEAM_FOR_MOVING = false;
|
||||||
var USE_SPOTLIGHT = false;
|
var USE_SPOTLIGHT = true;
|
||||||
var USE_POINTLIGHT = false;
|
var USE_POINTLIGHT = false;
|
||||||
|
|
||||||
// states for the state machine
|
// states for the state machine
|
||||||
|
@ -436,10 +436,8 @@ function MyController(hand) {
|
||||||
var finalRotation = Quat.multiply(orientation, rotation);
|
var finalRotation = Quat.multiply(orientation, rotation);
|
||||||
|
|
||||||
if (this.particleBeam === null) {
|
if (this.particleBeam === null) {
|
||||||
print('create beam')
|
|
||||||
this.createParticleBeam(position, finalRotation, color);
|
this.createParticleBeam(position, finalRotation, color);
|
||||||
} else {
|
} else {
|
||||||
print('update beam')
|
|
||||||
this.updateParticleBeam(position, finalRotation, color);
|
this.updateParticleBeam(position, finalRotation, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -590,11 +588,8 @@ function MyController(hand) {
|
||||||
this.spotlight = Entities.addEntity(lightProperties);
|
this.spotlight = Entities.addEntity(lightProperties);
|
||||||
} else {
|
} else {
|
||||||
Entities.editEntity(this.spotlight, {
|
Entities.editEntity(this.spotlight, {
|
||||||
parentID: parentID,
|
|
||||||
position: lightTransform.p,
|
|
||||||
//without this, this light would maintain rotation with its parent
|
//without this, this light would maintain rotation with its parent
|
||||||
rotation: Quat.fromPitchYawRollDegrees(-90, 0, 0),
|
rotation: Quat.fromPitchYawRollDegrees(-90, 0, 0),
|
||||||
visible: true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,16 +622,9 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.pointlight === null) {
|
if (this.pointlight === null) {
|
||||||
|
|
||||||
print('create pointlight')
|
|
||||||
this.pointlight = Entities.addEntity(lightProperties);
|
this.pointlight = Entities.addEntity(lightProperties);
|
||||||
} else {
|
} else {
|
||||||
print('update pointlight')
|
|
||||||
Entities.editEntity(this.pointlight, {
|
|
||||||
parentID: parentID,
|
|
||||||
position: lightTransform.p,
|
|
||||||
visible: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,19 +653,13 @@ function MyController(hand) {
|
||||||
this.turnLightsOff = function() {
|
this.turnLightsOff = function() {
|
||||||
//use visibility for now instead of creating and deleting since deleting seems to crash
|
//use visibility for now instead of creating and deleting since deleting seems to crash
|
||||||
if (this.spotlight !== null) {
|
if (this.spotlight !== null) {
|
||||||
Entities.editEntity(this.spotlight, {
|
Entities.deleteEntity(this.spotlight);
|
||||||
visible: false
|
this.spotlight = null;
|
||||||
})
|
|
||||||
//Entities.deleteEntity(this.spotlight);
|
|
||||||
//this.spotLight=null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.pointlight !== null) {
|
if (this.pointlight !== null) {
|
||||||
Entities.editEntity(this.pointlight, {
|
Entities.deleteEntity(this.pointlight);
|
||||||
visible: false
|
this.pointlight = null;
|
||||||
})
|
|
||||||
//Entities.deleteEntity(this.pointlight);
|
|
||||||
//this.pointlight = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue