unreal.BodyInstance
¶
- class unreal.BodyInstance(simulate_physics=False, enable_gravity=True, auto_weld=False, start_awake=True, generate_wake_events=False, sleep_family=SleepFamily.NORMAL, use_ccd=False, ignore_analytic_collisions=False, notify_rigid_body_collision=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] ‘Drag’ force added to reduce angular movementauto_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 rootcollision_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 Responsescom_nudge
(Vector): [Read-Write] User specified offset for the center of mass of this object, from the calculated locationcustom_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 appliedgenerate_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 surfaceinertia_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 movementlock_rotation
(bool): [Read-Write] [Physx Only] When a Locked Axis Mode is selected, will lock rotation to the specified axislock_translation
(bool): [Read-Write] [Physx Only] When a Locked Axis Mode is selected, will lock translation on the specified axislock_x_rotation
(bool): [Read-Write] [Physx Only] Lock rotation about the X-axislock_x_translation
(bool): [Read-Write] [Physx Only] Lock translation along the X-axislock_y_rotation
(bool): [Read-Write] [Physx Only] Lock rotation about the Y-axislock_y_translation
(bool): [Read-Write] [Physx Only] Lock translation along the Y-axislock_z_rotation
(bool): [Read-Write] [Physx Only] Lock rotation about the Z-axislock_z_translation
(bool): [Read-Write] [Physx Only] Lock translation along the Z-axismass_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 directlymass_scale
(float): [Read-Write] Per-instance scaling of massmax_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 objectnotify_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 movesoverride_mass
(bool): [Read-Write] If true, mass will not be automatically computed and you must set it directlyoverride_max_angular_velocity
(bool): [Read-Write] Override the default max angular velocityoverride_max_depenetration_velocity
(bool): [Read-Write] [PhysX Only] Whether this body instance has its own custom MaxDepenetrationVelocityoverride_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.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 sleepinguse_ccd
(bool): [Read-Write] If true Continuous Collision Detection (CCD) will be used for this componentvelocity_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 com_nudge¶
[Read-Write] User specified offset for the center of mass of this object, from the calculated location
- Type
(Vector)
- property custom_sleep_threshold_multiplier¶
[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¶
[Read-Only] If true ignore analytic collisions and treat objects as a general implicit surface
- Type
(bool)
- property inertia_tensor_scale¶
[Read-Write] Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)
- Type
(Vector)
- property mass_in_kg¶
‘mass_in_kg’ was renamed to ‘mass_in_kg_override’.
- Type
deprecated
- property mass_in_kg_override¶
[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 max_angular_velocity¶
[Read-Only] The maximum angular velocity for this instance [degrees/s]
- Type
(float)
- property max_depenetration_velocity¶
[Read-Only] [PhysX Only] The maximum velocity used to depenetrate this object
- Type
(float)
- property notify_rigid_body_collision¶
[Read-Only] Should ‘Hit’ events fire when this object collides during physics simulation.
- Type
(bool)
- property phys_material_override¶
[Read-Only] Allows you to override the PhysicalMaterial to use for simple collision on this body.
- Type
- property position_solver_iteration_count¶
[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¶
[Read-Write] The set of values used in considering when put this body to sleep.
- Type
- property stabilization_threshold_multiplier¶
[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¶
[Read-Only] If true Continuous Collision Detection (CCD) will be used for this component
- Type
(bool)
- property velocity_solver_iteration_count¶
[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¶
[Read-Only] Custom walkable slope override setting for this instance. see: GetWalkableSlopeOverride(), SetWalkableSlopeOverride()
- Type