예제 #1
0
NewtonUserJoint::NewtonUserJoint (dgWorld * const world, dgInt32 maxDof, NewtonUserBilateralCallback callback, NewtonUserBilateralGetInfoCallback getInfo, dgBody * const dyn0, dgBody * const dyn1)
   : dgUserConstraint (world, dyn0, dyn1, 1)
{
   m_rows = 0;
   m_maxDOF = dgUnsigned8 (maxDof);
   m_jacobianFnt = callback;
   m_getInfoCallback = getInfo;
   dgAssert (world);
   m_forceArray = m_jointForce;
   if (m_maxDOF > DG_BILATERAL_CONTRAINT_DOF)
      m_forceArray = (dgForceImpactPair *) world->GetAllocator()->Malloc (dgInt32 (m_maxDOF * sizeof (dgForceImpactPair)));
   memset (m_forceArray, 0, m_maxDOF * sizeof (dgFloat32));
}
예제 #2
0
NewtonUserJoint::NewtonUserJoint (
	dgWorld* world, 
	dgInt32 maxDof, 
	NewtonUserBilateralCallBack callback, 
	NewtonUserBilateralGetInfoCallBack getInfo,
	dgBody *dyn0, 
	dgBody *dyn1)
	:dgUserConstraint (world, dyn0, dyn1, 1)
{
	m_rows = 0;
	m_maxDOF = dgUnsigned8(maxDof);
	m_jacobianFnt = callback;
	m_getInfoCallback = getInfo;

	_ASSERTE (world);
	m_forceArray = m_jointForce;
	if (m_maxDOF > 24) {
		_ASSERTE (0);
		m_forceArray = (dgFloat32*) world->GetAllocator()->Malloc (dgInt32 (m_maxDOF * sizeof (dgFloat32)));
	}
	memset (m_forceArray, 0, m_maxDOF * sizeof (dgFloat32));
}