Click or drag to resize

PhysicsServer Class

PhysicsServer is the server responsible for all 3D physics. It can create many kinds of physics objects, but does not insert them on the node tree.

Inheritance Hierarchy
SystemObject
  GodotPhysicsServer

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static class PhysicsServer

The PhysicsServer type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberSingleton
Top
Methods
  NameDescription
Public methodStatic memberAreaAddShape

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.

Public methodStatic memberAreaAttachObjectInstanceId

Assigns the area to a descendant of Object, so it can exist in the node tree.

Public methodStatic memberAreaClearShapes

Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.

Public methodStatic memberAreaCreate

Creates an Area.

Public methodStatic memberAreaGetObjectInstanceId

Gets the instance ID of the object the area is assigned to.

Public methodStatic memberAreaGetParam

Returns an area parameter value. A list of available parameters is on the PhysicsServerAreaParameter constants.

Public methodStatic memberAreaGetShape

Returns the RID of the nth shape of an area.

Public methodStatic memberAreaGetShapeCount

Returns the number of shapes assigned to an area.

Public methodStatic memberAreaGetShapeTransform

Returns the transform matrix of a shape within an area.

Public methodStatic memberAreaGetSpace

Returns the space assigned to the area.

Public methodStatic memberAreaGetSpaceOverrideMode

Returns the space override mode for the area.

Public methodStatic memberAreaGetTransform

Returns the transform matrix for an area.

Public methodStatic memberAreaIsRayPickable

If true, area collides with rays.

Public methodStatic memberAreaRemoveShape

Removes a shape from an area. It does not delete the shape, so it can be reassigned later.

Public methodStatic memberAreaSetAreaMonitorCallback
Public methodStatic memberAreaSetCollisionLayer

Assigns the area to one or many physics layers.

Public methodStatic memberAreaSetCollisionMask

Sets which physics layers the area will monitor.

Public methodStatic memberAreaSetMonitorable
Public methodStatic memberAreaSetMonitorCallback

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: or , 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.

Public methodStatic memberAreaSetParam

Sets the value for an area parameter. A list of available parameters is on the PhysicsServerAreaParameter constants.

Public methodStatic memberAreaSetRayPickable

Sets object pickable with rays.

Public methodStatic memberAreaSetShape

Substitutes a given area shape by another. The old shape is selected by its index, the new one by its RID.

Public methodStatic memberAreaSetShapeDisabled
Public methodStatic memberAreaSetShapeTransform

Sets the transform matrix for an area shape.

Public methodStatic memberAreaSetSpace

Assigns a space to the area.

Public methodStatic memberAreaSetSpaceOverrideMode

Sets the space override mode for the area. The modes are described in the PhysicsServerAreaSpaceOverrideMode constants.

Public methodStatic memberAreaSetTransform

Sets the transform matrix for an area.

Public methodStatic memberBodyAddCentralForce
Public methodStatic memberBodyAddCollisionException

Adds a body to the list of bodies exempt from collisions.

Public methodStatic memberBodyAddForce
Public methodStatic memberBodyAddShape

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.

Public methodStatic memberBodyAddTorque
Public methodStatic memberBodyApplyCentralImpulse
Public methodStatic memberBodyApplyImpulse

Gives the body a push at a position in the direction of the impulse.

Public methodStatic memberBodyApplyTorqueImpulse

Gives the body a push to rotate it.

Public methodStatic memberBodyAttachObjectInstanceId

Assigns the area to a descendant of Object, so it can exist in the node tree.

Public methodStatic memberBodyClearShapes

Removes all shapes from a body.

Public methodStatic memberBodyCreate

Creates a physics body. The first parameter can be any value from PhysicsServerBodyMode constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.

Public methodStatic memberBodyGetCollisionLayer

Returns the physics layer or layers a body belongs to.

Public methodStatic memberBodyGetCollisionMask

Returns the physics layer or layers a body can collide with.

-

Public methodStatic memberBodyGetDirectState

Returns the PhysicsDirectBodyState of the body.

Public methodStatic memberBodyGetKinematicSafeMargin
Public methodStatic memberBodyGetMaxContactsReported

Returns the maximum contacts that can be reported. See BodySetMaxContactsReported(RID, Int32).

Public methodStatic memberBodyGetMode

Returns the body mode.

Public methodStatic memberBodyGetObjectInstanceId

Gets the instance ID of the object the area is assigned to.

Public methodStatic memberBodyGetParam

Returns the value of a body parameter. A list of available parameters is on the PhysicsServerBodyParameter constants.

Public methodStatic memberBodyGetShape

Returns the RID of the nth shape of a body.

Public methodStatic memberBodyGetShapeCount

Returns the number of shapes assigned to a body.

Public methodStatic memberBodyGetShapeTransform

Returns the transform matrix of a body shape.

Public methodStatic memberBodyGetSpace

Returns the RID of the space assigned to a body.

Public methodStatic memberBodyGetState

Returns a body state.

Public methodStatic memberBodyIsAxisLocked
Public methodStatic memberBodyIsContinuousCollisionDetectionEnabled

If true, the continuous collision detection mode is enabled.

