public final class PVolumesF
extends java.lang.Object
Functions over volumes.
These functions operate using the concepts of minimum-x, maximum-x, minimum-y, maximum-y, minimum-z, maximum-z, edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x, "top" for minimum-y, or "far" for minimum-z.
| Modifier and Type | Method | Description |
|---|---|---|
static <S,T> PVolumeF<T> |
cast(PVolumeF<S> volume) |
Brand a given volume as belonging to a different coordinate space.
|
static <S> PVolumeF<S> |
containing(PVolumeF<S> a,
PVolumeF<S> b) |
Construct a volume that will contain both
a and b. |
static <S> boolean |
contains(PVolumeF<S> a,
PVolumeF<S> b) |
Determine whether or not one volume contains another.
|
static <S> boolean |
containsPoint(PVolumeF<S> a,
float x,
float y,
float z) |
Determine whether or not a volume contains a given point.
|
static <S> boolean |
couldFitInside(PVolumeF<S> a,
PVolumeF<S> b) |
Determine whether or not one volume could fit inside another.
|
static <S> PVolumeF<S> |
create(float x,
float y,
float z,
float size_x,
float size_y,
float size_z) |
Create a volume of size (
size_x, size_y, size_z)
placing the minimum corner at (x, y, z). |
static <S> PVolumeF<S> |
moveAbsolute(PVolumeF<S> volume,
float x,
float y,
float z) |
Move the given volume to
(x, y, z). |
static <S> PVolumeF<S> |
moveRelative(PVolumeF<S> volume,
float x,
float y,
float z) |
Move the given volume by
(x, y, z). |
static <S> PVolumeF<S> |
moveToOrigin(PVolumeF<S> volume) |
Move the given volume to
(0, 0, 0). |
static <S> boolean |
overlaps(PVolumeF<S> a,
PVolumeF<S> b) |
Determine whether or not two volumes overlap.
|
static <S> java.lang.String |
show(PVolumeF<S> volume) |
|
static <S> java.lang.String |
showToBuilder(PVolumeF<S> volume,
java.lang.StringBuilder sb) |
|
static <S> PVolumeSizeF<S> |
size(PVolumeF<S> volume) |
|
static <S> PVolumeXYZSplitF<S,PVolumeF<S>> |
splitAtXYZ(PVolumeF<S> v,
float x,
float y,
float z) |
Split the given volume at point
(x, y, z). |
public static <S> PVolumeF<S> create(float x, float y, float z, float size_x, float size_y, float size_z)
size_x, size_y, size_z)
placing the minimum corner at (x, y, z).S - The coordinate space of the volumex - The X value of the minimum cornery - The Y value of the minimum cornerz - The Z value of the minimum cornersize_x - The size of the volume on the X axissize_y - The size of the volume on the Y axissize_z - The size of the volume on the Z axispublic static <S> boolean contains(PVolumeF<S> a, PVolumeF<S> b)
Determine whether or not one volume contains another.
Containing is reflexive: contains(a, a) == true.
Containing is transitive: contains(a, b) \u2192 contains(b, c) \u2192
contains(a, c).
Containing is not necessarily symmetric.
S - The coordinate space of the volumesa - Volume Ab - Volume Btrue iff a contains bpublic static <S> PVolumeF<S> moveRelative(PVolumeF<S> volume, float x, float y, float z)
(x, y, z).S - The coordinate space of the volumevolume - The volumex - The amount to move on the X axisy - The amount to move on the Y axisz - The amount to move on the Z axispublic static <S> PVolumeF<S> moveAbsolute(PVolumeF<S> volume, float x, float y, float z)
(x, y, z).S - The coordinate space of the volumevolume - The volumex - The position to which to move on the X axisy - The position to which to move on the Y axisz - The position to which to move on the Z axispublic static <S> PVolumeF<S> moveToOrigin(PVolumeF<S> volume)
(0, 0, 0).S - The coordinate space of the volumevolume - The volumepublic static <S,T> PVolumeF<T> cast(PVolumeF<S> volume)
S - The starting coordinate spaceT - The resulting coordinate spacevolume - A volumevolumepublic static <S> boolean overlaps(PVolumeF<S> a, PVolumeF<S> b)
Determine whether or not two volumes overlap.
Overlapping is reflexive: overlaps(a, a) == true.
Overlapping is symmetric: overlaps(a, b) == overlaps(b, a).
Overlapping is not necessarily transitive.
S - The coordinate space of the volumesa - A volumeb - A volumetrue iff a overlaps bpublic static <S> boolean couldFitInside(PVolumeF<S> a, PVolumeF<S> b)
Determine whether or not one volume could fit inside another.
Fitting is reflexive: couldFitInside(a, a) == true.
Fitting is transitive: couldFitInside(a, b) \u2192 couldFitInside(b,
c) \u2192 couldFitInside(a, c).
Fitting is not necessarily symmetric.
S - The coordinate space of the volumesa - A volumeb - A volumetrue iff a could fit inside bpublic static <S> PVolumeF<S> containing(PVolumeF<S> a, PVolumeF<S> b)
a and b.S - The coordinate space of the volumesa - A volumeb - A volumea and bpublic static <S> boolean containsPoint(PVolumeF<S> a, float x, float y, float z)
Determine whether or not a volume contains a given point.
S - The coordinate space of the volumea - A volumex - The X coordinate of the pointy - The Y coordinate of the pointz - The Z coordinate of the pointtrue iff a contains (x, y, z)public static <S> PVolumeXYZSplitF<S,PVolumeF<S>> splitAtXYZ(PVolumeF<S> v, float x, float y, float z)
Split the given volume at point (x, y, z).
S - The coordinate space of the volumev - A volumex - The X coordinate of the pointy - The Y coordinate of the pointz - The Z coordinate of the pointtrue iff a contains (x, y, z)public static <S> java.lang.String show(PVolumeF<S> volume)
S - The coordinate space of the volumevolume - The volumepublic static <S> PVolumeSizeF<S> size(PVolumeF<S> volume)
S - The coordinate space of the volumevolume - The volumepublic static <S> java.lang.String showToBuilder(PVolumeF<S> volume, java.lang.StringBuilder sb)
S - The coordinate space of the volumevolume - The volumesb - A string builderCopyright © 2017 <code@io7m.com> http://io7m.com