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.

PlaneMesh

繼承: PrimitiveMesh < Mesh < Resource < RefCounted < Object

被繼承: QuadMesh

表示平面 PrimitiveMesh 的類。

說明

代表平面 PrimitiveMesh 的類。這個扁平的網格沒有厚度。預設情況下,這個網格與 X 和 Z 軸對齊;這樣的旋轉並不適用於公告板材質。對於公告板材質,請將 orientation 改為 FACE_Z

注意:使用較大且有紋理的 PlaneMesh(例如地板)時,你可能在使用某些相機角度時會遇到 UV 抖動的問題。要解決這個問題,請增大 subdivide_depthsubdivide_width,直到無法再察覺到 UV 抖動。

屬性

Vector3

center_offset

Vector3(0, 0, 0)

Orientation

orientation

1

Vector2

size

Vector2(2, 2)

int

subdivide_depth

0

int

subdivide_width

0


列舉

enum Orientation: 🔗

Orientation FACE_X = 0

PlaneMesh 將面向 X 軸正方向。

Orientation FACE_Y = 1

PlaneMesh 將面向 Y 軸正方向。與 Godot 3.x 中 PlaneMesh 的行為一致。

Orientation FACE_Z = 2

PlaneMesh 將面向 Z 軸正方向。與 Godot 3.x 中 QuadMesh 的行為一致。


屬性說明

Vector3 center_offset = Vector3(0, 0, 0) 🔗

生成平面的偏移量。可用於粒子。


Orientation orientation = 1 🔗

Direction that the PlaneMesh is facing.


Vector2 size = Vector2(2, 2) 🔗

生成平面的大小。


int subdivide_depth = 0 🔗

  • void set_subdivide_depth(value: int)

  • int get_subdivide_depth()

沿 Z 軸細分的次數。


int subdivide_width = 0 🔗

  • void set_subdivide_width(value: int)

  • int get_subdivide_width()

沿 X 軸細分的次數。