mirror of
https://github.com/overte-org/overte.git
synced 2025-06-27 20:29:38 +02:00
relative rotation
This commit is contained in:
parent
514cb7a329
commit
fffe6dbb9b
2 changed files with 7 additions and 10 deletions
|
@ -35,22 +35,17 @@ ArcBall = function(spawnPosition) {
|
||||||
z: 0
|
z: 0
|
||||||
}),
|
}),
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: .2,
|
x: .1,
|
||||||
y: .2,
|
y: .1,
|
||||||
z: .5
|
z: .2
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
red: 15,
|
red: 15,
|
||||||
green: 10,
|
green: 10,
|
||||||
blue: 150
|
blue: 150
|
||||||
},
|
},
|
||||||
mass: 10,
|
damping: 0.8,
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
// gravity: {
|
|
||||||
// x: 0,
|
|
||||||
// y: -0.5,
|
|
||||||
// z: 0
|
|
||||||
// },
|
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
invertSolidWhileHeld: true
|
invertSolidWhileHeld: true
|
||||||
|
|
|
@ -34,8 +34,10 @@
|
||||||
createBeam: function(startPosition, endPosition) {
|
createBeam: function(startPosition, endPosition) {
|
||||||
print("CREATE BEAM")
|
print("CREATE BEAM")
|
||||||
// Creates particle arc from start position to end position
|
// Creates particle arc from start position to end position
|
||||||
|
var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation;
|
||||||
var sourceToTargetVec = Vec3.subtract(endPosition, startPosition);
|
var sourceToTargetVec = Vec3.subtract(endPosition, startPosition);
|
||||||
var emitOrientation = Quat.rotationBetween(Vec3.UNIT_Z, sourceToTargetVec);
|
var emitOrientation = Quat.rotationBetween(Vec3.UNIT_Z, sourceToTargetVec);
|
||||||
|
emitOrientation = Quat.multiply(Quat.inverse(rotation), emitOrientation);
|
||||||
|
|
||||||
testBox = Entities.addEntity({
|
testBox = Entities.addEntity({
|
||||||
type: "Box",
|
type: "Box",
|
||||||
|
@ -65,7 +67,7 @@
|
||||||
},
|
},
|
||||||
colorFinish: color,
|
colorFinish: color,
|
||||||
maxParticles: 100000,
|
maxParticles: 100000,
|
||||||
lifespan: 2,
|
lifespan: 6,
|
||||||
emitRate: 1000,
|
emitRate: 1000,
|
||||||
emitOrientation: emitOrientation,
|
emitOrientation: emitOrientation,
|
||||||
emitSpeed: .4,
|
emitSpeed: .4,
|
||||||
|
|
Loading…
Reference in a new issue