mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
beams with spotlights
This commit is contained in:
parent
16ab7e74de
commit
2acc0df1f0
1 changed files with 14 additions and 8 deletions
|
@ -559,7 +559,7 @@ function MyController(hand) {
|
||||||
//this light casts the beam
|
//this light casts the beam
|
||||||
var lightProperties = {
|
var lightProperties = {
|
||||||
type: "Light",
|
type: "Light",
|
||||||
isSpotlight: true,
|
isSpotlight: false,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 2,
|
x: 2,
|
||||||
y: 2,
|
y: 2,
|
||||||
|
@ -576,17 +576,18 @@ function MyController(hand) {
|
||||||
cutoff: 20,
|
cutoff: 20,
|
||||||
lifetime: LIFETIME,
|
lifetime: LIFETIME,
|
||||||
position: lightTransform.p,
|
position: lightTransform.p,
|
||||||
rotation: lightTransform.q,
|
// rotation: lightTransform.q,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (this.spotlight === null) {
|
if (this.spotlight === null) {
|
||||||
this.spotlight = Entities.addEntity(lightProperties);
|
this.spotlight = Entities.addEntity(lightProperties);
|
||||||
} else {
|
} else {
|
||||||
// var rotationBetween = Quat.rotationBetween(Vec3.UP, )
|
Entities.editEntity(this.spotlight, {
|
||||||
// Entities.editEntity(this.spotlight, {
|
parentID:parentID,
|
||||||
// rotation: lightTransform.q
|
position:lightTransform.p,
|
||||||
// })
|
visible:true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,9 +617,13 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.spotlightOff = function() {
|
this.spotlightOff = function() {
|
||||||
if (this.spotlight !== null) {
|
if (this.spotlight !== null) {
|
||||||
Overlays.deleteOverlay(this.spotlight);
|
print('SHOULD DELETE SPOTLIGHT' + this.spotlight)
|
||||||
|
Entities.editEntity(this.spotlight,{
|
||||||
|
visible:false
|
||||||
|
})
|
||||||
|
//Entities.deleteEntity(this.spotlight);
|
||||||
}
|
}
|
||||||
this.spotlight = null;
|
//this.spotlight = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.triggerPress = function(value) {
|
this.triggerPress = function(value) {
|
||||||
|
@ -1416,6 +1421,7 @@ function MyController(hand) {
|
||||||
this.release();
|
this.release();
|
||||||
this.endHandGrasp();
|
this.endHandGrasp();
|
||||||
Entities.deleteEntity(this.particleBeam);
|
Entities.deleteEntity(this.particleBeam);
|
||||||
|
Entities.deleteEntity(this.spotLight);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.activateEntity = function(entityID, grabbedProperties) {
|
this.activateEntity = function(entityID, grabbedProperties) {
|
||||||
|
|
Loading…
Reference in a new issue