Public methodStatic memberBodyIsOmittingForceIntegration

Returns whether a body uses a callback function to calculate its own physics (see BodySetForceIntegrationCallback(RID, Object, String, Object)).

Public methodStatic memberBodyIsRayPickable

If true, the body can be detected by rays.

Public methodStatic memberBodyRemoveCollisionException

Removes a body from the list of bodies exempt from collisions.

Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.

Public methodStatic memberBodyRemoveShape

Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.

Public methodStatic memberBodySetAxisLock
Public methodStatic memberBodySetAxisVelocity

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.

Public methodStatic memberBodySetCollisionLayer

Sets the physics layer or layers a body belongs to.

Public methodStatic memberBodySetCollisionMask

Sets the physics layer or layers a body can collide with.

Public methodStatic memberBodySetEnableContinuousCollisionDetection

If true, the continuous collision detection mode is enabled.

Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.

Public methodStatic memberBodySetForceIntegrationCallback

Sets the function used to calculate physics for an object, if that object allows it (see BodySetOmitForceIntegration(RID, Boolean)).

Public methodStatic memberBodySetKinematicSafeMargin
Public methodStatic memberBodySetMaxContactsReported

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.

Public methodStatic memberBodySetMode
Public methodStatic memberBodySetOmitForceIntegration

Sets whether a body uses a callback function to calculate its own physics (see BodySetForceIntegrationCallback(RID, Object, String, Object)).

Public methodStatic memberBodySetParam

Sets a body parameter. A list of available parameters is on the PhysicsServerBodyParameter constants.

Public methodStatic memberBodySetRayPickable

Sets the body pickable with rays if enabled is set.

Public methodStatic memberBodySetShape

Substitutes a given body shape by another. The old shape is selected by its index, the new one by its RID.

Public methodStatic memberBodySetShapeDisabled
Public methodStatic memberBodySetShapeTransform

Sets the transform matrix for a body shape.

Public methodStatic memberBodySetSpace
Public methodStatic memberBodySetState
Public methodStatic memberConeTwistJointGetParam
Public methodStatic memberConeTwistJointSetParam
Public methodStatic memberFreeRid

Destroys any of the objects created by PhysicsServer. If the RID passed is not one of the objects that can be created by PhysicsServer, an error will be sent to the console.

Public methodStatic memberGeneric6dofJointGetFlag
Public methodStatic memberGeneric6dofJointGetParam
Public methodStatic memberGeneric6dofJointSetFlag
Public methodStatic memberGeneric6dofJointSetParam
Public methodStatic memberGetProcessInfo
Public methodStatic memberHingeJointGetFlag
Public methodStatic memberHingeJointGetParam
Public methodStatic memberHingeJointSetFlag
Public methodStatic memberHingeJointSetParam
Public methodStatic memberJointCreateConeTwist

Creates a ConeTwistJoint.

Public methodStatic memberJointCreateGeneric6dof

Creates a Generic6DOFJoint.

Public methodStatic memberJointCreateHinge

Creates a HingeJoint.

Public methodStatic memberJointCreatePin

Creates a PinJoint.

Public methodStatic memberJointCreateSlider

Creates a SliderJoint.

Public methodStatic memberJointGetSolverPriority

Gets the priority value of the Joint.

Public methodStatic memberJointGetType

Returns the type of the Joint.

Public methodStatic memberJointSetSolverPriority

Sets the priority value of the Joint.

Public methodStatic memberPinJointGetLocalA

Returns position of the joint in the local space of body a of the joint.

Public methodStatic memberPinJointGetLocalB

Returns position of the joint in the local space of body b of the joint.

Public methodStatic memberPinJointGetParam
Public methodStatic memberPinJointSetLocalA

Sets position of the joint in the local space of body a of the joint.

Public methodStatic memberPinJointSetLocalB

Sets position of the joint in the local space of body b of the joint.

Public methodStatic memberPinJointSetParam
Public methodStatic memberSetActive

Activates or deactivates the 3D physics engine.

Public methodStatic memberShapeCreate

Creates a shape of a type from PhysicsServerShapeType. Does not assign it to a body or an area. To do so, you must use AreaSetShape(RID, Int32, RID) or BodySetShape(RID, Int32, RID).

Public methodStatic memberShapeGetData

Returns the shape data.

Public methodStatic memberShapeGetType
Public methodStatic memberShapeSetData

Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created ShapeGetType(RID).

Public methodStatic memberSliderJointGetParam
Public methodStatic memberSliderJointSetParam
Public methodStatic memberSpaceCreate

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(RID, RID), or to a body with BodySetSpace(RID, RID).

Public methodStatic memberSpaceGetDirectState

Returns the state of a space, a PhysicsDirectSpaceState. This object can be used to make collision/intersection queries.

Public methodStatic memberSpaceGetParam

Returns the value of a space parameter.

Public methodStatic memberSpaceIsActive

Returns whether the space is active.

Public methodStatic memberSpaceSetActive

Marks a space as active. It will not have an effect, unless it is assigned to an area or body.

Public methodStatic memberSpaceSetParam

Sets the value for a space parameter. A list of available parameters is on the PhysicsServerSpaceParameter constants.

Top
See Also