public interface HasDistanceGrid
Modifier and Type | Method and Description |
---|---|
DistanceGrid |
getDistanceGrid()
Returns a signed distance grid maintained by this body, or
null if a grid is not available (i.e., if hasDistanceGrid() returns false ). |
int |
getDistanceGridMaxRes()
Returns the default maximum cell resolution that should be used when
constructing a signed distance grid for this component.
|
java.lang.String |
getDistanceGridRenderRanges()
Returns a string describing the x, y, z vertex ranges used when rendering
this component's signed distance grid.
|
Vector3i |
getDistanceGridRes()
Returns the cell resolutions (in the x, y, and z directions) that should
be used when constructing a signed distance grid for this component.
|
boolean |
getRenderDistanceGrid()
Queries whether this component's signed distance grid should be rendered.
|
boolean |
hasDistanceGrid()
Returns
true if this component maintains a signed distance
grid. |
void |
setDistanceGridMaxRes(int max)
Sets the default maximum cell resolution that should be used when
constructing a signed distance grid for this component.
|
void |
setDistanceGridRenderRanges(java.lang.String ranges)
Specifies the x, y, z vertex ranges used when rendering this component's
signed distance grid.
|
void |
setDistanceGridRes(Vector3i res)
Sets the cell resolution (in the x, y, and z directions) that should be
used when constructing a signed distance grid for this component.
|
void |
setRenderDistanceGrid(boolean enable)
Enables or disables rendering of this component's signed distance grid.
|
boolean hasDistanceGrid()
true
if this component maintains a signed distance
grid. Among other possible conditions, a grid is available only if either
getDistanceGridMaxRes()
or getDistanceGridRes()
return
positive values.true
if a signed distance grid is available
for this RigidBodygetDistanceGridMaxRes()
,
getDistanceGridRes()
DistanceGrid getDistanceGrid()
null
if a grid is not available (i.e., if hasDistanceGrid()
returns false
). The number of divisons in
the grid is controlled explicitly by the x, y, z values returned by
getDistanceGridRes()
, or, if those are 0, by the maximum grid
resolution returned by getDistanceGridMaxRes()
. If that is 0 as
well, no grid is available and null
will be returned.null
if a grid is
not available for this componentgetDistanceGridMaxRes()
,
getDistanceGridRes()
void setDistanceGridMaxRes(int max)
max
is <=
0,
the value will be set to 0. If the values returned by getDistanceGridRes()
) are non-zero, those will be used to specify the
cell resolutions instead. If the maximum cell resolution and the values
returned by getDistanceGridRes()
are all 0, then no signed
distance grid will be available for this component and hasDistanceGrid()
will return false.max
- default maximum cell resolution for constructing a signed
distance gridint getDistanceGridMaxRes()
getDistanceGridMaxRes()
for a more detailed description.void setDistanceGridRes(Vector3i res)
<=
0, then all of the values are
set to zero and the value returned by getDistanceGridMaxRes()
) is
used to determine the grid divisions instead.res
- cell resolution along x, y, z axes to be used in constructing
a signed distance gridgetDistanceGridRes()
Vector3i getDistanceGridRes()
setDistanceGridRes(maspack.matrix.Vector3i)
for a more detailed description.setDistanceGridRes(maspack.matrix.Vector3i)
boolean getRenderDistanceGrid()
true
if distance grid rendering is enabledvoid setRenderDistanceGrid(boolean enable)
enable
- if true
, enables distance grid renderingjava.lang.String getDistanceGridRenderRanges()
setDistanceGridRenderRanges(java.lang.String)
for a more detailed description.setDistanceGridRenderRanges(java.lang.String)
void setDistanceGridRenderRanges(java.lang.String ranges)
numVX
X numVY
X numVZ
vertices in
the x, y, z directions, where numVX
, numVY
, and
numVZ
are each one greater than the x, y, z cell resolution
values returned by the InterpolatingGridBase.getResolution()
method of the distance grid itself. In general, the range string should
contain three range specifications, one for each axis, where each
specification is either *
(all vertices), n:m
(vertices in the index range n
to m
, inclusive),
or n
(vertices only at index n
). A
range specification of "* * *"
(or "*"
)
means draw all vertices, which is the default behavior. Other
examples include:
"* 7 *" - all vertices along x and z, and those at index 7 along y "0 2 3" - a single vertex at indices (0, 2, 3) "0:3 4:5 *" - all vertices between indices 0 and 3 along x, and 4 and 5 along y
ranges
- describing the render rangesjava.lang.IllegalArgumentException
- if the range syntax is invalid
or out of rangegetDistanceGridRenderRanges()