Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
Assigns the area to a descendant of GodotObject, so it can exist in the node tree.
Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.
Creates an Area2D.
Gets the instance ID of the object the area is assigned to.
Returns an area parameter value. A list of available parameters is on the AREA_PARAM_* constants.
Returns the RID of the nth shape of an area.
Returns the number of shapes assigned to an area.
Returns the transform matrix of a shape within an area.
Returns the space assigned to the area.
Returns the space override mode for the area.
Returns the transform matrix for an area.
Removes a shape from an area. It does not delete the shape, so it can be reassigned later.
Assigns the area to one or many physics layers.
Sets which physics layers the area will monitor.
Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area. 2: RID of the object that entered/exited the area. 3: Instance ID of the object that entered/exited the area. 4: The shape index of the object that entered/exited the area. 5: The shape index of the area where the object entered/exited.
Sets the value for an area parameter. A list of available parameters is on the AREA_PARAM_* constants.
Substitutes a given area shape by another. The old shape is selected by its index, the new one by its RID.
Disables a given shape in an area.
Sets the transform matrix for an area shape.
Assigns a space to the area.
Sets the space override mode for the area. The modes are described in the constants AREA_SPACE_OVERRIDE_*.
Sets the transform matrix for an area.
Adds a body to the list of bodies exempt from collisions.
Adds a positioned force to the applied force and torque. As with bodyApplyImpulse, both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
Assigns the area to a descendant of GodotObject, so it can exist in the node tree.
Removes all shapes from a body.
Creates a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
Returns the physics layer or layers a body belongs to.
Returns the physics layer or layers a body can collide with.
Returns the continuous collision detection mode.
Returns the Physics2DDirectBodyState of the body.
Returns the maximum contacts that can be reported. See bodySetMaxContactsReported.
Returns the body mode.
Gets the instance ID of the object the area is assigned to.
Returns the value of a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
Returns the RID of the nth shape of a body.
Returns the number of shapes assigned to a body.
Returns the metadata of a shape of a body.
Returns the transform matrix of a body shape.
Returns the RID of the space assigned to a body.
Returns a body state.
Returns whether a body uses a callback function to calculate its own physics (see bodySetForceIntegrationCallback).
Removes a body from the list of bodies exempt from collisions.
Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
Sets the physics layer or layers a body belongs to.
Sets the physics layer or layers a body can collide with.
Sets the continuous collision detection mode from any of the CCD_MODE_* constants. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
Sets the function used to calculate physics for an object, if that object allows it (see bodySetOmitForceIntegration).
Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
Sets the body mode, from one of the constants BODY_MODE*.
Sets whether a body uses a callback function to calculate its own physics (see bodySetForceIntegrationCallback).
Sets a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
Substitutes a given body shape by another. The old shape is selected by its index, the new one by its RID.
Enables one way collision on body if enable is true.
Disables shape in body if disable is true.
Sets metadata of a shape within a body. This metadata is different from GodotObject.setMeta, and can be retrieved on shape queries.
Sets the transform matrix for a body shape.
Assigns a space to the body (see spaceCreate).
Sets a body state (see BODY_STATE* constants).
Returns whether a body can move from a given point in a given direction. Apart from the boolean return value, a Physics2DTestMotionResult can be passed to return additional information in.
Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
Returns the value of a damped spring joint parameter.
Sets a damped spring joint parameter. Parameters are explained in the DAMPED_STRING* constants.
Destroys any of the objects created by Physics2DServer. If the RID passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console.
Returns information about the current state of the 2D physics engine. The states are listed under the INFO_* constants.
Creates a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
Returns the value of a joint parameter.
Returns the type of a joint (see JOINT_* constants).
Sets a joint parameter. Parameters are explained in the JOINT_PARAM* constants.
Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
Activates or deactivates the 2D physics engine.
Returns the shape data.
Returns the type of shape (see SHAPE_* constants).
Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created shapeGetType.
Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with areaSetSpace, or to a body with bodySetSpace.
Returns the state of a space, a Physics2DDirectSpaceState. This object can be used to make collision/intersection queries.
Returns the value of a space parameter.
Returns whether the space is active.
Marks a space as active. It will not have an effect, unless it is assigned to an area or body.
Sets the value for a space parameter. A list of available parameters is on the SPACE_PARAM_* constants.
Physics 2D Server.
Physics 2D Server is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree.