LineSegment.getNegativeEnd

LineSegment.getNegativeEnd() doesn't guarantee that the Vector3f returned is lower than the .getPositiveEnd() result, for all components (x, y and z).



Is this working as expected?



Alternatively, wouldn't it be useful a method LineSegments.isPointInBounds(Vector3f point)?

I don't think I see the issue. getNegativeEnd simply says it's the beginning on the line, it does not imply that all components of the position are supposed to be below the positive end position.


wouldn't it be useful a method LineSegments.isPointInBounds(Vector3f point)?

can't you just do LineSegments.getWorldBound().contains(point)?
Momoko_Fan said:

I don't think I see the issue. getNegativeEnd simply says it's the beginning on the line, it does not imply that all components of the position are supposed to be below the positive end position.


I was thinking that was the point, and then I understood that getPositiveEnd returns the "normal" end, and the other one negates the direction. Now I see why the distance between positive and negative ends is as twice as the distance between "source" and any of the ends. getNegativeEnd() doesn't provide the "beginning" of the line, but the "end" of the line if direction is inverted.


wouldn't it be useful a method LineSegments.isPointInBounds(Vector3f point)?

can't you just do LineSegments.getWorldBound().contains(point)?


LineSegment is a math object and doesn't have boundaries.

I use LineSegments to limit my bullets movement, and I find useful to know if a point is in the line (actually, I just need to know that it is within its boundaries).

I think I will suggest that in the Contribution Depot.