Force spuNodeCallback to be 16-byte aligned, so that we can use SIMD. Related to Issue 657
Recompute the quantization values in case the maximum/minimum extends roundtrip using quantize/unQuantize are out-of-range (alternatively, pass in a larger quantizationMargin)
This commit is contained in:
@@ -96,7 +96,25 @@ void btQuantizedBvh::setQuantizationValues(const btVector3& bvhAabbMin,const btV
|
||||
m_bvhAabbMax = bvhAabbMax + clampValue;
|
||||
btVector3 aabbSize = m_bvhAabbMax - m_bvhAabbMin;
|
||||
m_bvhQuantization = btVector3(btScalar(65533.0),btScalar(65533.0),btScalar(65533.0)) / aabbSize;
|
||||
|
||||
m_useQuantization = true;
|
||||
|
||||
{
|
||||
unsigned short vecIn[3];
|
||||
btVector3 v;
|
||||
{
|
||||
quantize(vecIn,bvhAabbMin,false);
|
||||
v = unQuantize(vecIn);
|
||||
m_bvhAabbMin.setMin(v-clampValue);
|
||||
}
|
||||
{
|
||||
quantize(vecIn,bvhAabbMax,true);
|
||||
v = unQuantize(vecIn);
|
||||
m_bvhAabbMax.setMax(v+clampValue);
|
||||
}
|
||||
aabbSize = m_bvhAabbMax - m_bvhAabbMin;
|
||||
m_bvhQuantization = btVector3(btScalar(65533.0),btScalar(65533.0),btScalar(65533.0)) / aabbSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user