Skip to content

Commit

Permalink
Fixed laser collision body creation
Browse files Browse the repository at this point in the history
  • Loading branch information
basimkhajwal committed May 11, 2016
1 parent 11a3506 commit 3c80e74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/net/net63/codearcade/LSD/systems/LaserSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public void processEntity(Entity entity, float deltaTime) {
world.rayCast(laserCallBack, laserPos, endPosition);
laserHitPos.set(laserHit ? laserHitPos : endPosition);

if (laser.laserEndPos.dst(laserHitPos) > 0.01f) {
//Create a new sensor if the distance has changed or there was no laser before
if (laser.laserEndPos.dst(laserHitPos) > 0.01f || laser.laserSensorBody == null) {
laser.laserEndPos.set(laserHitPos);

if (laser.laserSensorBody != null) world.destroyBody(laser.laserSensorBody);
Expand Down

0 comments on commit 3c80e74

Please sign in to comment.