gameObjects.attachables.physicBase#
- class gameObjects.attachables.physicBase.MultiBodyLinks(base: 'PhysicBase | None' = None, link_to_index: dict = <factory>, index_to_link: list[gameObjects.attachables.physicLink.PhysicLink] = <factory>, masses: list[float] = <factory>, parents: list[int] = <factory>, positions: list[tuple[float, float, float]] = <factory>, orientations: list[tuple[float, float, float, float]] = <factory>, jointTypes: list[int] = <factory>, jointAxis: list[tuple[float, float, float]] = <factory>, collisionShapes: list[int] = <factory>, visualShapes: list[int] = <factory>, inertialFramePositions: list[tuple[float, float, float]] = <factory>, inertialFrameOrientations: list[tuple[float, float, float, float]] = <factory>)#
Bases:
object- __init__(base: ~gameObjects.attachables.physicBase.PhysicBase | None = None, link_to_index: dict = <factory>, index_to_link: list[~gameObjects.attachables.physicLink.PhysicLink] = <factory>, masses: list[float] = <factory>, parents: list[int] = <factory>, positions: list[tuple[float, float, float]] = <factory>, orientations: list[tuple[float, float, float, float]] = <factory>, jointTypes: list[int] = <factory>, jointAxis: list[tuple[float, float, float]] = <factory>, collisionShapes: list[int] = <factory>, visualShapes: list[int] = <factory>, inertialFramePositions: list[tuple[float, float, float]] = <factory>, inertialFrameOrientations: list[tuple[float, float, float, float]] = <factory>) None#
- add_link(link: PhysicLink = None, mass: float = -1.0, parent: int = 0, position: tuple[float, float, float] = (0.0, 0.0, 0.0), orientation: tuple[float, float, float, float] = (0.0, 0.0, 0.0, 1.0), joint_type: int = 0, joint_axis: tuple[float, float, float] = (0.0, 0.0, 1.0), collision_shape: int = -1, visual_shape: int = -1, inertial_pos: tuple[float, float, float] = (0.0, 0.0, 0.0), inertial_ori: tuple[float, float, float, float] = (0.0, 0.0, 0.0, 1.0)) int#
Add a link and return its index.
- base: PhysicBase | None#
- cache_on_children() None#
Cache references on the child objects at runtime.
Cache adds references to: - Child link mapping index - Base Physic (self.base) - Base Physic physics_id (multibody index from pybullet)
This allows for easy and fast lookups
- collisionShapes: list[int]#
- destroy() None#
Unlink all physics child objects from this runtime physics instance.
This clears internal link/index mappings and removes the runtime physics references
- find_physic_children(obj: GameObject, _list: list[PhysicLink])#
Build a flat list of valid nested pybullet child gameObjects
- index_to_link: list[PhysicLink]#
- inertialFrameOrientations: list[tuple[float, float, float, float]]#
- inertialFramePositions: list[tuple[float, float, float]]#
- jointAxis: list[tuple[float, float, float]]#
- jointTypes: list[int]#
- link_to_index: dict#
- masses: list[float]#
- orientations: list[tuple[float, float, float, float]]#
- parents: list[int]#
- positions: list[tuple[float, float, float]]#
- runtime_init()#
- visualShapes: list[int]#
- class gameObjects.attachables.physicBase.PhysicBase(context: EmberEngine, gameObject: GameObject, uuid: UUID = None, active: bool = False)#
Bases:
PhysicLink- __init__(context: EmberEngine, gameObject: GameObject, uuid: UUID = None, active: bool = False) None#