BaseItem.physics property

Methods

add_to_collision_filter(self, item: BaseItem) -> None

Adds collision filter to target item to ignore collisions, even when this item shares the same collision layer.

apply_force(self, force: Vector3) -> None

Applies constant directional force to this item each frame.

apply_impulse(self, origin: Vector3, impulse: Vector3) -> None

Pushes this item with the defined impulse for this frame.

apply_impulse_local(self, local_origin: Vector3, impulse: Vector3) -> None

Pushes this item with the defined impulse relative to its forward direction for this frame.

on_collision_enter(self, handler: Callable[[t: BaseItem], None]) -> None

Handles the start of a physics collision between this item and another item.

on_collision_exit(self, handler: Callable[[t: BaseItem], None]) -> None

Handles the end of a physics collision between this item and another item.

remove_from_collision_filter(self, item: BaseItem) -> None

Removes collision filter from the target item.

restrict_movement_axis(self, x: bool = ..., y: bool = ..., z: bool = ...) -> None

Restricts this item's movement on the defined axes.

restrict_rotation_axis(self, x: bool = ..., y: bool = ..., z: bool = ...) -> None

Restricts this item's rotation to the defined rotation axes

shift_position(self, shift: Vector3) -> None

Moves this item by an offset from its current position.

shift_position_local(self, offset: Vector3) -> None

Moves this item by an offset relative to its forward direction.

Properties

angular_velocity Vector3

Returns world space angularVelocity of this item.

angular_velocity_local Vector3

Returns local space angularVelocity of this item.

enabled bool

Toggles this item to be simulated with physics.

force Vector3

Defines directional force that is applied on this item each frame.

friction float

Defines the friction of this item during movement

groupobject
mass float

Defines the mass of this item. Items with higher mass more easily push away items with lower mass.

position Vector3

Returns the world space position of the center of mass for this item.

restitution float

Defines this item's restitution (bounciness).

softness float

Defines the velocity threshold at which this item is allowed to be repulsed by collisions.

static bool

Defines static state of this item. Static items have indefinite mass and can not be moved by physics forces.

velocity Vector3

Returns the world space velocity of the item's center of mass.

velocity_local Vector3

Returns the local space velocity of the item's center of mass.