Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
ConcavePolygonShape3D
繼承: Shape3D < Resource < RefCounted < Object
用於物理碰撞的 3D 三角網格形狀。
說明
A 3D trimesh shape, intended for use in physics. Usually used to provide a shape for a CollisionShape3D.
Being just a collection of interconnected triangles, ConcavePolygonShape3D is the most freely configurable single 3D shape. It can be used to form polyhedra of any nature, or even shapes that don't enclose a volume. However, ConcavePolygonShape3D is hollow even if the interconnected triangles do enclose a volume, which often makes it unsuitable for physics or detection.
Note: When used for collision, ConcavePolygonShape3D is intended to work with static CollisionShape3D nodes like StaticBody3D and will likely not behave well for CharacterBody3Ds or RigidBody3Ds in a mode other than Static.
Warning: Physics bodies that are small have a chance to clip through this shape when moving fast. This happens because on one frame, the physics body may be on the "outside" of the shape, and on the next frame it may be "inside" it. ConcavePolygonShape3D is hollow, so it won't detect a collision.
Performance: Due to its complexity, ConcavePolygonShape3D is the slowest 3D collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, ConvexPolygonShape3D should be used. For dynamic physics bodies that need concave collision, several ConvexPolygonShape3Ds can be used to represent its collision by using convex decomposition; see ConvexPolygonShape3D's documentation for instructions.
教學
屬性
|
方法
get_faces() const |
|
void |
set_faces(faces: PackedVector3Array) |
屬性說明
bool backface_collision = false 🔗
如果設定為 true,則碰撞會發生在凹形面的兩側。否則,它們只會沿著面法線發生。
方法說明
PackedVector3Array get_faces() const 🔗
以頂點陣列的形式返回三角網格形狀中的面。該(長度能被三整除的)陣列自然三三分組;每組中的三個頂點定義一個三角形。
void set_faces(faces: PackedVector3Array) 🔗
根據頂點陣列設定三角網格形狀的面。faces 陣列應更多由若干三元組構成,每三個頂點定義一個三角形。