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

123 lines
5.0 KiB
ReStructuredText
Raw Permalink 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
.. _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)`` :ref:`🔗<class_BoxMesh_property_size>`
.. rst-class:: classref-property-setget
- |void| **set_size**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
- :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`` :ref:`🔗<class_BoxMesh_property_subdivide_depth>`
.. rst-class:: classref-property-setget
- |void| **set_subdivide_depth**\ (\ value\: :ref:`int<class_int>`\ )
- :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`` :ref:`🔗<class_BoxMesh_property_subdivide_height>`
.. rst-class:: classref-property-setget
- |void| **set_subdivide_height**\ (\ value\: :ref:`int<class_int>`\ )
- :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`` :ref:`🔗<class_BoxMesh_property_subdivide_width>`
.. rst-class:: classref-property-setget
- |void| **set_subdivide_width**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_subdivide_width**\ (\ )
沿 X 轴插入的额外边缘环的数量。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`