mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 05:53:29 +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
|
||||
}),
|
||||
dimensions: {
|
||||
x: .2,
|
||||
y: .2,
|
||||
z: .5
|
||||
x: .1,
|
||||
y: .1,
|
||||
z: .2
|
||||
},
|
||||
color: {
|
||||
red: 15,
|
||||
green: 10,
|
||||
blue: 150
|
||||
},
|
||||
mass: 10,
|
||||
damping: 0.8,
|
||||
collisionsWillMove: true,
|
||||
// gravity: {
|
||||
// x: 0,
|
||||
// y: -0.5,
|
||||
// z: 0
|
||||
// },
|
||||
userData: JSON.stringify({
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
|
|
|
@ -34,8 +34,10 @@
|
|||
createBeam: function(startPosition, endPosition) {
|
||||
print("CREATE BEAM")
|
||||
// Creates particle arc from start position to end position
|
||||
var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation;
|
||||
var sourceToTargetVec = Vec3.subtract(endPosition, startPosition);
|
||||
var emitOrientation = Quat.rotationBetween(Vec3.UNIT_Z, sourceToTargetVec);
|
||||
emitOrientation = Quat.multiply(Quat.inverse(rotation), emitOrientation);
|
||||
|
||||
testBox = Entities.addEntity({
|
||||
type: "Box",
|
||||
|
@ -65,7 +67,7 @@
|
|||
},
|
||||
colorFinish: color,
|
||||
maxParticles: 100000,
|
||||
lifespan: 2,
|
||||
lifespan: 6,
|
||||
emitRate: 1000,
|
||||
emitOrientation: emitOrientation,
|
||||
emitSpeed: .4,
|
||||
|
|
Loading…
Reference in a new issue