fix mesh size, decouple mesh topology from geometry, add polygon triangulation to make mass calculation O(n) in memory
This commit is contained in:
@@ -22,43 +22,6 @@
|
||||
#include <bounce/common/math/math.h>
|
||||
#include <bounce/common/math/transform.h>
|
||||
|
||||
// A triangle in indexed form.
|
||||
struct b3Triangle
|
||||
{
|
||||
// Does nothing for performance.
|
||||
b3Triangle() { }
|
||||
|
||||
// Set this triangle from three vertices.
|
||||
b3Triangle(u32 _v1, u32 _v2, u32 _v3)
|
||||
{
|
||||
v1 = _v1;
|
||||
v2 = _v2;
|
||||
v3 = _v3;
|
||||
}
|
||||
|
||||
// Set this triangle from three vertices.
|
||||
void Set(u32 _v1, u32 _v2, u32 _v3)
|
||||
{
|
||||
v1 = _v1;
|
||||
v2 = _v2;
|
||||
v3 = _v3;
|
||||
}
|
||||
|
||||
// Test if this triangle contains a given vertex.
|
||||
bool TestVertex(u32 v) const
|
||||
{
|
||||
return v == v1 || v == v2 || v == v3;
|
||||
}
|
||||
|
||||
// Test if this triangle contains two vertices.
|
||||
bool TestEdge(u32 _v1, u32 _v2) const
|
||||
{
|
||||
return TestVertex(_v1) && TestVertex(_v2);
|
||||
}
|
||||
|
||||
u32 v1, v2, v3;
|
||||
};
|
||||
|
||||
// A plane in constant normal form.
|
||||
// dot(n, p) - d = 0.
|
||||
struct b3Plane
|
||||
|
Reference in New Issue
Block a user