Area3D
A region of 3D space that detects other CollisionObject3Ds entering or exiting it.
A region of 3D space that detects other CollisionObject3Ds entering or exiting it.
Area3D is a region of 3D space defined by one or multiple CollisionShape3D or CollisionPolygon3D child nodes. It detects when other CollisionObject3Ds enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it).
This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses.
Note: Areas and bodies created with PhysicsServer3D might not interact as expected with Area3Ds, and might not emit signals or track objects correctly.
Warning: Using a ConcavePolygonShape3D inside a CollisionShape3D child of this node (created e.g. by using the Create Trimesh Collision Sibling option in the Mesh menu that appears when selecting a MeshInstance3D node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple ConvexPolygonShape3Ds or primitive shapes like BoxShape3D, or in some cases it may be replaceable by a CollisionPolygon3D.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
Area3DConstructor
public Area3D();Properties22
AngularDampProperty
public float AngularDamp { get; set; }The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
See ProjectSettings.physics/3d/default_angular_damp for more details about damping.
AngularDampSpaceOverrideProperty
public Area3D.SpaceOverride AngularDampSpaceOverride { get; set; }Override mode for angular damping calculations within this area.
AudioBusNameProperty
public StringName AudioBusName { get; set; }The name of the area's audio bus.
AudioBusOverrideProperty
public bool AudioBusOverride { get; set; }If true, the area's audio bus overrides the default audio bus.
GravityProperty
public float Gravity { get; set; }The area's gravity intensity (in meters per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction.
GravityDirectionProperty
public Vector3 GravityDirection { get; set; }The area's gravity vector (not normalized).
GravityPointProperty
public bool GravityPoint { get; set; }If true, gravity is calculated from a point (set via Area3D.GravityPointCenter). See also Area3D.GravitySpaceOverride.
GravityPointCenterProperty
public Vector3 GravityPointCenter { get; set; }If gravity is a point (see Area3D.GravityPoint), this will be the point of attraction.
GravityPointUnitDistanceProperty
public float GravityPointUnitDistance { get; set; }The distance at which the gravity strength is equal to Area3D.Gravity. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/s², set the Area3D.Gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4× the gravity), and so on.
The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance.
GravitySpaceOverrideProperty
public Area3D.SpaceOverride GravitySpaceOverride { get; set; }Override mode for gravity calculations within this area.
LinearDampProperty
public float LinearDamp { get; set; }The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
See ProjectSettings.physics/3d/default_linear_damp for more details about damping.
LinearDampSpaceOverrideProperty
public Area3D.SpaceOverride LinearDampSpaceOverride { get; set; }Override mode for linear damping calculations within this area.
MonitorableProperty
public bool Monitorable { get; set; }If true, other monitoring areas can detect this area.
MonitoringProperty
public bool Monitoring { get; set; }If true, the area detects bodies or areas entering and exiting it.
PriorityProperty
public int Priority { get; set; }The area's priority. Higher priority areas are processed first. The World3D's physics is always processed last, after all areas.
ReverbBusAmountProperty
public float ReverbBusAmount { get; set; }The degree to which this area applies reverb to its associated audio. Ranges from 0 to 1 with 0.1 precision.
ReverbBusEnabledProperty
public bool ReverbBusEnabled { get; set; }If true, the area applies reverb to its associated audio.
ReverbBusNameProperty
public StringName ReverbBusName { get; set; }The name of the reverb bus to use for this area's associated audio.
ReverbBusUniformityProperty
public float ReverbBusUniformity { get; set; }The degree to which this area's reverb is a uniform effect. Ranges from 0 to 1 with 0.1 precision.
WindAttenuationFactorProperty
public float WindAttenuationFactor { get; set; }The exponential rate at which wind force decreases with distance from its origin.
Note: This wind force only applies to SoftBody3D nodes. Other physics bodies are currently not affected by wind.
WindForceMagnitudeProperty
public float WindForceMagnitude { get; set; }The magnitude of area-specific wind force.
Note: This wind force only applies to SoftBody3D nodes. Other physics bodies are currently not affected by wind.
WindSourcePathProperty
public EntityPath WindSourcePath { get; set; }The Entity3D which is used to specify the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the Entity3D's local transform, and its origin is the origin of the Entity3D's local transform.
Note: This wind force only applies to SoftBody3D nodes. Other physics bodies are currently not affected by wind.
Methods50
GetAngularDampfloat
public float GetAngularDamp();floatGetAngularDampSpaceOverrideModeArea3D.SpaceOverride
public Area3D.SpaceOverride GetAngularDampSpaceOverrideMode();Area3D.SpaceOverrideGetAudioBusNameStringName
public StringName GetAudioBusName();StringNameGetGravityfloat
public float GetGravity();floatGetGravityDirectionVector3
public Vector3 GetGravityDirection();Vector3GetGravityPointCenterVector3
public Vector3 GetGravityPointCenter();Vector3GetGravityPointUnitDistancefloat
public float GetGravityPointUnitDistance();floatGetGravitySpaceOverrideModeArea3D.SpaceOverride
public Area3D.SpaceOverride GetGravitySpaceOverrideMode();Area3D.SpaceOverrideGetLinearDampfloat
public float GetLinearDamp();floatGetLinearDampSpaceOverrideModeArea3D.SpaceOverride
public Area3D.SpaceOverride GetLinearDampSpaceOverrideMode();Area3D.SpaceOverrideGetOverlappingAreasReckfell.Collections.Array<Area3D>
public Reckfell.Collections.Array<Area3D> GetOverlappingAreas();Returns a list of intersecting Area3Ds. The overlapping area's CollisionObject3D.CollisionLayer must be part of this area's CollisionObject3D.CollisionMask in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
Reckfell.Collections.Array<Area3D>GetOverlappingBodiesReckfell.Collections.Array<Entity3D>
public Reckfell.Collections.Array<Entity3D> GetOverlappingBodies();Returns detected collision objects as Entity3D; test the required gameplay type with is. The object layer must match the area mask and monitoring must be enabled. The list updates on physics steps, not immediately after creation or movement. When a response depends on changing state during an existing overlap, polling the list can remain necessary after the initial BodyEntered().
Reckfell.Collections.Array<Entity3D>GetPriorityint
public int GetPriority();intGetReverbAmountfloat
public float GetReverbAmount();floatGetReverbBusNameStringName
public StringName GetReverbBusName();StringNameGetReverbUniformityfloat
public float GetReverbUniformity();floatGetWindAttenuationFactorfloat
public float GetWindAttenuationFactor();floatGetWindForceMagnitudefloat
public float GetWindForceMagnitude();floatGetWindSourcePathEntityPath
public EntityPath GetWindSourcePath();EntityPathHasOverlappingAreasbool
public bool HasOverlappingAreas();Returns true if intersecting any Area3Ds, otherwise returns false. The overlapping area's CollisionObject3D.CollisionLayer must be part of this area's CollisionObject3D.CollisionMask in order to be detected.
For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
boolHasOverlappingBodiesbool
public bool HasOverlappingBodies();Returns true if intersecting any PhysicsBody3Ds, SoftBody3Ds, or GridMaps, otherwise returns false. The overlapping body's CollisionObject3D.CollisionLayer must be part of this area's CollisionObject3D.CollisionMask in order to be detected.
For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will not consider such bodies.
boolIsGravityAPointbool
public bool IsGravityAPoint();boolIsMonitorablebool
public bool IsMonitorable();boolIsMonitoringbool
public bool IsMonitoring();boolIsOverridingAudioBusbool
public bool IsOverridingAudioBus();boolIsUsingReverbBusbool
public bool IsUsingReverbBus();boolOverlapsAreabool
public bool OverlapsArea(Entity area);Returns true if the given Area3D intersects or overlaps this Area3D, false otherwise.
Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
| Name | Type | Default |
|---|---|---|
area | Entity | — |
boolOverlapsBodybool
public bool OverlapsBody(Entity body);Returns true if the given physics body intersects or overlaps this Area3D, false otherwise.
body argument can either be a PhysicsBody3D, SoftBody3D, or a GridMap instance. While GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body.
Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will return false in such cases.
| Name | Type | Default |
|---|---|---|
body | Entity | — |
boolSetAngularDampvoid
public void SetAngularDamp(float angularDamp);| Name | Type | Default |
|---|---|---|
angularDamp | float | — |
SetAngularDampSpaceOverrideModevoid
public void SetAngularDampSpaceOverrideMode(Area3D.SpaceOverride spaceOverrideMode);| Name | Type | Default |
|---|---|---|
spaceOverrideMode | Area3D.SpaceOverride | — |
SetAudioBusNamevoid
public void SetAudioBusName(StringName name);| Name | Type | Default |
|---|---|---|
name | StringName | — |
SetAudioBusOverridevoid
public void SetAudioBusOverride(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetGravityvoid
public void SetGravity(float gravity);| Name | Type | Default |
|---|---|---|
gravity | float | — |
SetGravityDirectionvoid
public void SetGravityDirection(Vector3 direction);| Name | Type | Default |
|---|---|---|
direction | Vector3 | — |
SetGravityIsPointvoid
public void SetGravityIsPoint(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetGravityPointCentervoid
public void SetGravityPointCenter(Vector3 center);| Name | Type | Default |
|---|---|---|
center | Vector3 | — |
SetGravityPointUnitDistancevoid
public void SetGravityPointUnitDistance(float distanceScale);| Name | Type | Default |
|---|---|---|
distanceScale | float | — |
SetGravitySpaceOverrideModevoid
public void SetGravitySpaceOverrideMode(Area3D.SpaceOverride spaceOverrideMode);| Name | Type | Default |
|---|---|---|
spaceOverrideMode | Area3D.SpaceOverride | — |
SetLinearDampvoid
public void SetLinearDamp(float linearDamp);| Name | Type | Default |
|---|---|---|
linearDamp | float | — |
SetLinearDampSpaceOverrideModevoid
public void SetLinearDampSpaceOverrideMode(Area3D.SpaceOverride spaceOverrideMode);| Name | Type | Default |
|---|---|---|
spaceOverrideMode | Area3D.SpaceOverride | — |
SetMonitorablevoid
public void SetMonitorable(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetMonitoringvoid
public void SetMonitoring(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPriorityvoid
public void SetPriority(int priority);| Name | Type | Default |
|---|---|---|
priority | int | — |
SetReverbAmountvoid
public void SetReverbAmount(float amount);| Name | Type | Default |
|---|---|---|
amount | float | — |
SetReverbBusNamevoid
public void SetReverbBusName(StringName name);| Name | Type | Default |
|---|---|---|
name | StringName | — |
SetReverbUniformityvoid
public void SetReverbUniformity(float amount);| Name | Type | Default |
|---|---|---|
amount | float | — |
SetUseReverbBusvoid
public void SetUseReverbBus(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetWindAttenuationFactorvoid
public void SetWindAttenuationFactor(float windAttenuationFactor);| Name | Type | Default |
|---|---|---|
windAttenuationFactor | float | — |
SetWindForceMagnitudevoid
public void SetWindForceMagnitude(float windForceMagnitude);| Name | Type | Default |
|---|---|---|
windForceMagnitude | float | — |
SetWindSourcePathvoid
public void SetWindSourcePath(EntityPath windSourcePath);| Name | Type | Default |
|---|---|---|
windSourcePath | EntityPath | — |
Signals and events8
AreaEnteredEvent
public event Area3D.AreaEnteredEventHandler AreaEntered;Emitted when the received area enters this area. Requires Area3D.Monitoring to be set to true.
| Name | Type | Default |
|---|---|---|
area | Area3D | — |
AreaExitedEvent
public event Area3D.AreaExitedEventHandler AreaExited;Emitted when the received area exits this area. Requires Area3D.Monitoring to be set to true.
| Name | Type | Default |
|---|---|---|
area | Area3D | — |
AreaShapeEnteredEvent
public event Area3D.AreaShapeEnteredEventHandler AreaShapeEntered;Emitted when a Shape3D of the received area enters a shape of this area. Requires Area3D.Monitoring to be set to true.
local_shape_index and area_shape_index contain indices of the interacting shapes from this area and the other area, respectively. area_rid contains the Rid of the other area. These values can be used with the PhysicsServer3D.
Example: Get the CollisionShape3D node from the shape index:
| Name | Type | Default |
|---|---|---|
areaRid | Rid | — |
area | Area3D | — |
areaShapeIndex | long | — |
localShapeIndex | long | — |
AreaShapeExitedEvent
public event Area3D.AreaShapeExitedEventHandler AreaShapeExited;Emitted when a Shape3D of the received area exits a shape of this area. Requires Area3D.Monitoring to be set to true.
See also Area3D.AreaShapeEntered.
| Name | Type | Default |
|---|---|---|
areaRid | Rid | — |
area | Area3D | — |
areaShapeIndex | long | — |
localShapeIndex | long | — |
BodyEnteredEvent
public event Area3D.BodyEnteredEventHandler BodyEntered;Emitted when the received body enters this area. body can be a PhysicsBody3D, SoftBody3D or GridMap. GridMaps are detected if their MeshLibrary has collision shapes configured. Requires Area3D.Monitoring to be set to true.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will not emit this signal in such cases.
| Name | Type | Default |
|---|---|---|
body | Entity3D | — |
BodyExitedEvent
public event Area3D.BodyExitedEventHandler BodyExited;Emitted when the received body exits this area. body can be a PhysicsBody3D, SoftBody3D or GridMap. GridMaps are detected if their MeshLibrary has collision shapes configured. Requires Area3D.Monitoring to be set to true.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will not emit this signal in such cases.
| Name | Type | Default |
|---|---|---|
body | Entity3D | — |
BodyShapeEnteredEvent
public event Area3D.BodyShapeEnteredEventHandler BodyShapeEntered;Emitted when a Shape3D of the received body enters a shape of this area. body can be a PhysicsBody3D, SoftBody3D or GridMap. GridMaps are detected if their MeshLibrary has collision shapes configured. Requires Area3D.Monitoring to be set to true.
local_shape_index and body_shape_index contain indices of the interacting shapes from this area and the interacting body, respectively. body_rid contains the Rid of the body. These values can be used with the PhysicsServer3D.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will not emit this signal in such cases.
Example: Get the CollisionShape3D node from the shape index:
| Name | Type | Default |
|---|---|---|
bodyRid | Rid | — |
body | Entity3D | — |
bodyShapeIndex | long | — |
localShapeIndex | long | — |
BodyShapeExitedEvent
public event Area3D.BodyShapeExitedEventHandler BodyShapeExited;Emitted when a Shape3D of the received body exits a shape of this area. body can be a PhysicsBody3D, SoftBody3D or GridMap. GridMaps are detected if their MeshLibrary has collision shapes configured. Requires Area3D.Monitoring to be set to true.
See also Area3D.BodyShapeEntered.
Note: Reckfell Physics does not support reporting overlaps with SoftBody3D, so will not emit this signal in such cases.
| Name | Type | Default |
|---|---|---|
bodyRid | Rid | — |
body | Entity3D | — |
bodyShapeIndex | long | — |
localShapeIndex | long | — |
Area3D.SpaceOverride
| Value | Description |
|---|---|
Combine = 1 | This area adds its gravity/damping values to whatever has been calculated so far (in |
CombineReplace = 2 | This area adds its gravity/damping values to whatever has been calculated so far (in |
Disabled = 0 | This area does not affect gravity/damping. |
Replace = 3 | This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. |
ReplaceCombine = 4 | This area replaces any gravity/damping calculated so far (in |