Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
G6DOFJointAxisFlag
PhysicsServer3D.swift:341enum G6DOFJointAxisFlag
Cases
case enableLinearLimit
If set, linear motion is possible within the given limits.
case enableAngularLimit
If set, rotational motion is possible.
case enableAngularSpring
case enableLinearSpring
case enableMotor
If set, there is a rotational motor across these axes.
case enableLinearMotor
If set, there is a linear motor on this axis that targets a specific velocity.
case max
Represents the size of the
G6DOFJointAxisFlag
enum.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (188) members.
Types
enum AreaBodyStatus
enum AreaParameter
enum AreaSpaceOverrideMode
enum BodyAxis
enum BodyDampMode
enum BodyMode
enum BodyParameter
enum BodyState
enum ConeTwistJointParam
enum G6DOFJointAxisParam
enum HingeJointFlag
enum HingeJointParam
enum JointType
enum PinJointParam
enum ProcessInfo
enum ShapeType
enum SliderJointParam
enum SpaceParameter
Type members
static func areaAddShape(area: RID, shape: RID, transform: Transform3D, disabled: Bool
) 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.
static func areaAttachObjectInstanceId(area: RID, id: UInt
) Assigns the area to a descendant of
Object
, so it can exist in the node tree.static func areaClearShapes(area: RID
) Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later.
static func areaCreate(
) -> RID Creates a 3D area object in the physics server, and returns the
RID
that identifies it. The default settings for the created area include a collision layer and mask set to1
, andmonitorable
set tofalse
.static func areaGetCollisionLayer(area: RID
) -> UInt32 Returns the physics layer or layers an area belongs to.
static func areaGetCollisionMask(area: RID
) -> UInt32 Returns the physics layer or layers an area can contact with.
static func areaGetObjectInstanceId(area: RID
) -> UInt Gets the instance ID of the object the area is assigned to.
static func areaGetParam(area: RID, param: PhysicsServer3D.AreaParameter
) -> Variant Returns an area parameter value. A list of available parameters is on the
AreaParameter
constants.static func areaGetShape(area: RID, shapeIdx: Int32
) -> RID Returns the
RID
of the nth shape of an area.static func areaGetShapeCount(area: RID
) -> Int32 Returns the number of shapes assigned to an area.
static func areaGetShapeTransform(area: RID, shapeIdx: Int32
) -> Transform3D Returns the transform matrix of a shape within an area.
static func areaGetSpace(area: RID
) -> RID Returns the space assigned to the area.
static func areaGetTransform(area: RID
) -> Transform3D Returns the transform matrix for an area.
static func areaRemoveShape(area: RID, shapeIdx: Int32
) Removes a shape from an area. It does not delete the shape, so it can be reassigned later.
static func areaSetAreaMonitorCallback(area: RID, callback: Callable
) Sets the area’s area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters:
static func areaSetCollisionLayer(area: RID, layer: UInt32
) Assigns the area to one or many physics layers.
static func areaSetCollisionMask(area: RID, mask: UInt32
) Sets which physics layers the area will monitor.
static func areaSetMonitorCallback(area: RID, callback: Callable
) Sets the area’s body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters:
static func areaSetMonitorable(area: RID, monitorable: Bool
) static func areaSetParam(area: RID, param: PhysicsServer3D.AreaParameter, value: Variant
) Sets the value for an area parameter. A list of available parameters is on the
AreaParameter
constants.static func areaSetRayPickable(area: RID, enable: Bool
) Sets object pickable with rays.
static func areaSetShape(area: RID, shapeIdx: Int32, shape: RID
) Substitutes a given area shape by another. The old shape is selected by its index, the new one by its
RID
.static func areaSetShapeDisabled(area: RID, shapeIdx: Int32, disabled: Bool
) static func areaSetShapeTransform(area: RID, shapeIdx: Int32, transform: Transform3D
) Sets the transform matrix for an area shape.
static func areaSetSpace(area: RID, space: RID
) Assigns a space to the area.
static func areaSetTransform(area: RID, transform: Transform3D
) Sets the transform matrix for an area.
static func bodyAddCollisionException(body: RID, exceptedBody: RID
) Adds a body to the list of bodies exempt from collisions.
static func bodyAddConstantCentralForce(body: RID, force: Vector3
) Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with
body_set_constant_force(body, Vector3(0, 0, 0))
.static func bodyAddConstantForce(body: RID, force: Vector3, position: Vector3
) Adds a constant positioned force to the body that keeps being applied over time until cleared with
body_set_constant_force(body, Vector3(0, 0, 0))
.static func bodyAddConstantTorque(body: RID, torque: Vector3
) Adds a constant rotational force without affecting position that keeps being applied over time until cleared with
body_set_constant_torque(body, Vector3(0, 0, 0))
.static func bodyAddShape(body: RID, shape: RID, transform: Transform3D, disabled: Bool
) 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.
static func bodyApplyCentralForce(body: RID, force: Vector3
) Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
static func bodyApplyCentralImpulse(body: RID, impulse: Vector3
) Applies a directional impulse without affecting rotation.
static func bodyApplyForce(body: RID, force: Vector3, position: Vector3
) Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
static func bodyApplyImpulse(body: RID, impulse: Vector3, position: Vector3
) Applies a positioned impulse to the body.
static func bodyApplyTorque(body: RID, torque: Vector3
) Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
static func bodyApplyTorqueImpulse(body: RID, impulse: Vector3
) Applies a rotational impulse to the body without affecting the position.
static func bodyAttachObjectInstanceId(body: RID, id: UInt
) Assigns the area to a descendant of
Object
, so it can exist in the node tree.static func bodyClearShapes(body: RID
) Removes all shapes from a body.
static func bodyCreate(
) -> RID Creates a 3D body object in the physics server, and returns the
RID
that identifies it. The default settings for the created area include a collision layer and mask set to1
, and body mode set to .rigid.static func bodyGetCollisionLayer(body: RID
) -> UInt32 Returns the physics layer or layers a body belongs to.
static func bodyGetCollisionMask(body: RID
) -> UInt32 Returns the physics layer or layers a body can collide with.
static func bodyGetCollisionPriority(body: RID
) -> Double Returns the body’s collision priority.
static func bodyGetConstantForce(body: RID
) -> Vector3 Returns the body’s total constant positional forces applied during each physics update.
static func bodyGetConstantTorque(body: RID
) -> Vector3 Returns the body’s total constant rotational forces applied during each physics update.
static func bodyGetDirectState(body: RID
) -> PhysicsDirectBodyState3D? Returns the
PhysicsDirectBodyState3D
of the body. Returnsnull
if the body is destroyed or removed from the physics space.static func bodyGetMaxContactsReported(body: RID
) -> Int32 Returns the maximum contacts that can be reported. See
bodySetMaxContactsReported(body:amount:)
.static func bodyGetMode(body: RID
) -> PhysicsServer3D.BodyMode Returns the body mode.
static func bodyGetObjectInstanceId(body: RID
) -> UInt Gets the instance ID of the object the area is assigned to.
static func bodyGetParam(body: RID, param: PhysicsServer3D.BodyParameter
) -> Variant Returns the value of a body parameter. A list of available parameters is on the
BodyParameter
constants.static func bodyGetShape(body: RID, shapeIdx: Int32
) -> RID Returns the
RID
of the nth shape of a body.static func bodyGetShapeCount(body: RID
) -> Int32 Returns the number of shapes assigned to a body.
static func bodyGetShapeTransform(body: RID, shapeIdx: Int32
) -> Transform3D Returns the transform matrix of a body shape.
static func bodyGetSpace(body: RID
) -> RID Returns the
RID
of the space assigned to a body.static func bodyGetState(body: RID, state: PhysicsServer3D.BodyState
) -> Variant Returns a body state.
static func bodyIsAxisLocked(body: RID, axis: PhysicsServer3D.BodyAxis
) -> Bool static func bodyIsContinuousCollisionDetectionEnabled(body: RID
) -> Bool If
true
, the continuous collision detection mode is enabled.static func bodyIsOmittingForceIntegration(body: RID
) -> Bool Returns
true
if the body is omitting the standard force integration. SeebodySetOmitForceIntegration(body:enable:)
.static func bodyRemoveCollisionException(body: RID, exceptedBody: RID
) Removes a body from the list of bodies exempt from collisions.
static func bodyRemoveShape(body: RID, shapeIdx: Int32
) Removes a shape from a body. The shape is not deleted, so it can be reused afterwards.
static func bodyResetMassProperties(body: RID
) Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using
bodySetParam(body:param:value:)
.static func bodySetAxisLock(body: RID, axis: PhysicsServer3D.BodyAxis, lock: Bool
) static func bodySetAxisVelocity(body: RID, axisVelocity: Vector3
) 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.
static func bodySetCollisionLayer(body: RID, layer: UInt32
) Sets the physics layer or layers a body belongs to.
static func bodySetCollisionMask(body: RID, mask: UInt32
) Sets the physics layer or layers a body can collide with.
static func bodySetCollisionPriority(body: RID, priority: Double
) Sets the body’s collision priority.
static func bodySetConstantForce(body: RID, force: Vector3
) Sets the body’s total constant positional forces applied during each physics update.
static func bodySetConstantTorque(body: RID, torque: Vector3
) Sets the body’s total constant rotational forces applied during each physics update.
static func bodySetEnableContinuousCollisionDetection(body: RID, enable: Bool
) If
true
, the continuous collision detection mode is enabled.static func bodySetForceIntegrationCallback(body: RID, callable: Callable, userdata: Variant
) Sets the body’s custom force integration callback function to
callable
. Use an emptyCallable
([code skip-lint]Callable()`) to clear the custom callback.static func bodySetMaxContactsReported(body: RID, amount: Int32
) Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0.
static func bodySetMode(body: RID, mode: PhysicsServer3D.BodyMode
) Sets the body mode, from one of the
BodyMode
constants.static func bodySetOmitForceIntegration(body: RID, enable: Bool
) Sets whether the body omits the standard force integration. If
enable
istrue
, the body will not automatically use applied forces, torques, and damping to update the body’s linear and angular velocity. In this case,bodySetForceIntegrationCallback(body:callable:userdata:)
can be used to manually update the linear and angular velocity instead.static func bodySetParam(body: RID, param: PhysicsServer3D.BodyParameter, value: Variant
) Sets a body parameter. A list of available parameters is on the
BodyParameter
constants.static func bodySetRayPickable(body: RID, enable: Bool
) Sets the body pickable with rays if
enable
is set.static func bodySetShape(body: RID, shapeIdx: Int32, shape: RID
) Substitutes a given body shape by another. The old shape is selected by its index, the new one by its
RID
.static func bodySetShapeDisabled(body: RID, shapeIdx: Int32, disabled: Bool
) static func bodySetShapeTransform(body: RID, shapeIdx: Int32, transform: Transform3D
) Sets the transform matrix for a body shape.
static func bodySetSpace(body: RID, space: RID
) Assigns a space to the body (see
spaceCreate
).static func bodySetState(body: RID, state: PhysicsServer3D.BodyState, value: Variant
) Sets a body state (see
BodyState
constants).static func bodyTestMotion(body: RID, parameters: PhysicsTestMotionParameters3D?, result: PhysicsTestMotionResult3D?
) -> Bool Returns
true
if a collision would result from moving along a motion vector from a given point in space.PhysicsTestMotionParameters3D
is passed to set motion parameters.PhysicsTestMotionResult3D
can be passed to return additional information.static func boxShapeCreate(
) -> RID static func capsuleShapeCreate(
) -> RID static func concavePolygonShapeCreate(
) -> RID static func coneTwistJointGetParam(joint: RID, param: PhysicsServer3D.ConeTwistJointParam
) -> Double Gets a cone_twist_joint parameter (see
ConeTwistJointParam
constants).static func coneTwistJointSetParam(joint: RID, param: PhysicsServer3D.ConeTwistJointParam, value: Double
) Sets a cone_twist_joint parameter (see
ConeTwistJointParam
constants).static func convexPolygonShapeCreate(
) -> RID static func customShapeCreate(
) -> RID static func cylinderShapeCreate(
) -> RID static func freeRid(RID
) Destroys any of the objects created by PhysicsServer3D. If the
RID
passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console.static func generic6dofJointGetFlag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag
) -> Bool Returns the value of a generic 6DOF joint flag. See
G6DOFJointAxisFlag
for the list of available flags.static func generic6dofJointGetParam(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam
) -> Double Returns the value of a generic 6DOF joint parameter. See
G6DOFJointAxisParam
for the list of available parameters.static func generic6dofJointSetFlag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag, enable: Bool
) Sets the value of a given generic 6DOF joint flag. See
G6DOFJointAxisFlag
for the list of available flags.static func generic6dofJointSetParam(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam, value: Double
) Sets the value of a given generic 6DOF joint parameter. See
G6DOFJointAxisParam
for the list of available parameters.static func getProcessInfo(PhysicsServer3D.ProcessInfo
) -> Int32 Returns information about the current state of the 3D physics engine. See
ProcessInfo
for a list of available states.static func heightmapShapeCreate(
) -> RID static func hingeJointGetFlag(joint: RID, flag: PhysicsServer3D.HingeJointFlag
) -> Bool Gets a hinge_joint flag (see
HingeJointFlag
constants).static func hingeJointGetParam(joint: RID, param: PhysicsServer3D.HingeJointParam
) -> Double Gets a hinge_joint parameter (see
HingeJointParam
).static func hingeJointSetFlag(joint: RID, flag: PhysicsServer3D.HingeJointFlag, enabled: Bool
) Sets a hinge_joint flag (see
HingeJointFlag
constants).static func hingeJointSetParam(joint: RID, param: PhysicsServer3D.HingeJointParam, value: Double
) Sets a hinge_joint parameter (see
HingeJointParam
constants).static func jointClear(joint: RID
) static func jointCreate(
) -> RID static func jointDisableCollisionsBetweenBodies(joint: RID, disable: Bool
) Sets whether the bodies attached to the
Joint3D
will collide with each other.static func jointGetSolverPriority(joint: RID
) -> Int32 Gets the priority value of the Joint3D.
static func jointGetType(joint: RID
) -> PhysicsServer3D.JointType Returns the type of the Joint3D.
static func jointIsDisabledCollisionsBetweenBodies(joint: RID
) -> Bool Returns whether the bodies attached to the
Joint3D
will collide with each other.static func jointMakeConeTwist(joint: RID, bodyA: RID, localRefA: Transform3D, bodyB: RID, localRefB: Transform3D
) static func jointMakeGeneric6dof(joint: RID, bodyA: RID, localRefA: Transform3D, bodyB: RID, localRefB: Transform3D
) Make the joint a generic six degrees of freedom (6DOF) joint. Use
generic6dofJointSetFlag(joint:axis:flag:enable:)
andgeneric6dofJointSetParam(joint:axis:param:value:)
to set the joint’s flags and parameters respectively.static func jointMakeHinge(joint: RID, bodyA: RID, hingeA: Transform3D, bodyB: RID, hingeB: Transform3D
) static func jointMakePin(joint: RID, bodyA: RID, localA: Vector3, bodyB: RID, localB: Vector3
) static func jointMakeSlider(joint: RID, bodyA: RID, localRefA: Transform3D, bodyB: RID, localRefB: Transform3D
) static func jointSetSolverPriority(joint: RID, priority: Int32
) Sets the priority value of the Joint3D.
static func pinJointGetLocalA(joint: RID
) -> Vector3 Returns position of the joint in the local space of body a of the joint.
static func pinJointGetLocalB(joint: RID
) -> Vector3 Returns position of the joint in the local space of body b of the joint.
static func pinJointGetParam(joint: RID, param: PhysicsServer3D.PinJointParam
) -> Double Gets a pin_joint parameter (see
PinJointParam
constants).static func pinJointSetLocalA(joint: RID, localA: Vector3
) Sets position of the joint in the local space of body a of the joint.
static func pinJointSetLocalB(joint: RID, localB: Vector3
) Sets position of the joint in the local space of body b of the joint.
static func pinJointSetParam(joint: RID, param: PhysicsServer3D.PinJointParam, value: Double
) Sets a pin_joint parameter (see
PinJointParam
constants).static func separationRayShapeCreate(
) -> RID static func setActive(Bool
) Activates or deactivates the 3D physics engine.
static func shapeGetData(shape: RID
) -> Variant Returns the shape data.
static func shapeGetMargin(shape: RID
) -> Double Returns the collision margin for the shape.
static func shapeGetType(shape: RID
) -> PhysicsServer3D.ShapeType Returns the type of shape (see
ShapeType
constants).static func shapeSetData(shape: RID, data: Variant
) Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created
shapeGetType(shape:)
.static func shapeSetMargin(shape: RID, margin: Double
) Sets the collision margin for the shape.
static func sliderJointGetParam(joint: RID, param: PhysicsServer3D.SliderJointParam
) -> Double Gets a slider_joint parameter (see
SliderJointParam
constants).static func sliderJointSetParam(joint: RID, param: PhysicsServer3D.SliderJointParam, value: Double
) Gets a slider_joint parameter (see
SliderJointParam
constants).static func softBodyAddCollisionException(body: RID, bodyB: RID
) Adds the given body to the list of bodies exempt from collisions.
static func softBodyCreate(
) -> RID Creates a new soft body and returns its internal
RID
.static func softBodyGetBounds(body: RID
) -> AABB Returns the bounds of the given soft body in global coordinates.
static func softBodyGetCollisionLayer(body: RID
) -> UInt32 Returns the physics layer or layers that the given soft body belongs to.
static func softBodyGetCollisionMask(body: RID
) -> UInt32 Returns the physics layer or layers that the given soft body can collide with.
static func softBodyGetDampingCoefficient(body: RID
) -> Double Returns the damping coefficient of the given soft body.
static func softBodyGetDragCoefficient(body: RID
) -> Double Returns the drag coefficient of the given soft body.
static func softBodyGetLinearStiffness(body: RID
) -> Double Returns the linear stiffness of the given soft body.
static func softBodyGetPointGlobalPosition(body: RID, pointIndex: Int32
) -> Vector3 Returns the current position of the given soft body point in global coordinates.
static func softBodyGetPressureCoefficient(body: RID
) -> Double Returns the pressure coefficient of the given soft body.
static func softBodyGetSimulationPrecision(body: RID
) -> Int32 Returns the simulation precision of the given soft body.
static func softBodyGetSpace(body: RID
) -> RID Returns the
RID
of the space assigned to the given soft body.static func softBodyGetState(body: RID, state: PhysicsServer3D.BodyState
) -> Variant Returns the given soft body state (see
BodyState
constants).static func softBodyGetTotalMass(body: RID
) -> Double Returns the total mass assigned to the given soft body.
static func softBodyIsPointPinned(body: RID, pointIndex: Int32
) -> Bool Returns whether the given soft body point is pinned.
static func softBodyMovePoint(body: RID, pointIndex: Int32, globalPosition: Vector3
) Moves the given soft body point to a position in global coordinates.
static func softBodyPinPoint(body: RID, pointIndex: Int32, pin: Bool
) Pins or unpins the given soft body point based on the value of
pin
.static func softBodyRemoveAllPinnedPoints(body: RID
) Unpins all points of the given soft body.
static func softBodyRemoveCollisionException(body: RID, bodyB: RID
) Removes the given body from the list of bodies exempt from collisions.
static func softBodySetCollisionLayer(body: RID, layer: UInt32
) Sets the physics layer or layers the given soft body belongs to.
static func softBodySetCollisionMask(body: RID, mask: UInt32
) Sets the physics layer or layers the given soft body can collide with.
static func softBodySetDampingCoefficient(body: RID, dampingCoefficient: Double
) Sets the damping coefficient of the given soft body. Higher values will slow down the body more noticeably when forces are applied.
static func softBodySetDragCoefficient(body: RID, dragCoefficient: Double
) Sets the drag coefficient of the given soft body. Higher values increase this body’s air resistance.
static func softBodySetLinearStiffness(body: RID, stiffness: Double
) Sets the linear stiffness of the given soft body. Higher values will result in a stiffer body, while lower values will increase the body’s ability to bend. The value can be between
0.0
and1.0
(inclusive).static func softBodySetMesh(body: RID, mesh: RID
) Sets the mesh of the given soft body.
static func softBodySetPressureCoefficient(body: RID, pressureCoefficient: Double
) Sets the pressure coefficient of the given soft body. Simulates pressure build-up from inside this body. Higher values increase the strength of this effect.
static func softBodySetRayPickable(body: RID, enable: Bool
) Sets whether the given soft body will be pickable when using object picking.
static func softBodySetSimulationPrecision(body: RID, simulationPrecision: Int32
) Sets the simulation precision of the given soft body. Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
static func softBodySetSpace(body: RID, space: RID
) Assigns a space to the given soft body (see
spaceCreate
).static func softBodySetState(body: RID, state: PhysicsServer3D.BodyState, variant: Variant
) Sets the given body state for the given body (see
BodyState
constants).static func softBodySetTotalMass(body: RID, totalMass: Double
) Sets the total mass for the given soft body.
static func softBodySetTransform(body: RID, transform: Transform3D
) Sets the global transform of the given soft body.
static func softBodyUpdateRenderingServer(body: RID, renderingServerHandler: PhysicsServer3DRenderingServerHandler?
) Requests that the physics server updates the rendering server with the latest positions of the given soft body’s points through the
renderingServerHandler
interface.static func spaceCreate(
) -> RID 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(area:space:)
, or to a body withbodySetSpace(body:space:)
.static func spaceGetDirectState(space: RID
) -> PhysicsDirectSpaceState3D? Returns the state of a space, a
PhysicsDirectSpaceState3D
. This object can be used to make collision/intersection queries.static func spaceGetParam(space: RID, param: PhysicsServer3D.SpaceParameter
) -> Double Returns the value of a space parameter.
static func spaceIsActive(space: RID
) -> Bool Returns whether the space is active.
static func spaceSetActive(space: RID, active: Bool
) Marks a space as active. It will not have an effect, unless it is assigned to an area or body.
static func spaceSetParam(space: RID, param: PhysicsServer3D.SpaceParameter, value: Double
) Sets the value for a space parameter. A list of available parameters is on the
SpaceParameter
constants.static func sphereShapeCreate(
) -> RID static func worldBoundaryShapeCreate(
) -> RID class var godotClassName: StringName
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.