AnalyticalPyBulletClient.body_from_obj

AnalyticalPyBulletClient.body_from_obj(path, scale=1.0, concavity=False, mass=0, collision=True, color=(0.5, 0.5, 0.5, 1))

Create a PyBullet body from an OBJ file.

Parameters
  • path (str) – Path to the OBJ file.

  • scale (float, optional) – Factor by which to scale the mesh. Defaults to 1.

  • concavity (bool, optional) – When False (the default), the mesh will be loaded as its convex hull for collision checking purposes. Only applicable to static (massless) objects. For non-static meshes, use OBJs preprocessed by pybullet.vhacd.

  • mass (float, optional) – Mass of the body to be created, in kg. If 0 mass is given (the default), the object is static.

  • collision (bool) – When True, body will be included in collision checking calculations. Defaults to True.

  • color (tuple of float) – RGBa color components of the body.

Returns

int