forked from mikedh/v-hacd-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished implementing the raycast projection code
- Loading branch information
jratcliff
committed
Aug 9, 2017
1 parent
9b6e5a6
commit dd20bd4
Showing
15 changed files
with
104 additions
and
580 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef RAYCAST_MESH_H | ||
|
||
#define RAYCAST_MESH_H | ||
|
||
#include <stdint.h> | ||
|
||
namespace VHACD | ||
{ | ||
|
||
// Very simple brute force raycast against a triangle mesh. Tests every triangle; no hierachy. | ||
// Does a deep copy, always does calculations with full double float precision | ||
class RaycastMesh | ||
{ | ||
public: | ||
static RaycastMesh * createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh | ||
uint32_t vertexStride, | ||
const double *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. | ||
uint32_t tcount, // The number of triangles in the source triangle mesh | ||
uint32_t triangleStride, | ||
const uint32_t *indices); // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... | ||
|
||
static RaycastMesh * createRaycastMesh(uint32_t vcount, // The number of vertices in the source triangle mesh | ||
uint32_t vertexStride, | ||
const float *vertices, // The array of vertex positions in the format x1,y1,z1..x2,y2,z2.. etc. | ||
uint32_t tcount, // The number of triangles in the source triangle mesh | ||
uint32_t triangleStride, | ||
const uint32_t *indices); // The triangle indices in the format of i1,i2,i3 ... i4,i5,i6, ... | ||
|
||
|
||
virtual bool raycast(const double *from, // The starting point of the raycast | ||
const double *to, // The ending point of the raycast | ||
const double *closestToPoint, // The point to match the nearest hit location (can just be the 'from' location of no specific point) | ||
double *hitLocation, // The point where the ray hit nearest to the 'closestToPoint' location | ||
double *hitDistance) = 0; // The distance the ray traveled to the hit location | ||
|
||
virtual void release(void) = 0; | ||
protected: | ||
virtual ~RaycastMesh(void) { }; | ||
}; | ||
|
||
} // end of VHACD namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.