in bullet/bullet_render.py [0:0]
def render_joint(joint, option):
glPushAttrib(GL_LIGHTING)
if option.lighting:
glEnable(GL_LIGHTING)
else:
glDisable(GL_LIGHTING)
j_type = joint.type()
T0 = joint.child_bodynode.transform()
T1 = joint.transform_from_child_body_node()
T = T0.dot(T1)
R, p = conversions.T2Rp(T)
scale = option.scale
if option.render_pos:
gl_render.render_point(p,
color=option.color_pos,
scale=scale,
radius=0.1)
if option.render_ori:
if j_type == "WeldJoint":
pass
elif j_type == "RevoluteJoint":
axis1 = joint.axis_in_world_frame()
gl_render.render_line(p,
p + scale * axis1,
color=option.color_ori[0])
elif j_type == "UniversalJoint":
axis1 = joint.axis1_in_world_frame()
axis2 = joint.axis2_in_world_frame()
gl_render.render_line(p,
p + scale * axis1,
color=option.color_ori[0])
gl_render.render_line(p,
p + scale * axis2,
color=option.color_ori[1])
elif j_type == "EulerJoint":
gl_render.render_transform(T,
scale=scale,
color_pos=option.color_pos,
color_ori=option.color_ori)
elif j_type == "BallJoint":
gl_render.render_transform(T,
scale=scale,
color_pos=option.color_pos,
color_ori=option.color_ori)
elif j_type == "TranslationalJoint":
gl_render.render_transform(T,
scale=scale,
color_pos=option.color_pos,
color_ori=option.color_ori)
elif j_type == "FreeJoint":
gl_render.render_transform(T,
scale=scale,
color_pos=option.color_pos,
color_ori=option.color_ori)
else:
raise NotImplementedError("Not Implemented")
glPopAttrib(GL_LIGHTING)