unreal.BodyInstance

class unreal.BodyInstance(simulate_physics: bool = False, enable_gravity: bool = False, update_kinematic_from_simulation: bool = False, auto_weld: bool = False, start_awake: bool = False, generate_wake_events: bool = False, update_mass_when_scale_changes: bool = False, sleep_family: SleepFamily = Ellipsis, use_ccd: bool = False, ignore_analytic_collisions: bool = False, notify_rigid_body_collision: bool = False, smooth_edge_collisions: bool = False, inertia_conditioning: bool = False, position_solver_iteration_count: int = 0, velocity_solver_iteration_count: int = 0, max_depenetration_velocity: float = 0.0, mass_in_kg_override: float = 0.0, linear_damping: float = 0.0, angular_damping: float = 0.0, com_nudge: Vector = Ellipsis, mass_scale: float = 0.0, inertia_tensor_scale: Vector = Ellipsis, walkable_slope_override: WalkableSlopeOverride = Ellipsis, phys_material_override: PhysicalMaterial = Ellipsis, max_angular_velocity: float = 0.0, custom_sleep_threshold_multiplier: float = 0.0, stabilization_threshold_multiplier: float = 0.0)

Bases: BodyInstanceCore

Container for a physics representation of an object

C++ Source:

  • Module: Engine

  • File: BodyInstance.h

Editor Properties: (see get_editor_property/set_editor_property)

  • angular_damping (float): [Read-Write] ‘Drag’ force added to reduce angular movement

  • auto_weld (bool): [Read-Write] If true and is attached to a parent, the two bodies will be joined into a single rigid body. Physical settings like collision profile and body settings are determined by the root

  • collision_enabled (CollisionEnabled): [Read-Write] Type of collision enabled.

    No Collision : Will not create any representation in the physics engine. Cannot be used for spatial queries (raycasts, sweeps, overlaps) or simulation (rigid body, constraints). Best performance possible (especially for moving objects) Query Only : Only used for spatial queries (raycasts, sweeps, and overlaps). Cannot be used for simulation (rigid body, constraints). Useful for character movement and things that do not need physical simulation. Performance gains by keeping data out of simulation tree. Physics Only : Only used only for physics simulation (rigid body, constraints). Cannot be used for spatial queries (raycasts, sweeps, overlaps). Useful for jiggly bits on characters that do not need per bone detection. Performance gains by keeping data out of query tree Collision Enabled : Can be used for both spatial queries (raycasts, sweeps, overlaps) and simulation (rigid body, constraints).

  • collision_profile_name (Name): [Read-Write] Collision Profile Name *

  • collision_responses (CollisionResponse): [Read-Write] Custom Channels for Responses

  • com_nudge (Vector): [Read-Write] User specified offset for the center of mass of this object, from the calculated location

  • custom_dof_plane_normal (Vector): [Read-Write] Locks physical movement along a custom plane for a given normal.

  • custom_sleep_threshold_multiplier (float): [Read-Write] If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. A higher number will cause the body to sleep sooner.

  • dof_mode (DOFMode): [Read-Write] [Physx Only] Locks physical movement along specified axis.

  • enable_gravity (bool): [Read-Write] If object should have the force of gravity applied

  • generate_wake_events (bool): [Read-Write] Should ‘wake/sleep’ events fire when this object is woken up or put to sleep by the physics simulation.

  • ignore_analytic_collisions (bool): [Read-Write] If true ignore analytic collisions and treat objects as a general implicit surface

  • inertia_conditioning (bool): [Read-Write] brief: Enable automatic inertia conditioning to stabilize constraints. Inertia conitioning increases inertia when an object is long and thin and also when it has joints that are outside the collision shapes of the body. Increasing the inertia reduces the amount of rotation applied at joints which helps stabilize joint chains, especially when bodies are small. In principle you can get the same behaviour by setting the InertiaTensorScale appropriately, but this takes some of the guesswork out of it. note: This only changes the inertia used in the low-level solver. That inertia is not visible to the BodyInstance which will still report the inertia calculated from the mass, shapes, and InertiaTensorScale. note: When enabled, the effective inertia depends on the joints attached to the body so the inertia will change when joints are added or removed (automatically - no user action required).

  • inertia_tensor_scale (Vector): [Read-Write] Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)

  • linear_damping (float): [Read-Write] ‘Drag’ force added to reduce linear movement

  • lock_rotation (bool): [Read-Write] [Physx Only] When a Locked Axis Mode is selected, will lock rotation to the specified axis

  • lock_translation (bool): [Read-Write] [Physx Only] When a Locked Axis Mode is selected, will lock translation on the specified axis

  • lock_x_rotation (bool): [Read-Write] [Physx Only] Lock rotation about the X-axis

  • lock_x_translation (bool): [Read-Write] [Physx Only] Lock translation along the X-axis

  • lock_y_rotation (bool): [Read-Write] [Physx Only] Lock rotation about the Y-axis

  • lock_y_translation (bool): [Read-Write] [Physx Only] Lock translation along the Y-axis

  • lock_z_rotation (bool): [Read-Write] [Physx Only] Lock rotation about the Z-axis

  • lock_z_translation (bool): [Read-Write] [Physx Only] Lock translation along the Z-axis

  • mass_in_kg_override (float): [Read-Write] Mass of the body in KG. By default we compute this based on physical material and mass scale. see: bOverrideMass to set this directly

  • mass_scale (float): [Read-Write] Per-instance scaling of mass

  • max_angular_velocity (float): [Read-Write] The maximum angular velocity for this instance [degrees/s]

  • max_depenetration_velocity (float): [Read-Write] [PhysX Only] The maximum velocity used to depenetrate this object

  • notify_rigid_body_collision (bool): [Read-Write] Should ‘Hit’ events fire when this object collides during physics simulation.

  • object_type (CollisionChannel): [Read-Write] Enum indicating what type of object this should be considered as when it moves

  • override_mass (bool): [Read-Write] If true, mass will not be automatically computed and you must set it directly

  • override_max_angular_velocity (bool): [Read-Write] Override the default max angular velocity

  • override_max_depenetration_velocity (bool): [Read-Write] [PhysX Only] Whether this body instance has its own custom MaxDepenetrationVelocity

  • override_walkable_slope_on_instance (bool): [Read-Write] Whether this instance of the object has its own custom walkable slope override setting.

  • phys_material_override (PhysicalMaterial): [Read-Write] Allows you to override the PhysicalMaterial to use for simple collision on this body.

  • position_solver_iteration_count (uint8): [Read-Write] [PhysX Only] This physics body’s solver iteration count for position. Increasing this will be more CPU intensive, but better stabilized.

  • simulate_physics (bool): [Read-Write] If true, this body will use simulation. If false, will be ‘fixed’ (ie kinematic) and move where it is told. For a Skeletal Mesh Component, simulating requires a physics asset setup and assigned on the SkeletalMesh asset. For a Static Mesh Component, simulating requires simple collision to be setup on the StaticMesh asset.

  • sleep_family (SleepFamily): [Read-Write] The set of values used in considering when put this body to sleep.

  • smooth_edge_collisions (bool): [Read-Write] Remove unnecessary edge collisions to allow smooth sliding over surfaces composed of multiple actors/components. This is fairly expensive and should only be enabled on hero objects.

  • stabilization_threshold_multiplier (float): [Read-Write] Stabilization factor for this body if Physics stabilization is enabled. A higher number will cause more aggressive stabilization at the risk of loss of momentum at low speeds. A value of 0 will disable stabilization for this body.

  • start_awake (bool): [Read-Write] If object should start awake, or if it should initially be sleeping

  • update_kinematic_from_simulation (bool): [Read-Write] When kinematic, whether the actor transform should be updated as a result of movement in the simulation, rather than immediately whenever a target transform is set.

  • update_mass_when_scale_changes (bool): [Read-Write] If true, it will update mass when scale change *

  • use_ccd (bool): [Read-Write] If true Continuous Collision Detection (CCD) will be used for this component

  • velocity_solver_iteration_count (uint8): [Read-Write] [PhysX Only] This physics body’s solver iteration count for velocity. Increasing this will be more CPU intensive, but better stabilized.

  • walkable_slope_override (WalkableSlopeOverride): [Read-Write] Custom walkable slope override setting for this instance. see: GetWalkableSlopeOverride(), SetWalkableSlopeOverride()

property angular_damping: float

[Read-Write] ‘Drag’ force added to reduce angular movement

Type:

(float)

property com_nudge: Vector

[Read-Write] User specified offset for the center of mass of this object, from the calculated location

Type:

(Vector)

property custom_sleep_threshold_multiplier: float

[Read-Only] If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. A higher number will cause the body to sleep sooner.

Type:

(float)

property ignore_analytic_collisions: bool

[Read-Only] If true ignore analytic collisions and treat objects as a general implicit surface

Type:

(bool)

property inertia_conditioning: bool

[Read-Write] brief: Enable automatic inertia conditioning to stabilize constraints. Inertia conitioning increases inertia when an object is long and thin and also when it has joints that are outside the collision shapes of the body. Increasing the inertia reduces the amount of rotation applied at joints which helps stabilize joint chains, especially when bodies are small. In principle you can get the same behaviour by setting the InertiaTensorScale appropriately, but this takes some of the guesswork out of it. note: This only changes the inertia used in the low-level solver. That inertia is not visible to the BodyInstance which will still report the inertia calculated from the mass, shapes, and InertiaTensorScale. note: When enabled, the effective inertia depends on the joints attached to the body so the inertia will change when joints are added or removed (automatically - no user action required).

Type:

(bool)

property inertia_tensor_scale: Vector

[Read-Write] Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)

Type:

(Vector)

property linear_damping: float

[Read-Write] ‘Drag’ force added to reduce linear movement

Type:

(float)

property mass_in_kg: float

‘mass_in_kg’ was renamed to ‘mass_in_kg_override’.

Type:

deprecated

property mass_in_kg_override: float

[Read-Only] Mass of the body in KG. By default we compute this based on physical material and mass scale. see: bOverrideMass to set this directly

Type:

(float)

property mass_scale: float

[Read-Write] Per-instance scaling of mass

Type:

(float)

property max_angular_velocity: float

[Read-Only] The maximum angular velocity for this instance [degrees/s]

Type:

(float)

property max_depenetration_velocity: float

[Read-Only] [PhysX Only] The maximum velocity used to depenetrate this object

Type:

(float)

property notify_rigid_body_collision: bool

[Read-Only] Should ‘Hit’ events fire when this object collides during physics simulation.

Type:

(bool)

property phys_material_override: PhysicalMaterial

[Read-Only] Allows you to override the PhysicalMaterial to use for simple collision on this body.

Type:

(PhysicalMaterial)

property position_solver_iteration_count: int

[Read-Only] [PhysX Only] This physics body’s solver iteration count for position. Increasing this will be more CPU intensive, but better stabilized.

Type:

(uint8)

property sleep_family: SleepFamily

[Read-Write] The set of values used in considering when put this body to sleep.

Type:

(SleepFamily)

property smooth_edge_collisions: bool

[Read-Only] Remove unnecessary edge collisions to allow smooth sliding over surfaces composed of multiple actors/components. This is fairly expensive and should only be enabled on hero objects.

Type:

(bool)

property stabilization_threshold_multiplier: float

[Read-Only] Stabilization factor for this body if Physics stabilization is enabled. A higher number will cause more aggressive stabilization at the risk of loss of momentum at low speeds. A value of 0 will disable stabilization for this body.

Type:

(float)

property use_ccd: bool

[Read-Only] If true Continuous Collision Detection (CCD) will be used for this component

Type:

(bool)

property velocity_solver_iteration_count: int

[Read-Only] [PhysX Only] This physics body’s solver iteration count for velocity. Increasing this will be more CPU intensive, but better stabilized.

Type:

(uint8)

property walkable_slope_override: WalkableSlopeOverride

[Read-Only] Custom walkable slope override setting for this instance. see: GetWalkableSlopeOverride(), SetWalkableSlopeOverride()

Type:

(WalkableSlopeOverride)