support compound versus compound collision shape acceleration on GPU, using aabb tree versus aabb tree.
Remove constructor from b3Vector3, to make it a POD type, so it can go into a union (and more compatible with OpenCL float4) Use b3MakeVector3 instead of constructor Share some code between C++ and GPU in a shared file: see b3TransformAabb2 in src/Bullet3Collision/BroadPhaseCollision/shared/b3Aabb.h Improve PairBench a bit, show timings and #overlapping pairs. Increase shadowmap default size to 8192x8192 (hope the GPU supports it)
This commit is contained in:
@@ -141,7 +141,7 @@ B3_FORCE_INLINE bool b3RayAabb(const b3Vector3& rayFrom,
|
||||
b3Vector3 r = target - source;
|
||||
int i;
|
||||
b3Scalar normSign = 1;
|
||||
b3Vector3 hitNormal(0,0,0);
|
||||
b3Vector3 hitNormal = b3MakeVector3(0,0,0);
|
||||
int bit=1;
|
||||
|
||||
for (int j=0;j<2;j++)
|
||||
@@ -181,7 +181,7 @@ B3_FORCE_INLINE bool b3RayAabb(const b3Vector3& rayFrom,
|
||||
|
||||
B3_FORCE_INLINE void b3TransformAabb(const b3Vector3& halfExtents, b3Scalar margin,const b3Transform& t,b3Vector3& aabbMinOut,b3Vector3& aabbMaxOut)
|
||||
{
|
||||
b3Vector3 halfExtentsWithMargin = halfExtents+b3Vector3(margin,margin,margin);
|
||||
b3Vector3 halfExtentsWithMargin = halfExtents+b3MakeVector3(margin,margin,margin);
|
||||
b3Matrix3x3 abs_b = t.getBasis().absolute();
|
||||
b3Vector3 center = t.getOrigin();
|
||||
b3Vector3 extent = halfExtentsWithMargin.dot3( abs_b[0], abs_b[1], abs_b[2] );
|
||||
@@ -196,7 +196,7 @@ B3_FORCE_INLINE void b3TransformAabb(const b3Vector3& localAabbMin,const b3Vecto
|
||||
//b3Assert(localAabbMin.getY() <= localAabbMax.getY());
|
||||
//b3Assert(localAabbMin.getZ() <= localAabbMax.getZ());
|
||||
b3Vector3 localHalfExtents = b3Scalar(0.5)*(localAabbMax-localAabbMin);
|
||||
localHalfExtents+=b3Vector3(margin,margin,margin);
|
||||
localHalfExtents+=b3MakeVector3(margin,margin,margin);
|
||||
|
||||
b3Vector3 localCenter = b3Scalar(0.5)*(localAabbMax+localAabbMin);
|
||||
b3Matrix3x3 abs_b = trans.getBasis().absolute();
|
||||
|
||||
@@ -1943,14 +1943,14 @@ static bool b3PointCmp(const b3ConvexHullInternal::Point32& p, const b3ConvexHul
|
||||
|
||||
void b3ConvexHullInternal::compute(const void* coords, bool doubleCoords, int stride, int count)
|
||||
{
|
||||
b3Vector3 min(b3Scalar(1e30), b3Scalar(1e30), b3Scalar(1e30)), max(b3Scalar(-1e30), b3Scalar(-1e30), b3Scalar(-1e30));
|
||||
b3Vector3 min = b3MakeVector3(b3Scalar(1e30), b3Scalar(1e30), b3Scalar(1e30)), max = b3MakeVector3(b3Scalar(-1e30), b3Scalar(-1e30), b3Scalar(-1e30));
|
||||
const char* ptr = (const char*) coords;
|
||||
if (doubleCoords)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
const double* v = (const double*) ptr;
|
||||
b3Vector3 p((b3Scalar) v[0], (b3Scalar) v[1], (b3Scalar) v[2]);
|
||||
b3Vector3 p = b3MakeVector3((b3Scalar) v[0], (b3Scalar) v[1], (b3Scalar) v[2]);
|
||||
ptr += stride;
|
||||
min.setMin(p);
|
||||
max.setMax(p);
|
||||
@@ -1961,7 +1961,7 @@ void b3ConvexHullInternal::compute(const void* coords, bool doubleCoords, int st
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
const float* v = (const float*) ptr;
|
||||
b3Vector3 p(v[0], v[1], v[2]);
|
||||
b3Vector3 p = b3MakeVector3(v[0], v[1], v[2]);
|
||||
ptr += stride;
|
||||
min.setMin(p);
|
||||
max.setMax(p);
|
||||
@@ -2007,7 +2007,7 @@ void b3ConvexHullInternal::compute(const void* coords, bool doubleCoords, int st
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
const double* v = (const double*) ptr;
|
||||
b3Vector3 p((b3Scalar) v[0], (b3Scalar) v[1], (b3Scalar) v[2]);
|
||||
b3Vector3 p = b3MakeVector3((b3Scalar) v[0], (b3Scalar) v[1], (b3Scalar) v[2]);
|
||||
ptr += stride;
|
||||
p = (p - center) * s;
|
||||
points[i].x = (btInt32_t) p[medAxis];
|
||||
@@ -2021,7 +2021,7 @@ void b3ConvexHullInternal::compute(const void* coords, bool doubleCoords, int st
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
const float* v = (const float*) ptr;
|
||||
b3Vector3 p(v[0], v[1], v[2]);
|
||||
b3Vector3 p = b3MakeVector3(v[0], v[1], v[2]);
|
||||
ptr += stride;
|
||||
p = (p - center) * s;
|
||||
points[i].x = (btInt32_t) p[medAxis];
|
||||
|
||||
Reference in New Issue
Block a user