mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-21 08:10:56 +00:00
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:
@@ -90,11 +90,11 @@ b3Vector3 color[4]=
|
||||
void b3QuantizedBvh::setQuantizationValues(const b3Vector3& bvhAabbMin,const b3Vector3& bvhAabbMax,b3Scalar quantizationMargin)
|
||||
{
|
||||
//enlarge the AABB to avoid division by zero when initializing the quantization values
|
||||
b3Vector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
|
||||
b3Vector3 clampValue =b3MakeVector3(quantizationMargin,quantizationMargin,quantizationMargin);
|
||||
m_bvhAabbMin = bvhAabbMin - clampValue;
|
||||
m_bvhAabbMax = bvhAabbMax + clampValue;
|
||||
b3Vector3 aabbSize = m_bvhAabbMax - m_bvhAabbMin;
|
||||
m_bvhQuantization = b3Vector3(b3Scalar(65533.0),b3Scalar(65533.0),b3Scalar(65533.0)) / aabbSize;
|
||||
m_bvhQuantization = b3MakeVector3(b3Scalar(65533.0),b3Scalar(65533.0),b3Scalar(65533.0)) / aabbSize;
|
||||
m_useQuantization = true;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ int b3QuantizedBvh::sortAndCalcSplittingIndex(int startIndex,int endIndex,int sp
|
||||
int numIndices = endIndex - startIndex;
|
||||
b3Scalar splitValue;
|
||||
|
||||
b3Vector3 means(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
b3Vector3 means=b3MakeVector3(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
for (i=startIndex;i<endIndex;i++)
|
||||
{
|
||||
b3Vector3 center = b3Scalar(0.5)*(getAabbMax(i)+getAabbMin(i));
|
||||
@@ -284,8 +284,8 @@ int b3QuantizedBvh::calcSplittingAxis(int startIndex,int endIndex)
|
||||
{
|
||||
int i;
|
||||
|
||||
b3Vector3 means(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
b3Vector3 variance(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
b3Vector3 means=b3MakeVector3(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
b3Vector3 variance=b3MakeVector3(b3Scalar(0.),b3Scalar(0.),b3Scalar(0.));
|
||||
int numIndices = endIndex-startIndex;
|
||||
|
||||
for (i=startIndex;i<endIndex;i++)
|
||||
@@ -754,7 +754,7 @@ void b3QuantizedBvh::walkStacklessQuantizedTreeCacheFriendly(b3NodeOverlapCallba
|
||||
|
||||
void b3QuantizedBvh::reportRayOverlappingNodex (b3NodeOverlapCallback* nodeCallback, const b3Vector3& raySource, const b3Vector3& rayTarget) const
|
||||
{
|
||||
reportBoxCastOverlappingNodex(nodeCallback,raySource,rayTarget,b3Vector3(0,0,0),b3Vector3(0,0,0));
|
||||
reportBoxCastOverlappingNodex(nodeCallback,raySource,rayTarget,b3MakeVector3(0,0,0),b3MakeVector3(0,0,0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user