Files
godot-docs-l10n/classes/zh_CN/class_boxmesh.rst

126 lines
4.9 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/BoxMesh.xml.
.. _class_BoxMesh:
BoxMesh
=======
**继承:** :ref:`PrimitiveMesh<class_PrimitiveMesh>` **<** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
生成轴对齐盒 :ref:`PrimitiveMesh<class_PrimitiveMesh>`\ 。
.. rst-class:: classref-introduction-group
描述
----
生成轴对齐盒 :ref:`PrimitiveMesh<class_PrimitiveMesh>`\ 。
这个盒子的 UV 布局是以 3×2 的方式排列的,允许单独对每个面进行贴图。要在所有的面上应用相同的纹理,请将材质的 UV 属性改为 ``Vector3(3, 2, 1)``\ 。这样做等价于在顶点着色器中添加 ``UV *= vec2(3.0, 2.0)``\ 。
\ **注意:**\ 当使用很大且有纹理的 **BoxMesh** 时(例如作为地板),你可能会发现 UV 偶尔抖动的问题,这取决于相机的角度。要解决此问题,请增加 :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>`\ 、\ :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` 和 :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>`\ ,直到你不再注意到 UV 抖动。
.. rst-class:: classref-reftable-group
属性
----
.. table::
:widths: auto
+-------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_BoxMesh_property_size>` | ``Vector3(1, 1, 1)`` |
+-------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`int<class_int>` | :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>` | ``0`` |
+-------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`int<class_int>` | :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` | ``0`` |
+-------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`int<class_int>` | :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>` | ``0`` |
+-------------------------------+------------------------------------------------------------------+----------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
属性说明
--------
.. _class_BoxMesh_property_size:
.. rst-class:: classref-property
:ref:`Vector3<class_Vector3>` **size** = ``Vector3(1, 1, 1)``
.. rst-class:: classref-property-setget
- void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
该盒子的宽度、高度和深度。
.. rst-class:: classref-item-separator
----
.. _class_BoxMesh_property_subdivide_depth:
.. rst-class:: classref-property
:ref:`int<class_int>` **subdivide_depth** = ``0``
.. rst-class:: classref-property-setget
- void **set_subdivide_depth** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_subdivide_depth** **(** **)**
沿 Z 轴插入的额外边缘环的数量。
.. rst-class:: classref-item-separator
----
.. _class_BoxMesh_property_subdivide_height:
.. rst-class:: classref-property
:ref:`int<class_int>` **subdivide_height** = ``0``
.. rst-class:: classref-property-setget
- void **set_subdivide_height** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_subdivide_height** **(** **)**
沿 Y 轴插入的额外边缘环的数量。
.. rst-class:: classref-item-separator
----
.. _class_BoxMesh_property_subdivide_width:
.. rst-class:: classref-property
:ref:`int<class_int>` **subdivide_width** = ``0``
.. rst-class:: classref-property-setget
- void **set_subdivide_width** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_subdivide_width** **(** **)**
沿 X 轴插入的额外边缘环的数量。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |const| replace:: :abbr:`const (本方法没有副作用。不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,所以可以直接使用类名调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效操作符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列标志构成的位掩码整数。)`