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:
erwincoumans
2013-08-20 03:19:59 -07:00
parent 41ba48b10d
commit 677722bba3
62 changed files with 1827 additions and 564 deletions

View File

@@ -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();