btBoxShape needs setHalfExtents?

User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

btBoxShape needs setHalfExtents?

Post by ejtttje »

Currently the btBoxShape dimensions can only be set from the constructor. Afterwards, they can be modified by setLocalScaling, which is rather awkward way to change the size to a new arbitrary value.

Am I missing something? Any particular reason there's no way to reset the m_implicitShapeDimensions the same way the constructor does? Otherwise I propose adding:

Code: Select all

	void btBoxShape::setHalfExtent( const btVector3& boxHalfExtents) 
	{
		btVector3 margin(getMargin(),getMargin(),getMargin());
		m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
	}