mirror of
https://github.com/lubosz/overte.git
synced 2025-08-13 07:43:58 +02:00
fixed offset issue with lightsaber
This commit is contained in:
parent
1031489ada
commit
653e3ecdcc
1 changed files with 3 additions and 4 deletions
|
@ -57,9 +57,8 @@
|
||||||
this.props = Entities.getEntityProperties(this.entityID, ["position", "rotation"]);
|
this.props = Entities.getEntityProperties(this.entityID, ["position", "rotation"]);
|
||||||
var forwardVec = Quat.getFront(Quat.multiply(this.props.rotation, Quat.fromPitchYawRollDegrees(-90, 0, 0)));
|
var forwardVec = Quat.getFront(Quat.multiply(this.props.rotation, Quat.fromPitchYawRollDegrees(-90, 0, 0)));
|
||||||
var forwardQuat = Quat.rotationBetween(Vec3.UNIT_Z, forwardVec);
|
var forwardQuat = Quat.rotationBetween(Vec3.UNIT_Z, forwardVec);
|
||||||
var position = Vec3.sum(this.props.position, Vec3.multiply(Quat.getFront(this.props.rotation), 0.1));
|
var position = this.props.position;
|
||||||
position.z += 0.1;
|
|
||||||
position.x += -0.035;
|
|
||||||
var color = this.colorPalette[randInt(0, this.colorPalette.length)];
|
var color = this.colorPalette[randInt(0, this.colorPalette.length)];
|
||||||
var props = {
|
var props = {
|
||||||
type: "ParticleEffect",
|
type: "ParticleEffect",
|
||||||
|
@ -114,4 +113,4 @@
|
||||||
};
|
};
|
||||||
// entity scripts always need to return a newly constructed object of our type
|
// entity scripts always need to return a newly constructed object of our type
|
||||||
return new LightSaber();
|
return new LightSaber();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue