unreal.BodyInstance

class unreal.BodyInstance(simulate_physics=False, enable_gravity=True, auto_weld=False, start_awake=True, generate_wake_events=False, update_mass_when_scale_changes=True, sleep_family=SleepFamily.NORMAL, use_ccd=False, ignore_analytic_collisions=False, notify_rigid_body_collision=False, smooth_edge_collisions=False, position_solver_iteration_count=8, velocity_solver_iteration_count=1, max_depenetration_velocity=0.0, mass_in_kg_override=100.0, linear_damping=0.01, angular_damping=0.0, com_nudge=[0.0, 0.0, 0.0], mass_scale=1.0, inertia_tensor_scale=[1.0, 1.0, 1.0], walkable_slope_override=[WalkableSlopeBehavior.WALKABLE_SLOPE_DEFAULT, 0.0], phys_material_override=None, max_angular_velocity=3600.0, custom_sleep_threshold_multiplier=1.0, stabilization_threshold_multiplier=1.0)

Bases: unreal.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] Angular Damping: ‘Drag’ force added to reduce angular movement

  • auto_weld (bool): [Read-Write] Auto Weld: 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] Collision Enabled: 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 Profile Name *

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

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

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

  • custom_sleep_threshold_multiplier (float): [Read-Write] Custom Sleep Threshold Multiplier: 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] DOFMode: [Physx Only] Locks physical movement along specified axis.

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

  • generate_wake_events (bool): [Read-Write] Generate Wake Events: 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] Ignore Analytic Collisions: If true ignore analytic collisions and treat objects as a general implicit surface

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

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

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

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

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

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

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

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

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

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

  • mass_in_kg_override (float): [Read-Write] Mass in Kg Override: 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] Mass Scale: Per-instance scaling of mass

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

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

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

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

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

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

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

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

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

  • position_solver_iteration_count (uint8): [Read-Write] Position Solver Iteration Count: [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] Simulate Physics: 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] Sleep Family: The set of values used in considering when put this body to sleep.

  • smooth_edge_collisions (bool): [Read-Write] Smooth Edge Collisions: 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 Threshold Multiplier: 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] Start Awake: If object should start awake, or if it should initially be sleeping

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

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

  • velocity_solver_iteration_count (uint8): [Read-Write] Velocity Solver Iteration Count: [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] Walkable Slope Override: Custom walkable slope override setting for this instance. see: GetWalkableSlopeOverride(), SetWalkableSlopeOverride()

property angular_damping

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

Type

(float)

property com_nudge

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

Type

(Vector)

property custom_sleep_threshold_multiplier

[Read-Only] Custom Sleep Threshold Multiplier: 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

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

Type

(bool)

property inertia_tensor_scale

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

Type

(Vector)

property linear_damping

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

Type

(float)

property mass_in_kg

‘mass_in_kg’ was renamed to ‘mass_in_kg_override’.

Type

deprecated

property mass_in_kg_override

[Read-Only] Mass in Kg Override: 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

[Read-Write] Mass Scale: Per-instance scaling of mass

Type

(float)

property max_angular_velocity

[Read-Only] Max Angular Velocity: The maximum angular velocity for this instance [degrees/s]

Type

(float)

property max_depenetration_velocity

[Read-Only] Max Depenetration Velocity: [PhysX Only] The maximum velocity used to depenetrate this object

Type

(float)

property notify_rigid_body_collision

[Read-Only] Notify Rigid Body Collision: Should ‘Hit’ events fire when this object collides during physics simulation.

Type

(bool)

property phys_material_override

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

Type

(PhysicalMaterial)

property position_solver_iteration_count

[Read-Only] Position Solver Iteration Count: [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

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

Type

(SleepFamily)

property smooth_edge_collisions

[Read-Only] Smooth Edge Collisions: 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

[Read-Only] Stabilization Threshold Multiplier: 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

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

Type

(bool)

property velocity_solver_iteration_count

[Read-Only] Velocity Solver Iteration Count: [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

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

Type

(WalkableSlopeOverride)