Fixed the line segment extents so that it doesn't act twice

as long as it's supposed to be.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8542 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 13 years ago
parent bd5620bf16
commit b13809bba3
  1. 2
      engine/src/core/com/jme3/math/LineSegment.java

@ -89,7 +89,7 @@ public class LineSegment implements Cloneable, Savable, java.io.Serializable {
public LineSegment(Vector3f start, Vector3f end) { public LineSegment(Vector3f start, Vector3f end) {
this.origin = new Vector3f(0.5f * (start.x + end.x), 0.5f * (start.y + end.y), 0.5f * (start.z + end.z)); this.origin = new Vector3f(0.5f * (start.x + end.x), 0.5f * (start.y + end.y), 0.5f * (start.z + end.z));
this.direction = end.subtract(start); this.direction = end.subtract(start);
this.extent = direction.length(); this.extent = direction.length() * 0.5f;
direction.normalizeLocal(); direction.normalizeLocal();
} }

Loading…
Cancel
Save