mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
Merge pull request #1399 from jonathantompson/gear_info
Gear constraint fixes.
This commit is contained in:
commit
3fab80a50a
@ -653,6 +653,22 @@ const SharedMemoryStatus* PhysicsClientSharedMemory::processServerStatus() {
|
|||||||
{
|
{
|
||||||
userConstraintPtr->m_maxAppliedForce = serverConstraint->m_maxAppliedForce;
|
userConstraintPtr->m_maxAppliedForce = serverConstraint->m_maxAppliedForce;
|
||||||
}
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_RATIO)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_gearRatio = serverConstraint->m_gearRatio;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_relativePositionTarget = serverConstraint->m_relativePositionTarget;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_ERP)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_erp = serverConstraint->m_erp;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_gearAuxLink = serverConstraint->m_gearAuxLink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -780,6 +780,22 @@ void PhysicsDirect::postProcessStatus(const struct SharedMemoryStatus& serverCmd
|
|||||||
{
|
{
|
||||||
userConstraintPtr->m_maxAppliedForce = serverConstraint->m_maxAppliedForce;
|
userConstraintPtr->m_maxAppliedForce = serverConstraint->m_maxAppliedForce;
|
||||||
}
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_RATIO)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_gearRatio = serverConstraint->m_gearRatio;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_relativePositionTarget = serverConstraint->m_relativePositionTarget;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_ERP)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_erp = serverConstraint->m_erp;
|
||||||
|
}
|
||||||
|
if (serverCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK)
|
||||||
|
{
|
||||||
|
userConstraintPtr->m_gearAuxLink = serverConstraint->m_gearAuxLink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7571,19 +7571,23 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
|
|||||||
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_RATIO)
|
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_RATIO)
|
||||||
{
|
{
|
||||||
userConstraintPtr->m_mbConstraint->setGearRatio(clientCmd.m_userConstraintArguments.m_gearRatio);
|
userConstraintPtr->m_mbConstraint->setGearRatio(clientCmd.m_userConstraintArguments.m_gearRatio);
|
||||||
|
userConstraintPtr->m_userConstraintData.m_gearRatio = clientCmd.m_userConstraintArguments.m_gearRatio;
|
||||||
}
|
}
|
||||||
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET)
|
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_RELATIVE_POSITION_TARGET)
|
||||||
{
|
{
|
||||||
userConstraintPtr->m_mbConstraint->setRelativePositionTarget(clientCmd.m_userConstraintArguments.m_relativePositionTarget);
|
userConstraintPtr->m_mbConstraint->setRelativePositionTarget(clientCmd.m_userConstraintArguments.m_relativePositionTarget);
|
||||||
|
userConstraintPtr->m_userConstraintData.m_relativePositionTarget = clientCmd.m_userConstraintArguments.m_relativePositionTarget;
|
||||||
}
|
}
|
||||||
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_ERP)
|
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_ERP)
|
||||||
{
|
{
|
||||||
userConstraintPtr->m_mbConstraint->setErp(clientCmd.m_userConstraintArguments.m_erp);
|
userConstraintPtr->m_mbConstraint->setErp(clientCmd.m_userConstraintArguments.m_erp);
|
||||||
|
userConstraintPtr->m_userConstraintData.m_erp = clientCmd.m_userConstraintArguments.m_erp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK)
|
if (clientCmd.m_updateFlags & USER_CONSTRAINT_CHANGE_GEAR_AUX_LINK)
|
||||||
{
|
{
|
||||||
userConstraintPtr->m_mbConstraint->setGearAuxLink(clientCmd.m_userConstraintArguments.m_gearAuxLink);
|
userConstraintPtr->m_mbConstraint->setGearAuxLink(clientCmd.m_userConstraintArguments.m_gearAuxLink);
|
||||||
|
userConstraintPtr->m_userConstraintData.m_gearAuxLink = clientCmd.m_userConstraintArguments.m_gearAuxLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2487,7 +2487,7 @@ static PyObject* pybullet_getConstraintInfo(PyObject* self, PyObject* args, PyOb
|
|||||||
|
|
||||||
if (b3GetUserConstraintInfo(sm, constraintUniqueId, &constraintInfo))
|
if (b3GetUserConstraintInfo(sm, constraintUniqueId, &constraintInfo))
|
||||||
{
|
{
|
||||||
PyObject* pyListConstraintInfo = PyTuple_New(11);
|
PyObject* pyListConstraintInfo = PyTuple_New(15);
|
||||||
|
|
||||||
PyTuple_SetItem(pyListConstraintInfo, 0, PyLong_FromLong(constraintInfo.m_parentBodyIndex));
|
PyTuple_SetItem(pyListConstraintInfo, 0, PyLong_FromLong(constraintInfo.m_parentBodyIndex));
|
||||||
PyTuple_SetItem(pyListConstraintInfo, 1, PyLong_FromLong(constraintInfo.m_parentJointIndex));
|
PyTuple_SetItem(pyListConstraintInfo, 1, PyLong_FromLong(constraintInfo.m_parentJointIndex));
|
||||||
@ -2533,6 +2533,10 @@ static PyObject* pybullet_getConstraintInfo(PyObject* self, PyObject* args, PyOb
|
|||||||
PyTuple_SetItem(pyListConstraintInfo, 9, childFrameOrientation);
|
PyTuple_SetItem(pyListConstraintInfo, 9, childFrameOrientation);
|
||||||
}
|
}
|
||||||
PyTuple_SetItem(pyListConstraintInfo, 10, PyFloat_FromDouble(constraintInfo.m_maxAppliedForce));
|
PyTuple_SetItem(pyListConstraintInfo, 10, PyFloat_FromDouble(constraintInfo.m_maxAppliedForce));
|
||||||
|
PyTuple_SetItem(pyListConstraintInfo, 11, PyFloat_FromDouble(constraintInfo.m_gearRatio));
|
||||||
|
PyTuple_SetItem(pyListConstraintInfo, 12, PyLong_FromLong(constraintInfo.m_gearAuxLink));
|
||||||
|
PyTuple_SetItem(pyListConstraintInfo, 13, PyFloat_FromDouble(constraintInfo.m_relativePositionTarget));
|
||||||
|
PyTuple_SetItem(pyListConstraintInfo, 14, PyFloat_FromDouble(constraintInfo.m_erp));
|
||||||
|
|
||||||
return pyListConstraintInfo;
|
return pyListConstraintInfo;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user