Merge pull request #1149 from erwincoumans/master
use a fixed joint instead of crashing for unsupported joint types (pl…
This commit is contained in:
@@ -362,8 +362,14 @@ void ConvertURDF2BulletInternal(
|
|||||||
|
|
||||||
switch (jointType)
|
switch (jointType)
|
||||||
{
|
{
|
||||||
|
case URDFFloatingJoint:
|
||||||
|
case URDFPlanarJoint:
|
||||||
case URDFFixedJoint:
|
case URDFFixedJoint:
|
||||||
{
|
{
|
||||||
|
if ((jointType==URDFFloatingJoint)||(jointType==URDFPlanarJoint))
|
||||||
|
{
|
||||||
|
printf("Warning: joint unsupported, creating a fixed joint instead.");
|
||||||
|
}
|
||||||
if (createMultiBody)
|
if (createMultiBody)
|
||||||
{
|
{
|
||||||
//todo: adjust the center of mass transform and pivot axis properly
|
//todo: adjust the center of mass transform and pivot axis properly
|
||||||
|
|||||||
@@ -421,3 +421,13 @@ float SimpleCamera::getCameraFrustumNear() const
|
|||||||
{
|
{
|
||||||
return m_data->m_frustumZNear;
|
return m_data->m_frustumZNear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SimpleCamera::setCameraFrustumFar(float far)
|
||||||
|
{
|
||||||
|
m_data->m_frustumZFar = far;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimpleCamera::setCameraFrustumNear(float near)
|
||||||
|
{
|
||||||
|
m_data->m_frustumZNear = near;
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ struct SimpleCamera : public CommonCameraInterface
|
|||||||
|
|
||||||
virtual float getCameraFrustumFar() const;
|
virtual float getCameraFrustumFar() const;
|
||||||
virtual float getCameraFrustumNear() const;
|
virtual float getCameraFrustumNear() const;
|
||||||
|
|
||||||
|
virtual void setCameraFrustumFar(float far);
|
||||||
|
virtual void setCameraFrustumNear(float near);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //SIMPLE_CAMERA_H
|
#endif //SIMPLE_CAMERA_H
|
||||||
|
|||||||
@@ -726,6 +726,11 @@ void TinyRendererVisualShapeConverter::render(const float viewMat[16], const flo
|
|||||||
clearColor.bgra[3] = 255;
|
clearColor.bgra[3] = 255;
|
||||||
|
|
||||||
clearBuffers(clearColor);
|
clearBuffers(clearColor);
|
||||||
|
float near = projMat[14]/(projMat[10]-1);
|
||||||
|
float far = projMat[14]/(projMat[10]+1);
|
||||||
|
|
||||||
|
m_data->m_camera.setCameraFrustumNear( near);
|
||||||
|
m_data->m_camera.setCameraFrustumFar(far);
|
||||||
|
|
||||||
|
|
||||||
ATTRIBUTE_ALIGNED16(btScalar modelMat[16]);
|
ATTRIBUTE_ALIGNED16(btScalar modelMat[16]);
|
||||||
|
|||||||
Reference in New Issue
Block a user