Interface RectangularPrism3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
-
- Type Parameters:
ST
- is the type of the general implementation.IT
- is the type of the implementation of this shape.IE
- is the type of the path elements.P
- is the type of the points.V
- is the type of the vectors.B
- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable
,JsonableObject
,Prism3afp<ST,IT,IE,P,V,B>
,Serializable
,Shape3afp<ST,IT,IE,P,V,B>
,Shape3D<ST,IT,PathIterator3afp<IE>,P,V,B>
- All Known Implementing Classes:
RectangularPrism3d
,RectangularPrism3dfx
public interface RectangularPrism3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>> extends Prism3afp<ST,IT,IE,P,V,B>
Fonctional interface that represented a 2D rectangle on a plane.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Hamza JAFFALI
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RectangularPrism3afp.RectanglePathIterator<T extends PathElement3afp>
Iterator on the path elements of the rectangle.static class
RectangularPrism3afp.TransformedRectanglePathIterator<T extends PathElement3afp>
Iterator on the path elements of the rectangle.
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default void
add(double x, double y, double z)
Add the given coordinate in the rectangle.default void
add(Point3D<?,?> pt)
Add the given coordinate in the rectangle.default void
avoidCollisionWith(RectangularPrism3afp<?,?,?,?,?,?> reference, Vector3D<?,?> result)
Move this rectangular prism to avoid collision with the reference rectangular prism.default void
avoidCollisionWith(RectangularPrism3afp<?,?,?,?,?,?> reference, Vector3D<?,?> displacementDirection, Vector3D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.static void
computeClosestPointRectanglePoint(double rminx, double rminy, double rminz, double rmaxx, double rmaxy, double rmaxz, double px, double py, double pz, Point3D<?,?> closest)
Compute the point on the rectangle that is the closest to the given point.static void
computeClosestPointRectangleRectangle(double rminx1, double rminy1, double rminz1, double rmaxx1, double rmaxy1, double rmaxz1, double rminx2, double rminy2, double rminz2, double rmaxx2, double rmaxy2, double rmaxz2, Point3D<?,?> closest)
Compute the point on the first rectangle that is the closest to the second rectangle.static void
computeClosestPointRectangleSegment(double rminx, double rminy, double rminz, double rmaxx, double rmaxy, double rmaxz, double sx1, double sy1, double sz1, double sx2, double sy2, double sz2, Point3D<?,?> closest)
Compute the point on the rectangle that is the closest to the segment.default boolean
contains(double x, double y, double z)
Replies if the given point is inside this shape.default boolean
contains(RectangularPrism3afp<?,?,?,?,?,?> rectangularPrism)
Replies if the given rectangular prism is inside this shape.static boolean
containsRectanglePoint(double rx1, double ry1, double rz1, double rx2, double ry2, double rz2, double px, double py, double pz)
Replies if a point is inside in the rectangle.static boolean
containsRectangleRectangle(double enclosingX1, double enclosingY1, double enclosingZ1, double enclosingX2, double enclosingY2, double enclosingZ2, double innerX1, double innerY1, double innerZ1, double innerX2, double innerY2, double innerZ2)
Replies if a rectangle is inside in the rectangle.default B
createIntersection(Prism3afp<?,?,?,?,?,?> prism)
Compute and replies the intersection of this rectangle and the given rectangle.default B
createUnion(Prism3afp<?,?,?,?,?,?> prism)
Compute and replies the union of this rectangle and the given rectangle.default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.default P
getClosestPointTo(Path3afp<?,?,?,?,?,?> path)
Replies the closest point on this shape to the given path.default P
getClosestPointTo(RectangularPrism3afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangular prism.default P
getClosestPointTo(Segment3afp<?,?,?,?,?,?> segment)
Replies the closest point on this shape to the given segment.default P
getClosestPointTo(Sphere3afp<?,?,?,?,?,?> circle)
Replies the closest point on this shape to the given sphere.default P
getClosestPointTo(Point3D<?,?> pt)
Replies the point on the shape that is closest to the given point.default double
getDistanceL1(Point3D<?,?> pt)
Computes the L-1 (Manhattan) distance between this shape and point p1.default double
getDistanceLinf(Point3D<?,?> pt)
Computes the L-infinite distance between this shape and point p1.default double
getDistanceSquared(Point3D<?,?> pt)
Replies the squared value of the minimal distance from this shape to the given point.default P
getFarthestPointTo(Point3D<?,?> pt)
Replies the point on the shape that is farthest the given point.default PathIterator3afp<IE>
getPathIterator(Transform3D transform)
Replies the elements of the paths.default boolean
intersects(MultiShape3afp<?,?,?,?,?,?,?> multishape)
Replies if this shape is intersecting the given multishape.default boolean
intersects(PathIterator3afp<?> iterator)
Replies if this shape is intersecting the shape representing the given path iterator.default boolean
intersects(RectangularPrism3afp<?,?,?,?,?,?> prism)
Replies if this shape is intersecting the given Prism.default boolean
intersects(Segment3afp<?,?,?,?,?,?> segment)
Replies if this shape is intersecting the given line.default boolean
intersects(Sphere3afp<?,?,?,?,?,?> sphere)
Replies if this shape is intersecting the given circle.static boolean
intersectsRectangleLine(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Replies if two rectangles are intersecting.static boolean
intersectsRectangleRectangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Replies if two rectangles are intersecting.static boolean
intersectsRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2)
Replies if the rectangle is intersecting the segment.static int
reduceCohenSutherlandZoneRectangleSegment(double rx1, double ry1, double rz1, double rx2, double ry2, double rz2, double sx1, double sy1, double sz1, double sx2, double sy2, double sz2, int codePoint1, int codePoint2, Point3D<?,?> newSegmentP1, Point3D<?,?> newSegmentP2)
Update the given Cohen-Sutherland code that corresponds to the given segment in order to obtain a segment restricted to a single Cohen-Sutherland zone.default void
set(IT shape)
Set this shape with the attributes of the given shape.default void
setIntersection(Prism3afp<?,?,?,?,?,?> prism)
Compute the intersection of this rectangle and the given rectangle.default void
setUnion(Prism3afp<?,?,?,?,?,?> prism)
Compute the union of this rectangle and the given rectangle and change this rectangle with the result of the union.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.Prism3afp
clear, getCenter, getCenterX, getCenterY, getCenterZ, getDepth, getHeight, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getWidth, inflate, isEmpty, set, set, setCenter, setCenter, setCenterX, setCenterY, setCenterZ, setDepth, setFromCenter, setFromCenter, setFromCorners, setFromCorners, setHeight, setMaxX, setMaxY, setMaxZ, setMinX, setMinY, setMinZ, setWidth, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.Shape3afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Shape3D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Method Detail
-
computeClosestPointRectanglePoint
@Pure static void computeClosestPointRectanglePoint(double rminx, double rminy, double rminz, double rmaxx, double rmaxy, double rmaxz, double px, double py, double pz, Point3D<?,?> closest)
Compute the point on the rectangle that is the closest to the given point.- Parameters:
rminx
- the minimum x coordinate of the rectangle.rminy
- the minimum y coordinate of the rectangle.rminz
- the minimum z coordinate of the rectangle.rmaxx
- the maximum x coordinate of the rectangle.rmaxy
- the maximum y coordinate of the rectangle.rmaxz
- the maximum z coordinate of the rectangle.px
- the x coordinate of the point.py
- the y coordinate of the point.pz
- the z coordinate of the point.closest
- is set with the closest point on the rectangle.
-
computeClosestPointRectangleRectangle
@Pure static void computeClosestPointRectangleRectangle(double rminx1, double rminy1, double rminz1, double rmaxx1, double rmaxy1, double rmaxz1, double rminx2, double rminy2, double rminz2, double rmaxx2, double rmaxy2, double rmaxz2, Point3D<?,?> closest)
Compute the point on the first rectangle that is the closest to the second rectangle.- Parameters:
rminx1
- the minimum x coordinate of the first rectangle.rminy1
- the minimum y coordinate of the first rectangle.rminz1
- the minimum z coordinate of the first rectangle.rmaxx1
- the maximum x coordinate of the first rectangle.rmaxy1
- the maximum y coordinate of the first rectangle.rmaxz1
- the maximum z coordinate of the first rectangle.rminx2
- the minimum x coordinate of the second rectangle.rminy2
- the minimum y coordinate of the second rectangle.rminz2
- the minimum z coordinate of the second rectangle.rmaxx2
- the maximum x coordinate of the second rectangle.rmaxy2
- the maximum y coordinate of the second rectangle.rmaxz2
- the maximum z coordinate of the second rectangle.closest
- is set with the closest point on the first rectangle.
-
computeClosestPointRectangleSegment
@Pure static void computeClosestPointRectangleSegment(double rminx, double rminy, double rminz, double rmaxx, double rmaxy, double rmaxz, double sx1, double sy1, double sz1, double sx2, double sy2, double sz2, Point3D<?,?> closest)
Compute the point on the rectangle that is the closest to the segment.- Parameters:
rminx
- the minimum x coordinate of the rectangle.rminy
- the minimum y coordinate of the rectangle.rminz
- the minimum z coordinate of the rectangle.rmaxx
- the maximum x coordinate of the rectangle.rmaxy
- the maximum y coordinate of the rectangle.rmaxz
- the maximum z coordinate of the rectangle.sx1
- the x coordinate of the first point of the segment.sy1
- the y coordinate of the first point of the segment.sz1
- the z coordinate of the first point of the segment.sx2
- the x coordinate of the second point of the segment.sy2
- the y coordinate of the second point of the segment.sz2
- the z coordinate of the second point of the segment.closest
- is set with the closest point on the rectangle.
-
reduceCohenSutherlandZoneRectangleSegment
@Pure static int reduceCohenSutherlandZoneRectangleSegment(double rx1, double ry1, double rz1, double rx2, double ry2, double rz2, double sx1, double sy1, double sz1, double sx2, double sy2, double sz2, int codePoint1, int codePoint2, Point3D<?,?> newSegmentP1, Point3D<?,?> newSegmentP2)
Update the given Cohen-Sutherland code that corresponds to the given segment in order to obtain a segment restricted to a single Cohen-Sutherland zone. This function is at the heart of the Cohen-Sutherland algorithm.The result of this function may be:
- the code for a single zone, or
- the code that corresponds to a single column, or
- the code that corresponds to a single row.
- Parameters:
rx1
- is the first corner of the rectangle.ry1
- is the first corner of the rectangle.rz1
- is the first corner of the rectangle.rx2
- is the second corner of the rectangle.ry2
- is the second corner of the rectangle.rz2
- is the second corner of the rectangle.sx1
- is the first point of the segment.sy1
- is the first point of the segment.sz1
- is the first point of the segment.sx2
- is the second point of the segment.sy2
- is the second point of the segment.sz2
- is the second point of the segment.codePoint1
- the Cohen-Sutherland code for the first point of the segment.codePoint2
- the Cohen-Sutherland code for the second point of the segment.newSegmentP1
- is set with the new coordinates of the segment first point. Ifnull
, this parameter is ignored.newSegmentP2
- is set with the new coordinates of the segment second point. Ifnull
, this parameter is ignored.- Returns:
- the rectricted Cohen-Sutherland zone.
-
intersectsRectangleRectangle
@Pure static boolean intersectsRectangleRectangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Replies if two rectangles are intersecting.- Parameters:
x1
- is the first corner of the first rectangle.y1
- is the first corner of the first rectangle.z1
- is the first corner of the first rectangle.x2
- is the second corner of the first rectangle.y2
- is the second corner of the first rectangle.z2
- is the second corner of the first rectangle.x3
- is the first corner of the second rectangle.y3
- is the first corner of the second rectangle.z3
- is the first corner of the second rectangle.x4
- is the second corner of the second rectangle.y4
- is the second corner of the second rectangle.z4
- is the second corner of the second rectangle.- Returns:
true
if the two shapes are intersecting; otherwisefalse
-
intersectsRectangleLine
@Pure static boolean intersectsRectangleLine(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Replies if two rectangles are intersecting.- Parameters:
x1
- is the first corner of the rectangle.y1
- is the first corner of the rectangle.z1
- is the first corner of the rectangle.x2
- is the second corner of the rectangle.y2
- is the second corner of the rectangle.z2
- is the second corner of the rectangle.x3
- is the first point of the line.y3
- is the first point of the line.z3
- is the first point of the line.x4
- is the second point of the line.y4
- is the second point of the line.z4
- is the second point of the line.- Returns:
true
if the two shapes are intersecting; otherwisefalse
-
intersectsRectangleSegment
@Pure static boolean intersectsRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2)
Replies if the rectangle is intersecting the segment.- Parameters:
rx1
- is the first corner of the rectangle.ry1
- is the first corner of the rectangle.rx2
- is the second corner of the rectangle.ry2
- is the second corner of the rectangle.sx1
- is the first point of the segment.sy1
- is the first point of the segment.sx2
- is the second point of the segment.sy2
- is the second point of the segment.- Returns:
true
if the two shapes are intersecting; otherwisefalse
-
containsRectangleRectangle
@Pure static boolean containsRectangleRectangle(double enclosingX1, double enclosingY1, double enclosingZ1, double enclosingX2, double enclosingY2, double enclosingZ2, double innerX1, double innerY1, double innerZ1, double innerX2, double innerY2, double innerZ2)
Replies if a rectangle is inside in the rectangle.- Parameters:
enclosingX1
- is the lowest corner of the enclosing-candidate rectangle.enclosingY1
- is the lowest corner of the enclosing-candidate rectangle.enclosingZ1
- is the lowest corner of the enclosing-candidate rectangle.enclosingX2
- is the uppest corner of the enclosing-candidate rectangle.enclosingY2
- is the uppest corner of the enclosing-candidate rectangle.enclosingZ2
- is the uppest corner of the enclosing-candidate rectangle.innerX1
- is the lowest corner of the inner-candidate rectangle.innerY1
- is the lowest corner of the inner-candidate rectangle.innerZ1
- is the lowest corner of the inner-candidate rectangle.innerX2
- is the uppest corner of the inner-candidate rectangle.innerY2
- is the uppest corner of the inner-candidate rectangle.innerZ2
- is the uppest corner of the inner-candidate rectangle.- Returns:
true
if the given rectangle is inside the ellipse; otherwisefalse
.
-
containsRectanglePoint
@Pure static boolean containsRectanglePoint(double rx1, double ry1, double rz1, double rx2, double ry2, double rz2, double px, double py, double pz)
Replies if a point is inside in the rectangle.- Parameters:
rx1
- is the lowest corner of the rectangle.ry1
- is the lowest corner of the rectangle.rz1
- is the lowest corner of the rectangle.rx2
- is the uppest corner of the rectangle.ry2
- is the uppest corner of the rectangle.rz2
- is the uppest corner of the rectangle.px
- is the point.py
- is the point.pz
- is the point.- Returns:
true
if the given point is inside the rectangle; otherwisefalse
.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape3D
Replies this shape is equal to the given shape.- Specified by:
equalsToShape
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
shape
- the shape to compare to.- Returns:
true
if this shape is equal is equal to the given path.
-
set
default void set(IT shape)
Description copied from interface:Shape3D
Set this shape with the attributes of the given shape.- Specified by:
set
in interfacePrism3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Specified by:
set
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
shape
- the shape.
-
getDistanceSquared
@Pure default double getDistanceSquared(Point3D<?,?> pt)
Description copied from interface:Shape3D
Replies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquared
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
pt
- the point.- Returns:
- squared value of the minimal distance between this shape and the point.
-
getDistanceL1
@Pure default double getDistanceL1(Point3D<?,?> pt)
Description copied from interface:Shape3D
Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
pt
- the point- Returns:
- the distance.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point3D<?,?> pt)
Description copied from interface:Shape3D
Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2)].- Specified by:
getDistanceLinf
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
pt
- the point.- Returns:
- the distance.
-
contains
@Pure default boolean contains(double x, double y, double z)
Description copied from interface:Shape3afp
Replies if the given point is inside this shape.- Specified by:
contains
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
x
- x coordinate of the point to test.y
- y coordinate of the point to test.z
- z coordinate of the point to test.- Returns:
true
if the given point is inside this shape, otherwisefalse
.
-
contains
@Pure default boolean contains(RectangularPrism3afp<?,?,?,?,?,?> rectangularPrism)
Description copied from interface:Shape3afp
Replies if the given rectangular prism is inside this shape.- Specified by:
contains
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
rectangularPrism
- the rectangular prism.- Returns:
true
if the given rectangle is inside this shape, otherwisefalse
.
-
add
default void add(Point3D<?,?> pt)
Add the given coordinate in the rectangle.The corners of the rectangles are moved to enclose the given coordinate.
- Parameters:
pt
- the point
-
add
default void add(double x, double y, double z)
Add the given coordinate in the rectangle.The corners of the rectangles are moved to enclose the given coordinates.
- Parameters:
x
- x coordinate of the point.y
- y coordinate of the point.z
- z coordinate of the point.
-
createUnion
@Pure default B createUnion(Prism3afp<?,?,?,?,?,?> prism)
Compute and replies the union of this rectangle and the given rectangle. This function does not change this rectangle.It is equivalent to (where
ur
is the union):Rectangle2f ur = new Rectangle2f(this); ur.setUnion(r);
- Parameters:
prism
- the prism- Returns:
- the union of this rectangle and the given rectangle.
- See Also:
setUnion(Prism3afp)
-
createIntersection
@Pure default B createIntersection(Prism3afp<?,?,?,?,?,?> prism)
Compute and replies the intersection of this rectangle and the given rectangle. This function does not change this rectangle.It is equivalent to (where
ir
is the intersection):Rectangle2f ir = new Rectangle2f(this); ir.setIntersection(r);
- Parameters:
prism
- the prism- Returns:
- the union of this rectangle and the given rectangle.
- See Also:
setIntersection(Prism3afp)
-
setUnion
default void setUnion(Prism3afp<?,?,?,?,?,?> prism)
Compute the union of this rectangle and the given rectangle and change this rectangle with the result of the union.- Parameters:
prism
- the prism- See Also:
createUnion(Prism3afp)
-
setIntersection
default void setIntersection(Prism3afp<?,?,?,?,?,?> prism)
Compute the intersection of this rectangle and the given rectangle. This function changes this rectangle.If there is no intersection, this rectangle is cleared.
- Parameters:
prism
- the prism- See Also:
createIntersection(Prism3afp)
,Prism3afp.clear()
-
intersects
@Pure default boolean intersects(RectangularPrism3afp<?,?,?,?,?,?> prism)
Description copied from interface:Shape3afp
Replies if this shape is intersecting the given Prism.- Specified by:
intersects
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
prism
- the prism- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Sphere3afp<?,?,?,?,?,?> sphere)
Description copied from interface:Shape3afp
Replies if this shape is intersecting the given circle.- Specified by:
intersects
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
sphere
- the sphere- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Segment3afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape3afp
Replies if this shape is intersecting the given line.- Specified by:
intersects
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
segment
- the segment- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator3afp<?> iterator)
Description copied from interface:Shape3afp
Replies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersects
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
iterator
- the iterator- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape3afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape3afp
Replies if this shape is intersecting the given multishape.- Specified by:
intersects
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
multishape
- the multishape- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
avoidCollisionWith
default void avoidCollisionWith(RectangularPrism3afp<?,?,?,?,?,?> reference, Vector3D<?,?> result)
Move this rectangular prism to avoid collision with the reference rectangular prism.- Parameters:
reference
- is the rectangular prism we want to avoid collision with.result
- the displacement vector.
-
avoidCollisionWith
default void avoidCollisionWith(RectangularPrism3afp<?,?,?,?,?,?> reference, Vector3D<?,?> displacementDirection, Vector3D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.- Parameters:
reference
- is the rectangle to avoid collision with.displacementDirection
- is the direction of the allowed displacement (it is an input). This vector is set according to the result before returning.result
- the displacement vector.
-
getClosestPointTo
@Pure default P getClosestPointTo(Point3D<?,?> pt)
Description copied from interface:Shape3D
Replies the point on the shape that is closest to the given point.- Specified by:
getClosestPointTo
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
pt
- the point.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Sphere3afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape3afp
Replies the closest point on this shape to the given sphere.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
circle
- the sphere.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Path3afp<?,?,?,?,?,?> path)
Description copied from interface:Shape3afp
Replies the closest point on this shape to the given path.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
path
- the path.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(RectangularPrism3afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape3afp
Replies the closest point on this shape to the given rectangular prism.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
rectangle
- the rectangular prism.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Segment3afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape3afp
Replies the closest point on this shape to the given segment.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
segment
- the segment.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getFarthestPointTo
@Pure default P getFarthestPointTo(Point3D<?,?> pt)
Description copied from interface:Shape3D
Replies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointTo
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
pt
- the point.- Returns:
- the farthest point on the shape.
-
getPathIterator
@Pure default PathIterator3afp<IE> getPathIterator(Transform3D transform)
Description copied from interface:Shape3D
Replies the elements of the paths.- Specified by:
getPathIterator
in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends RectangularPrism3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
- Parameters:
transform
- is the transformation to apply to the path.- Returns:
- the elements of the path.
-
-