mollia_bullet
World
- mollia_bullet.world(time_step=0.016666666666666666, motor_dt=None, gravity=None, iterations=10, use_old_solver_mode=True, randomize_solver=False) mollia_bullet.World
Simulation
- World.simulate(*args)
Contacts
- World.contacts_of(obj, eps=0.001, local=False)
- World.contacts_between(obj1, obj2, eps=0.001, local=False)
- World.contacts_between2(obj1, obj2, eps=0.001, local=False)
Helpers
- World.helper() bytes
- World.contact_helper() bytes
Updaters
Updaters are simple callable objects with no parameter. Updaters are called after every simulation step.
- World.add_updater(updater: Callable)
- World.remove_updater(updater: Callable)
Objects
- World.box(mass: float, half_extents: Tuple[float, float, float], origin: Tuple[float, float, float], orientation: Optional[Union[Tuple[float, float, float, float], Tuple[float, float, float, float, float, float, float, float, float]]] = None, ref: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, group: int = 0, mask: int = 0, name: Optional[str] = None) mollia_bullet.Box
- World.sphere(mass: float, radius: float, origin: Tuple[float, float, float], orientation: Optional[Union[Tuple[float, float, float, float], Tuple[float, float, float, float, float, float, float, float, float]]] = None, ref: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, group: int = 0, mask: int = 0, name: Optional[str] = None) mollia_bullet.Sphere
- World.hinge(body_a: Union[mollia_bullet.Box, mollia_bullet.Sphere], body_b: Union[mollia_bullet.Box, mollia_bullet.Sphere], pivot: Tuple[float, float, float], axis: Optional[Tuple[float, float, float]] = None, ref: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, collision: bool = True, iterations: int = - 1, motor_cut: Optional[float] = None, name: Optional[str] = None) mollia_bullet.Hinge
- World.fixed(body_a: Union[mollia_bullet.Box, mollia_bullet.Sphere], body_b: Union[mollia_bullet.Box, mollia_bullet.Sphere], pivot: Optional[Tuple[float, float, float]] = None, ref: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, collision: bool = True, iterations: int = - 1, name: Optional[str] = None) mollia_bullet.Fixed
- World.motor_control(motors: List[mollia_bullet.Hinge]) mollia_bullet.MotorControl
- World.group(bodies: List[Union[mollia_bullet.Box, mollia_bullet.Sphere]]) mollia_bullet.Group
MotorControl
Reset
- MotorControl.reset()
reset must be called after transforming the objects. velocity will be zero on the first frame after reset.
Data
- MotorControl.position() List[float]
- MotorControl.velocity() List[float]
Group
Transform
- Group.apply_transform(transform: List[Tuple[Tuple[float, float, float], Union[Tuple[float, float, float, float], Tuple[float, float, float, float, float, float, float, float, float]]]])
- Group.apply_force(forces: List[Tuple[float, float, float]])
- Group.apply_torque(torques: List[Tuple[float, float, float]])
Save Load
- Group.save_state() bytes
- Group.load_state(state: bytes)
Note
Do not forget to reset the MotorControl.
Data
- Group.aabb() Tuple[Tuple[float, float, float], Tuple[float, float, float]]
- Group.center_of_mass() Tuple[float, float, float]
Visualization
- Group.color_mesh() bytes
- Group.transforms() bytes
Box
- Box.mass: Any
- Box.world: Any
- Box.constraints: Any
- Box.groups: Any
- Box.color: Tuple[float, float, float]
- Box.visible: bool
- Box.group: int
- Box.mask: int
- Box.size: Tuple[float, float, float]
- Box.origin
- Box.basis
- Box.stiffness
- Box.contact_stiffness
- Box.contact_damping
- Box.contact_stiffness_flag
- Box.linear_friction
- Box.rolling_friction
- Box.spinning_friction
- Box.apply_force(force: Tuple[float, float, float], origin: Optional[Tuple[float, float, float]] = None)
force is given in world coordinates origin is given in local coordinates
- Box.apply_torque(torque: Tuple[float, float, float])
- Box.contacts(other: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, mask: int = - 1, eps: float = 0.001, local: bool = False) List[Tuple[Union[mollia_bullet.Box, mollia_bullet.Sphere], Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float], float, float]]
returns [(other, ptA, ptB, normB, distance, impulse), …]
- Box.penetration(obj: Union[mollia_bullet.Box, mollia_bullet.Sphere]) float
- Box.config(config: Optional[Dict[str, Any]] = None) Dict[str, Any]
- Box.remove()
Sphere
- Sphere.mass: Any
- Sphere.world: Any
- Sphere.constraints: Any
- Sphere.groups: Any
- Sphere.color: Tuple[float, float, float]
- Sphere.visible: bool
- Sphere.group: int
- Sphere.mask: int
- Sphere.radius: float
- Sphere.origin
- Sphere.basis
- Sphere.stiffness
- Sphere.contact_stiffness
- Sphere.contact_damping
- Sphere.contact_stiffness_flag
- Sphere.linear_friction
- Sphere.rolling_friction
- Sphere.spinning_friction
- Sphere.apply_force(force: Tuple[float, float, float], origin: Optional[Tuple[float, float, float]] = None)
force is given in world coordinates origin is given in local coordinates
- Sphere.apply_torque(torque: Tuple[float, float, float])
- Sphere.contacts(other: Optional[Union[mollia_bullet.Box, mollia_bullet.Sphere]] = None, mask: int = - 1, eps: float = 0.001, local: bool = False) List[Tuple[Union[mollia_bullet.Box, mollia_bullet.Sphere], Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float], float, float]]
returns [(other, ptA, ptB, normB, distance, impulse), …]
- Sphere.penetration(obj: Union[mollia_bullet.Box, mollia_bullet.Sphere]) float
- Sphere.config(config: Optional[Dict[str, Any]] = None) Dict[str, Any]
- Sphere.remove()
Hinge
- Hinge.world: mollia_bullet.World
- Hinge.body_a: Union[mollia_bullet.Box, mollia_bullet.Sphere]
- Hinge.body_b: Union[mollia_bullet.Box, mollia_bullet.Sphere]
- Hinge.remove()
Fixed
- Fixed.world: mollia_bullet.World
- Fixed.body_a: Union[mollia_bullet.Box, mollia_bullet.Sphere]
- Fixed.body_b: Union[mollia_bullet.Box, mollia_bullet.Sphere]
- Fixed.remove()
Types
- class mollia_bullet.World
- class mollia_bullet.Box
- class mollia_bullet.Sphere
- class mollia_bullet.Hinge
- class mollia_bullet.Fixed
- class mollia_bullet.MotorControl
- class mollia_bullet.Group