PhysicsServer3D
繼承: Object
用於存取低階 3D 物理的伺服器介面。
說明
PhysicsServer3D 是負責所有 3D 物理的伺服器。它可以直接建立和操作所有物理對象:
Space(空間)是用於物理模擬的自包含世界。它包含實體、區域和關節。可以對其狀態進行查詢,獲取碰撞和相交資訊,並且可以修改部分模擬參數。
Shape(形狀)是球形、盒形、圓柱形、多邊形等幾何形狀。加入到實體/區域中就可以用來進行碰撞偵測,還可以帶有相對於實體/區域原點的額外變換。實體/區域中可以新增多個(變換後的)形狀,同一個形狀可以使用不同的局部變換新增到實體/區域中。
Body(實體)是物理物件,可以處於靜態、運動學或剛性模式。可以對其狀態進行查詢和更新(例如位置、速度等)。可以設定力的集成回呼函式,自訂實體的物理特性。
Area(區域)是空間中的區塊,可用於偵測進入和離開它的實體和區域。可以設定實體的監視回呼函式,報告進入/離開的實體形狀,同樣可以設定區域的監視回呼函式。通過設定區域參數,可以在區域內覆蓋重力和阻尼。
Joint(關節)是兩個實體之間或一個實體相對於某個點的約束。可以調整關節偏置和彈簧關節的放鬆長度等參數。
PhysicsServer3D 中的物理物件可以獨立建立和操作;不必將它們綁定到場景樹中的節點。
注意:所有 3D 物理節點都在內部使用這個物理伺服器。將物理節點新增到場景樹,就會導致在物理伺服器中建立相應的物理物件。剛體節點會註冊回呼函式,該回呼函式會(在每次物理更新時)使用物理伺服器中相應實體物件的變換更新該節點的變換。區域節點會註冊回呼函式,用來通知區域節點與物理伺服器中相應區域物件的重疊。射線投射節點會查詢物理伺服器中相關空間的直接狀態。
方法
列舉
enum JointType: 🔗
JointType JOINT_TYPE_PIN = 0
該 Joint3D 為 PinJoint3D。
JointType JOINT_TYPE_HINGE = 1
該 Joint3D 為 HingeJoint3D。
JointType JOINT_TYPE_SLIDER = 2
該 Joint3D 為 SliderJoint3D。
JointType JOINT_TYPE_CONE_TWIST = 3
該 Joint3D 為 ConeTwistJoint3D。
JointType JOINT_TYPE_6DOF = 4
該 Joint3D 為 Generic6DOFJoint3D。
JointType JOINT_TYPE_MAX = 5
代表 JointType 列舉的大小。
enum PinJointParam: 🔗
PinJointParam PIN_JOINT_BIAS = 0
固定物件試圖保持彼此位置關係的力度。
越高越強。
PinJointParam PIN_JOINT_DAMPING = 1
被固定的物體試圖保持彼此速度關係的力度。
越高越強。
PinJointParam PIN_JOINT_IMPULSE_CLAMP = 2
如果高於 0,則此值是此 Joint3D 施加在其末端的脈衝的最大值。
enum HingeJointParam: 🔗
HingeJointParam HINGE_JOINT_BIAS = 0
兩個物體向不同方向移動時被拉回到一起的速度。
HingeJointParam HINGE_JOINT_LIMIT_UPPER = 1
鉸鏈上的最大旋轉。
HingeJointParam HINGE_JOINT_LIMIT_LOWER = 2
鉸鏈上的最小旋轉。
HingeJointParam HINGE_JOINT_LIMIT_BIAS = 3
垂直於鉸鏈的軸線上的旋轉得到糾正的速度。
HingeJointParam HINGE_JOINT_LIMIT_SOFTNESS = 4
There is currently no description for this enum. Please help us by contributing one!
HingeJointParam HINGE_JOINT_LIMIT_RELAXATION = 5
該值越低,旋轉速度越慢。
HingeJointParam HINGE_JOINT_MOTOR_TARGET_VELOCITY = 6
目標馬達的目標速度。
HingeJointParam HINGE_JOINT_MOTOR_MAX_IMPULSE = 7
馬達的最大加速度。
enum HingeJointFlag: 🔗
HingeJointFlag HINGE_JOINT_FLAG_USE_LIMIT = 0
如果為 true,鉸鏈具有最大和最小旋轉。
HingeJointFlag HINGE_JOINT_FLAG_ENABLE_MOTOR = 1
如果為 true,則馬達將轉動鉸鏈。
enum SliderJointParam: 🔗
SliderJointParam SLIDER_JOINT_LINEAR_LIMIT_UPPER = 0
阻尼發生前軸心點之間在 X 軸上的最大差異。
SliderJointParam SLIDER_JOINT_LINEAR_LIMIT_LOWER = 1
阻尼發生前軸心點之間在 X 軸上的最小差異。
SliderJointParam SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS = 2
一旦超過極限,套用於滑桿軸上移動的係數。越低,運動越慢。
SliderJointParam SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION = 3
超出限制後的補償。數值越低,損失的速度能量越多。
SliderJointParam SLIDER_JOINT_LINEAR_LIMIT_DAMPING = 4
一旦超過滑桿的極限,阻尼的數量。
SliderJointParam SLIDER_JOINT_LINEAR_MOTION_SOFTNESS = 5
只要滑桿在限制範圍內,就套用於滑桿軸上移動的係數。越低,運動越慢。
SliderJointParam SLIDER_JOINT_LINEAR_MOTION_RESTITUTION = 6
滑桿限制內的恢復量。
SliderJointParam SLIDER_JOINT_LINEAR_MOTION_DAMPING = 7
滑桿內部的阻尼量受到限制。
SliderJointParam SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS = 8
套用於在垂直於滑桿的軸上移動的係數。
SliderJointParam SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION = 9
當移動穿過垂直於滑桿的軸時的恢復量。
SliderJointParam SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING = 10
當移動穿過垂直於滑桿的軸時的阻尼量。
SliderJointParam SLIDER_JOINT_ANGULAR_LIMIT_UPPER = 11
滑桿旋轉的上限。
SliderJointParam SLIDER_JOINT_ANGULAR_LIMIT_LOWER = 12
滑桿旋轉的下限。
SliderJointParam SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS = 13
一旦超過極限,套用於所有旋轉的係數。
SliderJointParam SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION = 14
超過限制時旋轉的恢復量。
SliderJointParam SLIDER_JOINT_ANGULAR_LIMIT_DAMPING = 15
超過極限時旋轉的阻尼量。
SliderJointParam SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS = 16
套用於所有極限旋轉的因數。
SliderJointParam SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION = 17
極限內旋轉的恢復量。
SliderJointParam SLIDER_JOINT_ANGULAR_MOTION_DAMPING = 18
極限內旋轉的阻尼量。
SliderJointParam SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS = 19
套用於垂直於滑桿的軸上的所有旋轉的因數。
SliderJointParam SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION = 20
垂直於滑桿的軸上的旋轉恢復量。
SliderJointParam SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING = 21
垂直於滑桿的軸上的旋轉阻尼量。
SliderJointParam SLIDER_JOINT_MAX = 22
代表 SliderJointParam 列舉的大小。
enum ConeTwistJointParam: 🔗
ConeTwistJointParam CONE_TWIST_JOINT_SWING_SPAN = 0
擺動是圍繞垂直於扭轉軸的軸線,從一邊到另一邊的旋轉。
擺動跨度定義了沿擺動軸旋轉多少不會得到校正。
可以被定義為 ConeTwistJoint3D 中的鬆動。
如果低於 0.05,該行為將被鎖定。
ConeTwistJointParam CONE_TWIST_JOINT_TWIST_SPAN = 1
扭轉是繞扭轉軸的旋轉,此值定義了關節可以扭轉多遠。
如果低於 0.05,則扭轉被鎖定。
ConeTwistJointParam CONE_TWIST_JOINT_BIAS = 2
擺動或扭轉的速度。
越高,速度越快。
ConeTwistJointParam CONE_TWIST_JOINT_SOFTNESS = 3
Joint3D 的扭曲彈性,如果太低,就需要更大的力才能扭曲關節。
ConeTwistJointParam CONE_TWIST_JOINT_RELAXATION = 4
定義兩側的擺動速度和扭轉速度差異同步的速度。
enum G6DOFJointAxisParam: 🔗
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_LOWER_LIMIT = 0
軸心點的軸之間的最小差異。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_UPPER_LIMIT = 1
軸心點的軸之間的最大差異。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS = 2
套用於跨軸移動的因數。越低,運動越慢。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_RESTITUTION = 3
軸運動的恢復量。速度越低,能量損失越多。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_DAMPING = 4
發生在跨軸線性運動的阻尼量。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY = 5
關節的線性馬達試圖達到的速度。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT = 6
線性馬達在試圖達到目標速度時可以施加的最大力。
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_SPRING_STIFFNESS = 7
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_SPRING_DAMPING = 8
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT = 9
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_LOWER_LIMIT = 10
負方向的最小旋轉,以脫離和繞軸旋轉。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_UPPER_LIMIT = 11
正方向的最小旋轉,以掙脫和繞軸旋轉。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS = 12
乘以所有軸旋轉的因數。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_DAMPING = 13
跨該軸的旋轉阻尼量。值越低,發生的阻尼就越多。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_RESTITUTION = 14
在各軸上的旋轉恢復量。值越低,發生的恢復量越大。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_FORCE_LIMIT = 15
圍繞 Z 軸旋轉時,可能發生的最大力。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_ERP = 16
當校正軸旋轉中的極限交叉時,該誤差容限因數定義了校正的減慢程度。越低越慢。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY = 17
軸上馬達的目標速度。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT = 18
馬達在軸上的最大加速度。
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS = 19
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_SPRING_DAMPING = 20
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT = 21
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisParam G6DOF_JOINT_MAX = 22
Represents the size of the G6DOFJointAxisParam enum.
enum G6DOFJointAxisFlag: 🔗
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT = 0
設定時,可以在給定的範圍內做線性運動。
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT = 1
設定時,可以做旋轉運動。
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING = 2
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING = 3
There is currently no description for this enum. Please help us by contributing one!
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_MOTOR = 4
設定時,存在跨這些軸的旋轉馬達。
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR = 5
設定時,存在跨這些軸的線性馬達,以指定的速度為目標。
G6DOFJointAxisFlag G6DOF_JOINT_FLAG_MAX = 6
Represents the size of the G6DOFJointAxisFlag enum.
enum ShapeType: 🔗
ShapeType SHAPE_WORLD_BOUNDARY = 0
該 Shape3D 為 WorldBoundaryShape3D。
ShapeType SHAPE_SEPARATION_RAY = 1
該 Shape3D 為 SeparationRayShape3D。
ShapeType SHAPE_SPHERE = 2
該 Shape3D 為 SphereShape3D。
ShapeType SHAPE_BOX = 3
該 Shape3D 為 BoxShape3D。
ShapeType SHAPE_CAPSULE = 4
該 Shape3D 為 CapsuleShape3D。
ShapeType SHAPE_CYLINDER = 5
該 Shape3D 為 CylinderShape3D。
ShapeType SHAPE_CONVEX_POLYGON = 6
該 Shape3D 為 ConvexPolygonShape3D。
ShapeType SHAPE_CONCAVE_POLYGON = 7
該 Shape3D 為 ConcavePolygonShape3D。
ShapeType SHAPE_HEIGHTMAP = 8
該 Shape3D 為 HeightMapShape3D。
ShapeType SHAPE_SOFT_BODY = 9
該 Shape3D 是在柔體內部使用的。嘗試建立這種形狀會導致出錯。
ShapeType SHAPE_CUSTOM = 10
引擎內部會使用這個常數。任何試圖建立這種形狀的行為都會導致錯誤。
enum AreaParameter: 🔗
AreaParameter AREA_PARAM_GRAVITY_OVERRIDE_MODE = 0
常數,用於在一個區域中設定/獲取重力覆蓋模式。有關可能的值,請參閱 AreaSpaceOverrideMode。
AreaParameter AREA_PARAM_GRAVITY = 1
常數,用於設定/獲取區域中的重力強度。
AreaParameter AREA_PARAM_GRAVITY_VECTOR = 2
常數,用於設定/獲取區域中的重力向量/中心。
AreaParameter AREA_PARAM_GRAVITY_IS_POINT = 3
常數,用於設定/獲取區域中的重力向量是方向,還是中心點。
AreaParameter AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE = 4
常數,用於設定/獲取重力強度等於 AREA_PARAM_GRAVITY 控制的重力的距離。例如,在半徑為 100 米且表面重力為 4.0 m/s² 的行星上,將重力設定為 4.0,並將單位距離設定為 100.0。重力會根據平方反比定律衰減,因此在該範例中,重力在距中心 200 米處將為 1.0 m/s²(距離的兩倍,重力的 1/4),在距中心 50 米處為 16.0 m/s²(距離的一半,重力的 4 倍),依此類推。
僅當單位距離為正數時,上述情況才成立。當該屬性被設定為 0.0 時,無論距離如何,重力都將保持不變。
AreaParameter AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE = 5
常數,用於在一個區域中設定/獲取線性阻尼覆蓋模式。有關可能的值,請參閱 AreaSpaceOverrideMode。
AreaParameter AREA_PARAM_LINEAR_DAMP = 6
常數,用於設定/獲取區域的線性阻尼係數。
AreaParameter AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE = 7
常數,用於在一個區域中設定/獲取角度阻尼覆蓋模式。有關可能的值,請參閱 AreaSpaceOverrideMode。
AreaParameter AREA_PARAM_ANGULAR_DAMP = 8
常數,用於設定/獲取區域的角度阻尼係數。
AreaParameter AREA_PARAM_PRIORITY = 9
常數,用於設定/獲取區域的優先順序(處理順序)。
AreaParameter AREA_PARAM_WIND_FORCE_MAGNITUDE = 10
Constant to set/get the magnitude of area-specific wind force. This wind force only applies to SoftBody3D nodes. Other physics bodies are currently not affected by wind.
AreaParameter AREA_PARAM_WIND_SOURCE = 11
常數,用於設定/獲取 3D 向量,該向量指定區域特定的風吹來的原點。
AreaParameter AREA_PARAM_WIND_DIRECTION = 12
常數,用於設定/獲取 3D 向量,該向量指定區域特定的風吹的方向。
AreaParameter AREA_PARAM_WIND_ATTENUATION_FACTOR = 13
常數,用於設定/獲取風力隨距其原點的距離而減小的指數速率。
enum AreaSpaceOverrideMode: 🔗
AreaSpaceOverrideMode AREA_SPACE_OVERRIDE_DISABLED = 0
這個區域不影響重力/阻尼。這些一般都是只存在於偵測碰撞的區域,以及進入或離開它們的物體。
AreaSpaceOverrideMode AREA_SPACE_OVERRIDE_COMBINE = 1
此區域把它的重力/阻尼加到目前已經計算過的對象上。這樣一來,許多重疊的區域可以結合它們的物理運算來產生有趣的效果。
AreaSpaceOverrideMode AREA_SPACE_OVERRIDE_COMBINE_REPLACE = 2
這個區域把它的重力/阻尼加到迄今為止已經計算出來的任何東西上。然後停止考慮其餘的區域,甚至預設的區域。
AreaSpaceOverrideMode AREA_SPACE_OVERRIDE_REPLACE = 3
這個區域取代了任何重力/阻尼,甚至是預設的,並停止考慮其餘的區域。
AreaSpaceOverrideMode AREA_SPACE_OVERRIDE_REPLACE_COMBINE = 4
這個區域取代了到目前為止計算的任何重力/阻尼,但繼續計算其餘的區域,直到預設的區域。
enum BodyMode: 🔗
BodyMode BODY_MODE_STATIC = 0
常數,用於靜態物體。在這種模式下,物體只能由使用者程式碼移動,移動時不會與路徑上的其他物體發生碰撞。
BodyMode BODY_MODE_KINEMATIC = 1
常數,用於運動學物體。在這種模式下,物體只能由使用者程式碼移動,會與路徑上的其他物體發生碰撞。
BodyMode BODY_MODE_RIGID = 2
常數,用於剛體。在這種模式下,物體可以被其他物體推動,能夠對其施加力。
BodyMode BODY_MODE_RIGID_LINEAR = 3
常數,用於線性剛體。在這種模式下,物體不能旋轉,只有線速度受外力影響。
enum BodyParameter: 🔗
BodyParameter BODY_PARAM_BOUNCE = 0
常數,用於設定/獲取物體的反彈係數。
BodyParameter BODY_PARAM_FRICTION = 1
常數,用於設定/獲取物體的摩擦力。
BodyParameter BODY_PARAM_MASS = 2
常數,用於設定/獲取物體的品質。
BodyParameter BODY_PARAM_INERTIA = 3
常數,用於設定/獲取物體的慣性。
BodyParameter BODY_PARAM_CENTER_OF_MASS = 4
常數,用於設定/獲取物體的質心位置,使用該物體的局部坐標系。
BodyParameter BODY_PARAM_GRAVITY_SCALE = 5
常數,用於設定/獲取物體的重力倍數。
BodyParameter BODY_PARAM_LINEAR_DAMP_MODE = 6
常數,用於設定/獲取物體的線性阻尼模式。可能的值見 BodyDampMode。
BodyParameter BODY_PARAM_ANGULAR_DAMP_MODE = 7
常數,用於設定/獲取物體的角度阻尼模式。可能的值見 BodyDampMode。
BodyParameter BODY_PARAM_LINEAR_DAMP = 8
常數,用於設定/獲取物體的線性阻尼係數。
BodyParameter BODY_PARAM_ANGULAR_DAMP = 9
常數,用於設定/獲取物體的角度阻尼係數。
BodyParameter BODY_PARAM_MAX = 10
代表 BodyParameter 列舉的大小。
enum BodyDampMode: 🔗
BodyDampMode BODY_DAMP_MODE_COMBINE = 0
物體的阻尼值會疊加到替換區域中所設定的值或預設值。
BodyDampMode BODY_DAMP_MODE_REPLACE = 1
物體的阻尼值會替換區域中所設定的值或預設值。
enum BodyState: 🔗
BodyState BODY_STATE_TRANSFORM = 0
常數,用於設定/獲取物體的目前變換矩陣。
BodyState BODY_STATE_LINEAR_VELOCITY = 1
常數,用於設定/獲取物體的目前線速度。
BodyState BODY_STATE_ANGULAR_VELOCITY = 2
常數,用於設定/獲取物體的目前角速度。
BodyState BODY_STATE_SLEEPING = 3
常數,用於使物體沉睡/喚醒,或得到它是否在沉睡。
BodyState BODY_STATE_CAN_SLEEP = 4
常數,用於設定/獲取物體是否可以休眠。
enum AreaBodyStatus: 🔗
AreaBodyStatus AREA_BODY_ADDED = 0
當對象進入其形狀之一時,第一個參數和區域回呼函式接收的值。
AreaBodyStatus AREA_BODY_REMOVED = 1
當對象退出其形狀之一時,第一個參數和區域回呼函式接收的值。
enum ProcessInfo: 🔗
ProcessInfo INFO_ACTIVE_OBJECTS = 0
常數,用以獲取未處於睡眠狀態的物件的數量。
ProcessInfo INFO_COLLISION_PAIRS = 1
常數,用以獲取可能的碰撞數。
ProcessInfo INFO_ISLAND_COUNT = 2
常數,用以獲取可能發生碰撞的空間區域數。
enum SpaceParameter: 🔗
SpaceParameter SPACE_PARAM_CONTACT_RECYCLE_RADIUS = 0
常數,用於設定/獲取一對物體在其碰撞狀態被重新計算之前的最大移動距離。
SpaceParameter SPACE_PARAM_CONTACT_MAX_SEPARATION = 1
常數,用於設定/獲取兩個形狀間的最大距離,超過該距離後它們將被視為分離,接觸將被棄置。
SpaceParameter SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION = 2
常數,用於設定/獲取兩個形狀互相穿透的最大距離,超過該距離後將視為碰撞。
SpaceParameter SPACE_PARAM_CONTACT_DEFAULT_BIAS = 3
常數,用於設定/獲取所有物理接觸的預設求解器偏差。求解器偏差是控制兩個物件在重疊後“反彈”的程度的一個係數,以避免由於數值不精確而使它們處於該狀態。
SpaceParameter SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD = 4
常數,用於設定/獲取活躍的閾值線速度。一個被標記為線性速度和角速度都可能不活躍的物體將在給定的時間後進入睡眠狀態。
SpaceParameter SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD = 5
常數,用於設定/獲取活動的閾值角速度。一個被標記為線性和角速度都可能不活躍的物體,在給定的時間後將會進入睡眠狀態。
SpaceParameter SPACE_PARAM_BODY_TIME_TO_SLEEP = 6
常數,用於設定/獲得最大的活動時間。一個被標記為線速度和角速度都可能不活動的物體,在這個時間之後將被置入睡眠狀態。
SpaceParameter SPACE_PARAM_SOLVER_ITERATIONS = 7
常數,用於設定/獲取接觸和約束的求解器反覆運算次數。反覆運算次數越多,碰撞和約束就越准確。然而,更多的反覆運算需要更多的 CPU 能力,這會降低性能。
enum BodyAxis: 🔗
BodyAxis BODY_AXIS_LINEAR_X = 1
There is currently no description for this enum. Please help us by contributing one!
BodyAxis BODY_AXIS_LINEAR_Y = 2
There is currently no description for this enum. Please help us by contributing one!
BodyAxis BODY_AXIS_LINEAR_Z = 4
There is currently no description for this enum. Please help us by contributing one!
BodyAxis BODY_AXIS_ANGULAR_X = 8
There is currently no description for this enum. Please help us by contributing one!
BodyAxis BODY_AXIS_ANGULAR_Y = 16
There is currently no description for this enum. Please help us by contributing one!
BodyAxis BODY_AXIS_ANGULAR_Z = 32
There is currently no description for this enum. Please help us by contributing one!
方法說明
void area_add_shape(area: RID, shape: RID, transform: Transform3D = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0), disabled: bool = false) 🔗
向區域新增一個形狀,以及一個變換矩陣。形狀通常通過它們的索引來引用,因此你應該追蹤哪個形狀具有給定的索引。
void area_attach_object_instance_id(area: RID, id: int) 🔗
將區域分配給Object的子類別,因此它可以存在於節點樹中。
void area_clear_shapes(area: 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 to 1, and monitorable set to false.
Use area_add_shape() to add shapes to it, use area_set_transform() to set its transform, and use area_set_space() to add the area to a space. If you want the area to be detectable use area_set_monitorable().
int area_get_collision_layer(area: RID) const 🔗
返回該區域所屬的實體層。
int area_get_collision_mask(area: RID) const 🔗
返回該區域能夠接觸的實體層。
int area_get_object_instance_id(area: RID) const 🔗
獲取區域分配給的物件的實例 ID。
Variant area_get_param(area: RID, param: AreaParameter) const 🔗
返回區域參數值。可用參數列表位於 AreaParameter 常數上。
RID area_get_shape(area: RID, shape_idx: int) const 🔗
返回區域的第 n 個形狀的 RID。
int area_get_shape_count(area: RID) const 🔗
返回分配給區域的形狀數量。
Transform3D area_get_shape_transform(area: RID, shape_idx: int) const 🔗
返回區域內形狀的變換矩陣。
RID area_get_space(area: RID) const 🔗
返回分配給該區域的空間。
Transform3D area_get_transform(area: RID) const 🔗
返回區域的變換矩陣。
void area_remove_shape(area: RID, shape_idx: int) 🔗
從區域中移除一個形狀。它不會刪除形狀,因此可以稍後重新分配。
void area_set_area_monitor_callback(area: RID, callback: Callable) 🔗
設定該區域的區域監視回呼函式。當任何其他(形狀)區域進入或退出(形狀)給定區域時,將呼叫此回呼函式,並且必須採用以下五個參數:
一個整數
status:AREA_BODY_ADDED 或 AREA_BODY_REMOVED 取決於其他區域的形狀是進入還是退出該區域,一個整數
instance_id:附加到其他區域的ObjectID,一個整數
area_shape_idx:進入或退出該區域的其他區域的形狀索引,一個整數
self_shape_idx:其他區域進入或退出的區域的形狀索引。
通過計算(或追蹤)進入和退出的形狀,可以確定一個區域(及其所有形狀)是第一次進入還是最後一次退出。
void area_set_collision_layer(area: RID, layer: int) 🔗
將區域分配給一個或多個實體層。
void area_set_collision_mask(area: RID, mask: int) 🔗
設定區域將監控的實體層。
void area_set_monitor_callback(area: RID, callback: Callable) 🔗
設定區域的實體監視器回呼函式。當任何其他(形狀的)實體進入或退出(形狀的)給定區域時,將呼叫此回呼函式,並且必須採用以下五個參數:
一個整數
status:AREA_BODY_ADDED 或 AREA_BODY_REMOVED 取決於其他實體形狀是否進入或退出該區域,一個整數
instance_id:附加到該實體上的ObjectID,一個整數
body_shape_idx:進入或離開該區域的實體形狀索引,一個整數
self_shape_idx:實體進入或離開的區域的形狀索引。
通過計算(或追蹤)進入和退出的形狀,可以確定一個實體(及其所有形狀)是第一次進入還是最後一次退出。
void area_set_monitorable(area: RID, monitorable: bool) 🔗
There is currently no description for this method. Please help us by contributing one!
void area_set_param(area: RID, param: AreaParameter, value: Variant) 🔗
設定面積參數的值。可用參數列表位於 AreaParameter 常數上。
void area_set_ray_pickable(area: RID, enable: bool) 🔗
設定可使用光線拾取的物件。
void area_set_shape(area: RID, shape_idx: int, shape: RID) 🔗
用另一種形狀代替一種形狀。舊的形狀由它的索引選擇,新的形狀由它的RID選擇。
void area_set_shape_disabled(area: RID, shape_idx: int, disabled: bool) 🔗
There is currently no description for this method. Please help us by contributing one!
void area_set_shape_transform(area: RID, shape_idx: int, transform: Transform3D) 🔗
設定區域形狀的變換矩陣。
void area_set_space(area: RID, space: RID) 🔗
為該區域指定一個空間。
void area_set_transform(area: RID, transform: Transform3D) 🔗
設定區域的變換矩陣。
void body_add_collision_exception(body: RID, excepted_body: RID) 🔗
將一個物體新增到免於碰撞的物體列表中。
void body_add_constant_central_force(body: RID, force: Vector3) 🔗
在不影響旋轉的情況下,新增一個恒定的方向力,該力會隨著時間的推移而持續施加,直到使用 body_set_constant_force(body, Vector3(0, 0, 0)) 清除。
這相當於在實體的質心處使用 body_add_constant_force()。
void body_add_constant_force(body: RID, force: Vector3, position: Vector3 = Vector3(0, 0, 0)) 🔗
向實體新增一個恒定的定位力,持續施加,直到用 body_set_constant_force(body, Vector3(0, 0, 0)) 清除。
position 是在全域座標中距實體原點的偏移量。
void body_add_constant_torque(body: RID, torque: Vector3) 🔗
在不影響位置的情況下,新增一個恒定的旋轉力,隨著時間的推移而持續施加,直到使用 body_set_constant_torque(body, Vector3(0, 0, 0)) 清除。
void body_add_shape(body: RID, shape: RID, transform: Transform3D = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0), disabled: bool = false) 🔗
新增一個形狀到物體,以及一個變換矩陣。形狀通常通過它們的索引來引用,因此你應該追蹤哪個形狀具有給定的索引。
void body_apply_central_force(body: RID, force: Vector3) 🔗
在不影響旋轉的情況下,施加一個方向力。力是時間相關的,意味著每次物理更新都會施加。
這相當於在實體的質心處使用 body_apply_force()。
void body_apply_central_impulse(body: RID, impulse: Vector3) 🔗
在不影響旋轉的情況下,施加一個定向脈衝。
衝動是時間無關的!每影格施加一個脈衝將產生依賴於畫面播放速率的力。出於這個原因,它應該只在模擬一次性影響時使用(否則使用“_force”函式)。
這相當於在實體的質心處使用 body_apply_impulse()。
void body_apply_force(body: RID, force: Vector3, position: Vector3 = Vector3(0, 0, 0)) 🔗
對實體施加一個定位力。力是時間相關的,意味著每次物理更新都會被施加。
position 是在全域座標中距實體原點的偏移量。
void body_apply_impulse(body: RID, impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)) 🔗
向實體施加一個定位脈衝。
脈衝是時間無關的!每影格施加一個脈衝將產生一個依賴於畫面播放速率的力。出於這個原因,它應該只在模擬一次性影響時使用(否則使用“_force”函式)。
position 是在全域座標中距實體原點的偏移量。
void body_apply_torque(body: RID, torque: Vector3) 🔗
在不影響位置的情況下,施加一個旋轉力。力是時間相關的,這意味著每次物理更新都會施加。
void body_apply_torque_impulse(body: RID, impulse: Vector3) 🔗
在不影響位置的情況下,向實體施加一個旋轉脈衝。
脈衝是時間無關的!每影格施加一個脈衝將產生一個依賴於畫面播放速率的力。出於這個原因,它應該只在模擬一次性影響時使用(否則使用“_force”函式)。
void body_attach_object_instance_id(body: RID, id: int) 🔗
將區域分配給Object的子類別,因此它可以存在於節點樹中。
void body_clear_shapes(body: 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 to 1, and body mode set to BODY_MODE_RIGID.
Use body_add_shape() to add shapes to it, use body_set_state() to set its transform, and use body_set_space() to add the body to a space.
int body_get_collision_layer(body: RID) const 🔗
返回物體所屬的實體層或層。
int body_get_collision_mask(body: RID) const 🔗
返回物體可以碰撞的實體層或層。
float body_get_collision_priority(body: RID) const 🔗
返回該物體的碰撞優先順序。
Vector3 body_get_constant_force(body: RID) const 🔗
返回在每次物理更新期間,該物體被施加的總的恒定位置的力。
參閱 body_add_constant_force() 和 body_add_constant_central_force()。
Vector3 body_get_constant_torque(body: RID) const 🔗
返回在每次物理更新期間,該物體被施加的總的恒定旋轉的力。
參閱 body_add_constant_torque()。
PhysicsDirectBodyState3D body_get_direct_state(body: RID) 🔗
返回該物體的 PhysicsDirectBodyState3D。如果該物體已被銷毀或從物理空間中移除,則返回 null。
int body_get_max_contacts_reported(body: RID) const 🔗
返回可報告的最大接觸數。見 body_set_max_contacts_reported()。
BodyMode body_get_mode(body: RID) const 🔗
返回物體模式。
int body_get_object_instance_id(body: RID) const 🔗
獲取區域分配給的物件的實例 ID。
Variant body_get_param(body: RID, param: BodyParameter) const 🔗
返回物體參數的值。可用參數列表位於 BodyParameter 常數上。
RID body_get_shape(body: RID, shape_idx: int) const 🔗
返回物體的第 n 個碰撞形狀的 RID。
int body_get_shape_count(body: RID) const 🔗
返回分配給物體的碰撞形狀數量。
Transform3D body_get_shape_transform(body: RID, shape_idx: int) const 🔗
返回物體碰撞形狀的變換矩陣。
RID body_get_space(body: RID) const 🔗
返回分配給物體的空間的 RID。
Variant body_get_state(body: RID, state: BodyState) const 🔗
返回物體的狀態。
bool body_is_axis_locked(body: RID, axis: BodyAxis) const 🔗
There is currently no description for this method. Please help us by contributing one!
bool body_is_continuous_collision_detection_enabled(body: RID) const 🔗
如果為 true,則啟用連續碰撞偵測模式。
bool body_is_omitting_force_integration(body: RID) const 🔗
Returns true if the body is omitting the standard force integration. See body_set_omit_force_integration().
void body_remove_collision_exception(body: RID, excepted_body: RID) 🔗
從免於碰撞的實體列表中刪除實體。
連續碰撞偵測嘗試預測運動物體碰撞的位置,而不是在碰撞時移動物體並糾正其運動。
void body_remove_shape(body: RID, shape_idx: int) 🔗
從物體上移除一個碰撞形狀。碰撞形狀不會被從記憶體中刪除,所以它可以在之後被重複使用。
void body_reset_mass_properties(body: RID) 🔗
根據形狀恢復預設慣性和質心,以取消之前使用 body_set_param() 設定的任何自訂值。
void body_set_axis_lock(body: RID, axis: BodyAxis, lock: bool) 🔗
There is currently no description for this method. Please help us by contributing one!
void body_set_axis_velocity(body: RID, axis_velocity: Vector3) 🔗
設定軸速度。給定向量軸上的速度將被設定為給定向量長度。這對跳躍行為很有用。
void body_set_collision_layer(body: RID, layer: int) 🔗
設定物體所屬的實體層或層。
void body_set_collision_mask(body: RID, mask: int) 🔗
設定實體層或身體可以碰撞的層。
void body_set_collision_priority(body: RID, priority: float) 🔗
設定該物體的碰撞優先順序。
void body_set_constant_force(body: RID, force: Vector3) 🔗
設定該物體在每次物理更新時套用的總恒定位置力。
見 body_add_constant_force() 和 body_add_constant_central_force()。
void body_set_constant_torque(body: RID, torque: Vector3) 🔗
設定該物體在每次物理更新時套用的總恒定旋轉力。
void body_set_enable_continuous_collision_detection(body: RID, enable: bool) 🔗
如果為 true,則啟用連續碰撞偵測模式。
連續碰撞偵測嘗試預測運動物體碰撞的位置,而不是在碰撞時移動物體並糾正其運動。
void body_set_force_integration_callback(body: RID, callable: Callable, userdata: Variant = null) 🔗
Sets the body's custom force integration callback function to callable. Use an empty Callable (Callable()) to clear the custom callback.
The function callable will be called every physics tick, before the standard force integration (see body_set_omit_force_integration()). It can be used for example to update the body's linear and angular velocity based on contact with other bodies.
If userdata is not null, the function callable must take the following two parameters:
state: a PhysicsDirectBodyState3D, used to retrieve and modify the body's state,userdata: a Variant; its value will be theuserdatapassed into this method.
If userdata is null, then callable must take only the state parameter.
void body_set_max_contacts_reported(body: RID, amount: int) 🔗
設定要報告的最大接觸數。物體可以記錄與其他物體的接觸。將最大接觸數設定為大於 0 的數位可以啟用此功能。
void body_set_mode(body: RID, mode: BodyMode) 🔗
Sets the body mode.
void body_set_omit_force_integration(body: RID, enable: bool) 🔗
Sets whether the body omits the standard force integration. If enable is true, the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, body_set_force_integration_callback() can be used to manually update the linear and angular velocity instead.
This method is called when the property RigidBody3D.custom_integrator is set.
void body_set_param(body: RID, param: BodyParameter, value: Variant) 🔗
設定物體參數。可用參數列表位於 BodyParameter 常數上。
void body_set_ray_pickable(body: RID, enable: bool) 🔗
如果設定了 enable,則將該物體設定為可通過射線拾取。
void body_set_shape(body: RID, shape_idx: int, shape: RID) 🔗
用一個給定的物體形狀代替另一個。舊的形狀是通過其索引選擇的,新的是通過其 RID 選擇的。
void body_set_shape_disabled(body: RID, shape_idx: int, disabled: bool) 🔗
There is currently no description for this method. Please help us by contributing one!
void body_set_shape_transform(body: RID, shape_idx: int, transform: Transform3D) 🔗
設定物體形狀的變換矩陣。
void body_set_space(body: RID, space: RID) 🔗
給物體分配一個空間(見 space_create())。
void body_set_state(body: RID, state: BodyState, value: Variant) 🔗
Sets a body state.
void body_set_state_sync_callback(body: RID, callable: Callable) 🔗
Sets the body's state synchronization callback function to callable. Use an empty Callable (Callable()) to clear the callback.
The function callable will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server.
The function callable must take the following parameters:
state: a PhysicsDirectBodyState3D, used to retrieve the body's state.
bool body_test_motion(body: RID, parameters: PhysicsTestMotionParameters3D, result: PhysicsTestMotionResult3D = null) 🔗
如果從空間中的給定點沿著運動向量移動會導致碰撞,則返回 true。傳遞 PhysicsTestMotionParameters3D 可以設定運動參數。還可以傳遞 PhysicsTestMotionResult3D,從而返回其他資訊。
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
RID concave_polygon_shape_create() 🔗
There is currently no description for this method. Please help us by contributing one!
float cone_twist_joint_get_param(joint: RID, param: ConeTwistJointParam) const 🔗
Gets a cone twist joint parameter.
void cone_twist_joint_set_param(joint: RID, param: ConeTwistJointParam, value: float) 🔗
Sets a cone twist joint parameter.
RID convex_polygon_shape_create() 🔗
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
銷毀由 PhysicsServer3D 建立的任何物件。如果傳入的 RID 不是由 PhysicsServer3D 建立的對象,則會向控制台發送錯誤。
bool generic_6dof_joint_get_flag(joint: RID, axis: Axis, flag: G6DOFJointAxisFlag) const 🔗
Returns the value of a generic 6DOF joint flag.
float generic_6dof_joint_get_param(joint: RID, axis: Axis, param: G6DOFJointAxisParam) const 🔗
Returns the value of a generic 6DOF joint parameter.
void generic_6dof_joint_set_flag(joint: RID, axis: Axis, flag: G6DOFJointAxisFlag, enable: bool) 🔗
Sets the value of a given generic 6DOF joint flag.
void generic_6dof_joint_set_param(joint: RID, axis: Axis, param: G6DOFJointAxisParam, value: float) 🔗
Sets the value of a given generic 6DOF joint parameter.
int get_process_info(process_info: ProcessInfo) 🔗
Returns the value of a physics engine state specified by process_info.
RID heightmap_shape_create() 🔗
There is currently no description for this method. Please help us by contributing one!
bool hinge_joint_get_flag(joint: RID, flag: HingeJointFlag) const 🔗
Gets a hinge joint flag.
float hinge_joint_get_param(joint: RID, param: HingeJointParam) const 🔗
Gets a hinge joint parameter.
void hinge_joint_set_flag(joint: RID, flag: HingeJointFlag, enabled: bool) 🔗
Sets a hinge joint flag.
void hinge_joint_set_param(joint: RID, param: HingeJointParam, value: float) 🔗
Sets a hinge joint parameter.
void joint_clear(joint: RID) 🔗
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
void joint_disable_collisions_between_bodies(joint: RID, disable: bool) 🔗
設定附加至該 Joint3D 的物體能否互相碰撞。
int joint_get_solver_priority(joint: RID) const 🔗
獲取該 Joint3D 的優先順序。
JointType joint_get_type(joint: RID) const 🔗
返回該 Joint3D 的型別。
bool joint_is_disabled_collisions_between_bodies(joint: RID) const 🔗
返回附加至該 Joint3D 的物體能否互相碰撞。
void joint_make_cone_twist(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D) 🔗
There is currently no description for this method. Please help us by contributing one!
void joint_make_generic_6dof(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D) 🔗
Make the joint a generic six degrees of freedom (6DOF) joint. Use generic_6dof_joint_set_flag() and generic_6dof_joint_set_param() to set the joint's flags and parameters respectively.
void joint_make_hinge(joint: RID, body_A: RID, hinge_A: Transform3D, body_B: RID, hinge_B: Transform3D) 🔗
There is currently no description for this method. Please help us by contributing one!
void joint_make_pin(joint: RID, body_A: RID, local_A: Vector3, body_B: RID, local_B: Vector3) 🔗
There is currently no description for this method. Please help us by contributing one!
void joint_make_slider(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D) 🔗
There is currently no description for this method. Please help us by contributing one!
void joint_set_solver_priority(joint: RID, priority: int) 🔗
設定該 Joint3D 的優先順序。
Vector3 pin_joint_get_local_a(joint: RID) const 🔗
返回關節在關節物體 A 的局部空間中的位置。
Vector3 pin_joint_get_local_b(joint: RID) const 🔗
返回關節在關節物體 B 的局部空間中的位置。
float pin_joint_get_param(joint: RID, param: PinJointParam) const 🔗
Gets a pin joint parameter.
void pin_joint_set_local_a(joint: RID, local_A: Vector3) 🔗
設定關節在關節物體 A 的局部空間中的位置。
void pin_joint_set_local_b(joint: RID, local_B: Vector3) 🔗
設定關節在關節物體 B 的局部空間中的位置。
void pin_joint_set_param(joint: RID, param: PinJointParam, value: float) 🔗
Sets a pin joint parameter.
RID separation_ray_shape_create() 🔗
There is currently no description for this method. Please help us by contributing one!
void set_active(active: bool) 🔗
啟動或停用 3D 物理引擎。
Variant shape_get_data(shape: RID) const 🔗
返回形狀資料。
float shape_get_margin(shape: RID) const 🔗
Returns the collision margin for the shape.
Note: This is not used in Godot Physics, so will always return 0.
ShapeType shape_get_type(shape: RID) const 🔗
Returns the type of shape.
void shape_set_data(shape: RID, data: Variant) 🔗
設定定義形狀和大小的形狀資料。要傳遞的資料取決於建立的形狀的型別 shape_get_type()。
void shape_set_margin(shape: RID, margin: float) 🔗
Sets the collision margin for the shape.
Note: This is not used in Godot Physics.
float slider_joint_get_param(joint: RID, param: SliderJointParam) const 🔗
Gets a slider joint parameter.
void slider_joint_set_param(joint: RID, param: SliderJointParam, value: float) 🔗
Gets a slider joint parameter.
void soft_body_add_collision_exception(body: RID, body_b: RID) 🔗
Adds the given body to the list of bodies exempt from collisions.
void soft_body_apply_central_force(body: RID, force: Vector3) 🔗
Distributes and applies a force to all points. A force is time dependent and meant to be applied every physics update.
void soft_body_apply_central_impulse(body: RID, impulse: Vector3) 🔗
Distributes and applies an impulse to all points.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
void soft_body_apply_point_force(body: RID, point_index: int, force: Vector3) 🔗
Applies a force to a point. A force is time dependent and meant to be applied every physics update.
void soft_body_apply_point_impulse(body: RID, point_index: int, impulse: Vector3) 🔗
Applies an impulse to a point.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
Creates a new soft body and returns its internal RID.
AABB soft_body_get_bounds(body: RID) const 🔗
Returns the bounds of the given soft body in global coordinates.
int soft_body_get_collision_layer(body: RID) const 🔗
Returns the physics layer or layers that the given soft body belongs to.
int soft_body_get_collision_mask(body: RID) const 🔗
Returns the physics layer or layers that the given soft body can collide with.
float soft_body_get_damping_coefficient(body: RID) const 🔗
Returns the damping coefficient of the given soft body.
float soft_body_get_drag_coefficient(body: RID) const 🔗
Returns the drag coefficient of the given soft body.
float soft_body_get_linear_stiffness(body: RID) const 🔗
Returns the linear stiffness of the given soft body.
Vector3 soft_body_get_point_global_position(body: RID, point_index: int) const 🔗
Returns the current position of the given soft body point in global coordinates.
float soft_body_get_pressure_coefficient(body: RID) const 🔗
Returns the pressure coefficient of the given soft body.
float soft_body_get_shrinking_factor(body: RID) const 🔗
Returns the shrinking factor of the given soft body.
int soft_body_get_simulation_precision(body: RID) const 🔗
Returns the simulation precision of the given soft body.
RID soft_body_get_space(body: RID) const 🔗
Returns the RID of the space assigned to the given soft body.
Variant soft_body_get_state(body: RID, state: BodyState) const 🔗
Returns the given soft body state.
Note: Godot's default physics implementation does not support BODY_STATE_LINEAR_VELOCITY, BODY_STATE_ANGULAR_VELOCITY, BODY_STATE_SLEEPING, or BODY_STATE_CAN_SLEEP.
float soft_body_get_total_mass(body: RID) const 🔗
Returns the total mass assigned to the given soft body.
bool soft_body_is_point_pinned(body: RID, point_index: int) const 🔗
Returns whether the given soft body point is pinned.
void soft_body_move_point(body: RID, point_index: int, global_position: Vector3) 🔗
Moves the given soft body point to a position in global coordinates.
void soft_body_pin_point(body: RID, point_index: int, pin: bool) 🔗
Pins or unpins the given soft body point based on the value of pin.
Note: Pinning a point effectively makes it kinematic, preventing it from being affected by forces, but you can still move it using soft_body_move_point().
void soft_body_remove_all_pinned_points(body: RID) 🔗
Unpins all points of the given soft body.
void soft_body_remove_collision_exception(body: RID, body_b: RID) 🔗
Removes the given body from the list of bodies exempt from collisions.
void soft_body_set_collision_layer(body: RID, layer: int) 🔗
Sets the physics layer or layers the given soft body belongs to.
void soft_body_set_collision_mask(body: RID, mask: int) 🔗
Sets the physics layer or layers the given soft body can collide with.
void soft_body_set_damping_coefficient(body: RID, damping_coefficient: float) 🔗
Sets the damping coefficient of the given soft body. Higher values will slow down the body more noticeably when forces are applied.
void soft_body_set_drag_coefficient(body: RID, drag_coefficient: float) 🔗
Sets the drag coefficient of the given soft body. Higher values increase this body's air resistance.
Note: This value is currently unused by Godot's default physics implementation.
void soft_body_set_linear_stiffness(body: RID, stiffness: float) 🔗
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 and 1.0 (inclusive).
void soft_body_set_mesh(body: RID, mesh: RID) 🔗
Sets the mesh of the given soft body.
void soft_body_set_pressure_coefficient(body: RID, pressure_coefficient: float) 🔗
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.
void soft_body_set_ray_pickable(body: RID, enable: bool) 🔗
Sets whether the given soft body will be pickable when using object picking.
void soft_body_set_shrinking_factor(body: RID, shrinking_factor: float) 🔗
Sets the shrinking factor of the given soft body.
void soft_body_set_simulation_precision(body: RID, simulation_precision: int) 🔗
Sets the simulation precision of the given soft body. Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
void soft_body_set_space(body: RID, space: RID) 🔗
Assigns a space to the given soft body (see space_create()).
void soft_body_set_state(body: RID, state: BodyState, variant: Variant) 🔗
Sets the given body state for the given body.
Note: Godot's default physics implementation does not support BODY_STATE_LINEAR_VELOCITY, BODY_STATE_ANGULAR_VELOCITY, BODY_STATE_SLEEPING, or BODY_STATE_CAN_SLEEP.
void soft_body_set_total_mass(body: RID, total_mass: float) 🔗
Sets the total mass for the given soft body.
void soft_body_set_transform(body: RID, transform: Transform3D) 🔗
Sets the global transform of the given soft body.
void soft_body_update_rendering_server(body: RID, rendering_server_handler: PhysicsServer3DRenderingServerHandler) 🔗
Requests that the physics server updates the rendering server with the latest positions of the given soft body's points through the rendering_server_handler interface.
建立一個空間。空間是物理引擎的參數集合,可以分配給區域或主體。它可以通過 area_set_space() 分配給一個區域,或者通過 body_set_space() 分配給一個主體。
PhysicsDirectSpaceState3D space_get_direct_state(space: RID) 🔗
返回空間的狀態,即 PhysicsDirectSpaceState3D。該對象可用於進行碰撞/相交的查詢。
float space_get_param(space: RID, param: SpaceParameter) const 🔗
返回空間參數的值。
bool space_is_active(space: RID) const 🔗
返回該空間是否是活動的。
void space_set_active(space: RID, active: bool) 🔗
將空間標記為活動空間。它不會有效果,除非它被分配到一個區域或物體。
void space_set_param(space: RID, param: SpaceParameter, value: float) 🔗
設定空間參數的值。可用參數列表位於 SpaceParameter 常數上。
There is currently no description for this method. Please help us by contributing one!
RID world_boundary_shape_create() 🔗
There is currently no description for this method. Please help us by contributing one!