unreal.BodyInstance
¶
- class unreal.BodyInstance(simulate_physics: bool = False, enable_gravity: 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] Angular Damping: ‘Drag’ force added to reduce angular movementauto_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 rootcollision_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 Responsescom_nudge
(Vector): [Read-Write] COMNudge: User specified offset for the center of mass of this object, from the calculated locationcustom_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 appliedgenerate_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 surfaceinertia_conditioning
(bool): [Read-Write] Inertia Conditioning: 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] 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 movementlock_rotation
(bool): [Read-Write] Lock Rotation: [Physx Only] When a Locked Axis Mode is selected, will lock rotation to the specified axislock_translation
(bool): [Read-Write] Lock Translation: [Physx Only] When a Locked Axis Mode is selected, will lock translation on the specified axislock_x_rotation
(bool): [Read-Write] Lock XRotation: [Physx Only] Lock rotation about the X-axislock_x_translation
(bool): [Read-Write] Lock XTranslation: [Physx Only] Lock translation along the X-axislock_y_rotation
(bool): [Read-Write] Lock YRotation: [Physx Only] Lock rotation about the Y-axislock_y_translation
(bool): [Read-Write] Lock YTranslation: [Physx Only] Lock translation along the Y-axislock_z_rotation
(bool): [Read-Write] Lock ZRotation: [Physx Only] Lock rotation about the Z-axislock_z_translation
(bool): [Read-Write] Lock ZTranslation: [Physx Only] Lock translation along the Z-axismass_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 directlymass_scale
(float): [Read-Write] Mass Scale: Per-instance scaling of massmax_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 objectnotify_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 movesoverride_mass
(bool): [Read-Write] Override Mass: If true, mass will not be automatically computed and you must set it directlyoverride_max_angular_velocity
(bool): [Read-Write] Override Max Angular Velocity: Override the default max angular velocityoverride_max_depenetration_velocity
(bool): [Read-Write] Override Max Depenetration Velocity: [PhysX Only] Whether this body instance has its own custom MaxDepenetrationVelocityoverride_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 sleepingupdate_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 componentvelocity_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: float¶
[Read-Write] Angular Damping: ‘Drag’ force added to reduce angular movement
- Type:
(float)
- property com_nudge: Vector¶
[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: float¶
[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: bool¶
[Read-Only] Ignore Analytic Collisions: If true ignore analytic collisions and treat objects as a general implicit surface
- Type:
(bool)
- property inertia_conditioning: bool¶
[Read-Write] Inertia Conditioning: 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] Inertia Tensor Scale: Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)
- Type:
(Vector)
- property linear_damping: float¶
[Read-Write] Linear Damping: ‘Drag’ force added to reduce linear movement
- Type:
(float)
- property mass_in_kg_override: float¶
[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 max_angular_velocity: float¶
[Read-Only] Max Angular Velocity: The maximum angular velocity for this instance [degrees/s]
- Type:
(float)
- property max_depenetration_velocity: float¶
[Read-Only] Max Depenetration Velocity: [PhysX Only] The maximum velocity used to depenetrate this object
- Type:
(float)
- property notify_rigid_body_collision: bool¶
[Read-Only] Notify Rigid Body Collision: Should ‘Hit’ events fire when this object collides during physics simulation.
- Type:
(bool)
- property phys_material_override: PhysicalMaterial¶
[Read-Only] Phys Material Override: Allows you to override the PhysicalMaterial to use for simple collision on this body.
- Type:
- property position_solver_iteration_count: int¶
[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: SleepFamily¶
[Read-Write] Sleep Family: The set of values used in considering when put this body to sleep.
- Type:
- property smooth_edge_collisions: bool¶
[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: float¶
[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: bool¶
[Read-Only] Use CCD: If true Continuous Collision Detection (CCD) will be used for this component
- Type:
(bool)
- property velocity_solver_iteration_count: int¶
[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: WalkableSlopeOverride¶
[Read-Only] Walkable Slope Override: Custom walkable slope override setting for this instance. see: GetWalkableSlopeOverride(), SetWalkableSlopeOverride()
- Type: