Example #1
0
void	btCylinderShapeX::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
{
	for (int i=0;i<numVectors;i++)
	{
		supportVerticesOut[i] = CylinderLocalSupportX(getHalfExtents(),vectors[i]);
	}
}
Example #2
0
bool OrientedBox3F::isContained( const Point3F& point ) const
{
   Point3F distToCenter = point - getCenter();
   for( U32 i = 0; i < 3; ++ i )
   {
      F32 coeff = mDot( distToCenter, getAxis( i ) );
      if( mFabs( coeff ) > getHalfExtents()[ i ] )
         return false;
   }

   return true;
}
Example #3
0
void	btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
{
	//btScalar margin = btScalar(0.);
	btVector3 halfExtents = getHalfExtents();

	btScalar lx=btScalar(2.)*(halfExtents.x());
	btScalar ly=btScalar(2.)*(halfExtents.y());
	btScalar lz=btScalar(2.)*(halfExtents.z());

	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
					mass/(btScalar(12.0)) * (lx*lx + ly*ly));

}
Example #4
0
void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
{
	btVector3 halfExtents = getHalfExtents();

	btMatrix3x3 abs_b = t.getBasis().absolute();  
	btPoint3 center = t.getOrigin();
	btVector3 extent = btVector3(abs_b[0].dot(halfExtents),
		   abs_b[1].dot(halfExtents),
		  abs_b[2].dot(halfExtents));
	extent += btVector3(getMargin(),getMargin(),getMargin());

	aabbMin = center - extent;
	aabbMax = center + extent;


}
Example #5
0
btVector3	btCylinderShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
{
	return CylinderLocalSupportY(getHalfExtents(),vec);
}