General purpose area node for detection and 3D physics influence.
    public class Area : CollisionObject

3D area that detects CollisionObject nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).

Inheritance Chain

Constructors

    public Area()

Signals

    "area_entered" (Object area)

Emitted when another area enters.

    "area_exited" (Object area)

Emitted when another area exits.

    "area_shape_entered" (int area_id, Object area, int area_shape, int self_shape)

Emitted when another area enters, reporting which areas overlapped.

    "area_shape_exited" (int area_id, Object area, int area_shape, int self_shape)

Emitted when another area exits, reporting which areas were overlapping.

    "body_entered" (Object body)

Emitted when a PhysicsBody object enters.

    "body_exited" (Object body)

Emitted when a PhysicsBody object exits.

    "body_shape_entered" (int body_id, Object body, int body_shape, int area_shape)

Emitted when a PhysicsBody object enters, reporting which shapes overlapped.

    "body_shape_exited" (int body_id, Object body, int body_shape, int area_shape)

Emitted when a PhysicsBody object exits, reporting which shapes were overlapping.

Properties

    public float AngularDamp { get; set; }

The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from 0 (no damping) to 1 (full damping).

    public string AudioBusName { get; set; }

The name of the area’s audio bus.

    public bool AudioBusOverride { get; set; }

If true the area’s audio bus overrides the default audio bus. Default value: false.

    public int CollisionLayer { get; set; }

The area’s physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also collision_mask.

    public int CollisionMask { get; set; }

The physics layers this area scans to determine collision detection.

    public float Gravity { get; set; }

The area’s gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.

    public float GravityDistanceScale { get; set; }

The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.

    public bool GravityPoint { get; set; }

If true gravity is calculated from a point (set via gravity_vec). Also see space_override. Default value: false.

    public Vector3 GravityVec { get; set; }

The area’s gravity vector (not normalized). If gravity is a point (see IsGravityAPoint()), this will be the point of attraction.

    public float LinearDamp { get; set; }

The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from 0 (no damping) to 1 (full damping).

    public bool Monitorable { get; set; }

If true other monitoring areas can detect this area. Default value: true.

    public bool Monitoring { get; set; }

If true the area detects bodies or areas entering and exiting it. Default value: true.

    public float Priority { get; set; }

The area’s priority. Higher priority areas are processed first. Default value: 0.

    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.

    public bool ReverbBusEnable { get; set; }

If true the area applies reverb to its associated audio.

    public string ReverbBusName { get; set; }

The reverb bus name to use for this area’s associated audio.

    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.

    public SpaceOverrideEnum SpaceOverride { get; set; }

Override mode for gravity and damping calculations within this area. See the SPACE_OVERRIDE_* constants for values.

Methods

    public float GetAngularDamp()

Getter for AngularDamp

    public string GetAudioBus()

Getter for AudioBusName

    public int GetCollisionLayer()

Getter for CollisionLayer

    public bool GetCollisionLayerBit(int bit)

Returns an individual bit on the layer mask.

    public int GetCollisionMask()

Getter for CollisionMask

    public bool GetCollisionMaskBit(int bit)

Returns an individual bit on the collision mask.

    public float GetGravity()

Getter for Gravity

    public float GetGravityDistanceScale()

Getter for GravityDistanceScale

    public Vector3 GetGravityVector()

Getter for GravityVec

    public float GetLinearDamp()

Getter for LinearDamp

    public object[] GetOverlappingAreas()

Returns a list of intersecting Areas. 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.

    public object[] GetOverlappingBodies()

Returns a list of intersecting PhysicsBodys. 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.

    public float GetPriority()

Getter for Priority

    public float GetReverbAmount()

Getter for ReverbBusAmount

    public string GetReverbBus()

Getter for ReverbBusName

    public float GetReverbUniformity()

Getter for ReverbBusUniformity

    public SpaceOverrideEnum GetSpaceOverrideMode()

Getter for SpaceOverride

    public bool IsGravityAPoint()

Getter for GravityPoint

    public bool IsMonitorable()

Getter for Monitorable

    public bool IsMonitoring()

Getter for Monitoring

    public bool IsOverridingAudioBus()

Getter for AudioBusOverride

    public bool IsUsingReverbBus()

Getter for ReverbBusEnable

    public bool OverlapsArea(Node area)

If true the given area overlaps the Area. Note that 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.

    public bool OverlapsBody(Node body)

If true the given body overlaps the Area. Note that 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.

    public void SetAngularDamp(float angularDamp)

Setter for AngularDamp

    public void SetAudioBus(string name)

Setter for AudioBusName

    public void SetAudioBusOverride(bool enable)

Setter for AudioBusOverride

    public void SetCollisionLayer(int collisionLayer)

Setter for CollisionLayer

    public void SetCollisionLayerBit(int bit, bool value)

Set/clear individual bits on the layer mask. This simplifies editing this Area’s layers.

    public void SetCollisionMask(int collisionMask)

Setter for CollisionMask

    public void SetCollisionMaskBit(int bit, bool value)

Set/clear individual bits on the collision mask. This simplifies editing which Area layers this Area scans.

    public void SetGravity(float gravity)

Setter for Gravity

    public void SetGravityDistanceScale(float distanceScale)

Setter for GravityDistanceScale

    public void SetGravityIsPoint(bool enable)

Setter for GravityPoint

    public void SetGravityVector(Vector3 vector)

Setter for GravityVec

    public void SetLinearDamp(float linearDamp)

Setter for LinearDamp

    public void SetMonitorable(bool enable)

Setter for Monitorable

    public void SetMonitoring(bool enable)

Setter for Monitoring

    public void SetPriority(float priority)

Setter for Priority

    public void SetReverbAmount(float amount)

Setter for ReverbBusAmount

    public void SetReverbBus(string name)

Setter for ReverbBusName

    public void SetReverbUniformity(float amount)

Setter for ReverbBusUniformity

    public void SetSpaceOverrideMode(SpaceOverrideEnum enable)

Setter for SpaceOverride

    public void SetUseReverbBus(bool enable)

Setter for ReverbBusEnable

Inner Types

SpaceOverrideEnum

Name Value Description
Disabled 0 This area does not affect gravity/damping.
Combine 1 This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order).
CombineReplace 2 This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order), ignoring any lower priority areas.
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 [code]priority[/code] order), but keeps calculating the rest of the areas.
Tags: