Skip to content

Commit

Permalink
[math] Shape3ad: intersection test more generic, accepting Prism3ad
Browse files Browse the repository at this point in the history
instead of RectangularPrism after refactoring
  • Loading branch information
tpiotrow committed Jun 10, 2016
1 parent 006f873 commit 15c8c40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ default boolean intersects(Sphere3ad<?, ?, ?, ?, ?, ?> s) {

@Pure
@Override
default boolean intersects(RectangularPrism3ad<?, ?, ?, ?, ?, ?> s) {
default boolean intersects(Prism3ad<?, ?, ?, ?, ?, ?> s) {
assert (s != null) : "Rectangle must be not null"; //$NON-NLS-1$
if (s.intersects(toBoundingBox())) {
for (CT shape : getBackendDataList()) {
Expand Down Expand Up @@ -225,7 +225,7 @@ default void toBoundingBox(B box) {
while (iterator.hasNext()) {
CT element = iterator.next();
element.toBoundingBox(subbounds);
// box.setUnion(subbounds); // TODO
box.setUnion(subbounds);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ default boolean intersects(Shape3D<?, ?, ?, ?, ?, ?> s) {
@Pure
boolean intersects(Sphere3ad<?, ?, ?, ?, ?, ?> s);

/** Replies if this shape is intersecting the given Rectangular Prism.
/** Replies if this shape is intersecting the given Prism.
*
* @param s
* @return <code>true</code> if this shape is intersecting the given shape;
* <code>false</code> if there is no intersection.
*/
@Pure
boolean intersects(RectangularPrism3ad<?, ?, ?, ?, ?, ?> s);
boolean intersects(Prism3ad<?, ?, ?, ?, ?, ?> s);

/** Replies if this shape is intersecting the given line.
*
Expand Down

0 comments on commit 15c8c40

Please sign in to comment.