Ejemplo n.º 1
0
// UNEXPOSED
float CPhysicsObject::GetDragInDirection(const btVector3 &dir) const {
	btVector3 out;
	btMatrix3x3 mat = m_pObject->getCenterOfMassTransform().getBasis();
	BtMatrix_vimult(mat, dir, out);

	return m_dragCoefficient * out.absolute().dot(m_dragBasis.absolute());
}
Ejemplo n.º 2
0
float CPhysicsObject::GetDragInDirection(btVector3  * dir) const
{
	btVector3 out;
	btMatrix3x3 mat = m_pObject->getCenterOfMassTransform().getBasis(); // const IVP_U_Matrix *m_world_f_core = m_pObject->get_core()->get_m_world_f_core_PSI();
	BtMatrix_vimult(&mat, dir, &out); // m_world_f_core->vimult3( &velocity, &local );

	return m_dragCoefficient * fabs(out.getX() * m_dragBasis.getX()) +	// Maybe the fabs need to be calculated first AND THEN be multiplied with the m_dragCoefficient
		fabs(out.getY() * m_dragBasis.getY()) +							// However this is the way its done in the 2003 code.
		fabs(out.getZ() * m_dragBasis.getZ());
	
}