|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.geometry.SignedDistanceGrid
public class SignedDistanceGrid
SignedDistanceGrid is a class used to create, render, and use a signed distance field for collision detection purposes.
Field Summary | |
---|---|
SignedDistanceGridCell[] |
gridCellArray
|
static double |
OUTSIDE
|
Fields inherited from interface maspack.render.GLRenderable |
---|
TRANSLUCENT, TWO_DIMENSIONAL |
Constructor Summary | |
---|---|
SignedDistanceGrid()
|
|
SignedDistanceGrid(PolygonalMesh m,
double gridSizeMargin)
|
|
SignedDistanceGrid(PolygonalMesh m,
double gridSizeMargin,
Vector3d cellDivisions)
|
Method Summary | |
---|---|
int[] |
getClosestFace()
|
int |
getClosestFace(int idx)
Returns the index in faces corresponding to the closest face
at this point in phi . |
double |
getDistanceAndNormal(Vector3d norm,
double x,
double y,
double z)
Calculates the normal at a point in the grid in mesh coordinates. |
double |
getDistanceAndNormal(Vector3d norm,
Vector3d point)
Calculates the normal at a point in the grid in mesh coordinates. |
Face[] |
getFaces()
|
SignedDistanceGridCell |
getGridCell(int idx)
|
Vector3d |
getGridCellSize()
|
int[] |
getGridSize()
|
Vector3d |
getMax()
|
double[] |
getMeshCoordinatesFromGrid(int x,
int y,
int z)
|
void |
getMeshCoordinatesFromGrid(Point3d meshCoords,
double x,
double y,
double z)
|
Vector3d |
getMeshMax()
|
Vector3d |
getMeshMin()
|
Vector3d |
getMin()
|
Vector3d |
getNormal(int x,
int y,
int z)
|
double[] |
getPhi()
|
double |
getPhiAtPoint(int[] point)
|
double |
getPhiAtPoint(int x,
int y,
int z)
|
int |
getRenderHints()
Returns a bit code giving rendering hints about this renderable. |
double |
interpolatePhi(Vector3d point)
Calculates the distance at a point on the grid in mesh coordinates. |
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer. |
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL. |
void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double OUTSIDE
public SignedDistanceGridCell[] gridCellArray
Constructor Detail |
---|
public SignedDistanceGrid()
public SignedDistanceGrid(PolygonalMesh m, double gridSizeMargin)
public SignedDistanceGrid(PolygonalMesh m, double gridSizeMargin, Vector3d cellDivisions)
Method Detail |
---|
public double interpolatePhi(Vector3d point)
point
- The point on the grid, in the same units as the corresponding
mesh.
public double getDistanceAndNormal(Vector3d norm, double x, double y, double z)
x
- x coordinate of point in mesh coordinates.y
- y coordinate of point in mesh coordinates.z
- z coordinate of point in mesh coordinates.
public double getDistanceAndNormal(Vector3d norm, Vector3d point)
norm
- Used to return the normal.point
- The point at which to calculate the normal and distance
in mesh coordinates.
public int[] getGridSize()
public Vector3d getGridCellSize()
public Vector3d getMin()
public Vector3d getMax()
public SignedDistanceGridCell getGridCell(int idx)
public Vector3d getNormal(int x, int y, int z)
public double[] getPhi()
public double getPhiAtPoint(int x, int y, int z)
public double getPhiAtPoint(int[] point)
public void prerender(RenderList list)
GLRenderable
prerender
in interface GLRenderable
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface GLRenderable
pmin
- minimum pointpmax
- maximum pointpublic int getRenderHints()
GLRenderable
TRANSLUCENT
.
getRenderHints
in interface GLRenderable
public Face[] getFaces()
public int[] getClosestFace()
public int getClosestFace(int idx)
faces
corresponding to the closest face
at this point in phi
.
idx
- The index of phi that corresponds to the point in question.public double[] getMeshCoordinatesFromGrid(int x, int y, int z)
public void getMeshCoordinatesFromGrid(Point3d meshCoords, double x, double y, double z)
public Vector3d getMeshMin()
public Vector3d getMeshMax()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |