merged most of the changes from the branch into trunk, except for COLLADA, libxml and glut glitches.
Still need to verify to make sure no unwanted renaming is introduced.
This commit is contained in:
@@ -14,7 +14,7 @@ subject to the following restrictions:
|
||||
*/
|
||||
|
||||
#include "btConeShape.h"
|
||||
#include "LinearMath/SimdPoint3.h"
|
||||
#include "LinearMath/btPoint3.h"
|
||||
|
||||
#ifdef WIN32
|
||||
static int coneindices[3] = {1,2,0};
|
||||
@@ -22,23 +22,23 @@ static int coneindices[3] = {1,2,0};
|
||||
static int coneindices[3] = {2,1,0};
|
||||
#endif
|
||||
|
||||
ConeShape::ConeShape (SimdScalar radius,SimdScalar height):
|
||||
btConeShape::btConeShape (btScalar radius,btScalar height):
|
||||
m_radius (radius),
|
||||
m_height(height)
|
||||
{
|
||||
SimdVector3 halfExtents;
|
||||
btVector3 halfExtents;
|
||||
m_sinAngle = (m_radius / sqrt(m_radius * m_radius + m_height * m_height));
|
||||
}
|
||||
|
||||
|
||||
SimdVector3 ConeShape::ConeLocalSupport(const SimdVector3& v) const
|
||||
btVector3 btConeShape::ConeLocalSupport(const btVector3& v) const
|
||||
{
|
||||
|
||||
float halfHeight = m_height * 0.5f;
|
||||
|
||||
if (v[coneindices[1]] > v.length() * m_sinAngle)
|
||||
{
|
||||
SimdVector3 tmp;
|
||||
btVector3 tmp;
|
||||
|
||||
tmp[coneindices[0]] = 0.f;
|
||||
tmp[coneindices[1]] = halfHeight;
|
||||
@@ -46,17 +46,17 @@ SimdVector3 ConeShape::ConeLocalSupport(const SimdVector3& v) const
|
||||
return tmp;
|
||||
}
|
||||
else {
|
||||
SimdScalar s = SimdSqrt(v[coneindices[0]] * v[coneindices[0]] + v[coneindices[2]] * v[coneindices[2]]);
|
||||
btScalar s = btSqrt(v[coneindices[0]] * v[coneindices[0]] + v[coneindices[2]] * v[coneindices[2]]);
|
||||
if (s > SIMD_EPSILON) {
|
||||
SimdScalar d = m_radius / s;
|
||||
SimdVector3 tmp;
|
||||
btScalar d = m_radius / s;
|
||||
btVector3 tmp;
|
||||
tmp[coneindices[0]] = v[coneindices[0]] * d;
|
||||
tmp[coneindices[1]] = -halfHeight;
|
||||
tmp[coneindices[2]] = v[coneindices[2]] * d;
|
||||
return tmp;
|
||||
}
|
||||
else {
|
||||
SimdVector3 tmp;
|
||||
btVector3 tmp;
|
||||
tmp[coneindices[0]] = 0.f;
|
||||
tmp[coneindices[1]] = -halfHeight;
|
||||
tmp[coneindices[2]] = 0.f;
|
||||
@@ -66,27 +66,27 @@ SimdVector3 ConeShape::ConeLocalSupport(const SimdVector3& v) const
|
||||
|
||||
}
|
||||
|
||||
SimdVector3 ConeShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec) const
|
||||
btVector3 btConeShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec) const
|
||||
{
|
||||
return ConeLocalSupport(vec);
|
||||
}
|
||||
|
||||
void ConeShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
|
||||
void btConeShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
|
||||
{
|
||||
for (int i=0;i<numVectors;i++)
|
||||
{
|
||||
const SimdVector3& vec = vectors[i];
|
||||
const btVector3& vec = vectors[i];
|
||||
supportVerticesOut[i] = ConeLocalSupport(vec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SimdVector3 ConeShape::LocalGetSupportingVertex(const SimdVector3& vec) const
|
||||
btVector3 btConeShape::LocalGetSupportingVertex(const btVector3& vec) const
|
||||
{
|
||||
SimdVector3 supVertex = ConeLocalSupport(vec);
|
||||
btVector3 supVertex = ConeLocalSupport(vec);
|
||||
if ( GetMargin()!=0.f )
|
||||
{
|
||||
SimdVector3 vecnorm = vec;
|
||||
btVector3 vecnorm = vec;
|
||||
if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
|
||||
{
|
||||
vecnorm.setValue(-1.f,-1.f,-1.f);
|
||||
|
||||
Reference in New Issue
Block a user