Editor.Components.Physics.BodyComponent
ClassRigid body physics component for dynamic objects.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
const obj = scene.createSceneObject('PhysicsBody');
const body = obj.addComponent('BodyComponent') as Editor.Components.Physics.BodyComponent;
body.dynamic = true;
body.damping = 0.5;
body.angularDamping = 0.1;
console.log(`BodyComponent: dynamic=${body.dynamic}, damping=${body.damping}, angularDamping=${body.angularDamping}`);
Extends
Properties
angularDamping
angularDamping:
number
Rotational resistance value.
bodySetting
bodySetting:
BodySetting
Body configuration mode.
bodySettingValue
bodySettingValue:
number
Numeric value for the selected body setting.
damping
damping:
number
Linear movement resistance value.
debugDrawEnabled
debugDrawEnabled:
boolean
Enable visual debugging of the collider shape.
Inherited from
ColliderComponent.debugDrawEnabled
dynamic
dynamic:
boolean
Whether the body is affected by physics forces.
enabled
enabled:
boolean
Whether the component is active.
Inherited from
excludeFromParentCompounding
excludeFromParentCompounding:
boolean
If enabled, this collider is never merged into an ancestor's compound shape and is simulated as its own top-level collider. It can still compound its own children.
Inherited from
ColliderComponent.excludeFromParentCompounding
filter
filter:
Filter
Collision filtering rules for this collider.
Inherited from
fitVisual
fitVisual:
boolean
Automatically match collider shape to visual bounds.
Inherited from
forceCompound
forceCompound:
boolean
Force collision shape to use compound geometry.
Inherited from
ColliderComponent.forceCompound
hasPrefabChanges
readonlyhasPrefabChanges:boolean
Whether this entity differs from its counterpart in the prefab or was added to the prefab instance. Always false outside prefab instances.
Inherited from
ColliderComponent.hasPrefabChanges
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
intangible
intangible:
boolean
Disable collision response while maintaining overlap detection.
Inherited from
isPrefabInstanceRoot
readonlyisPrefabInstanceRoot:boolean
Whether this entity is the root of a prefab instance.
Inherited from
ColliderComponent.isPrefabInstanceRoot
matter
matter:
Matter
Physics material properties for this collider.
Inherited from
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
name
name:
string
Name of the component.
Inherited from
overlapFilter
overlapFilter:
Filter
Filtering rules for overlap queries on this collider.
Inherited from
ColliderComponent.overlapFilter
rotateSmoothFactor
rotateSmoothFactor:
number
Damping factor for rotational motion.
Inherited from
ColliderComponent.rotateSmoothFactor
sceneObject
readonlysceneObject:SceneObject
Scene object this component is attached to.
Inherited from
shape
shape:
Shape
Collision shape definition.
Inherited from
smooth
smooth:
boolean
Enable motion smoothing between physics updates.
Inherited from
translateSmoothFactor
translateSmoothFactor:
number
Damping factor for translational motion.
Inherited from
ColliderComponent.translateSmoothFactor
type
readonlytype:string
The entity's type.
Inherited from
worldSettings
worldSettings:
WorldSettingsAsset
Physics simulation settings for this collider's world.
Inherited from
ColliderComponent.worldSettings
Methods
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
Inherited from
ColliderComponent.getDirectlyReferencedEntities
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
ColliderComponent.getOwnedEntities
getPrefabInstanceRoot()
getPrefabInstanceRoot():
Prefabable
Returns the nearest prefab instance root that contains this entity, starting with the entity itself, or null if it is not part of a prefab instance.
Returns
Inherited from
ColliderComponent.getPrefabInstanceRoot
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean