From 1932fc31d2b6db2a15de956cb68148a3e3a0afb2 Mon Sep 17 00:00:00 2001 From: linyuzhe Date: Sun, 8 Jun 2025 09:41:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E5=90=91=E9=87=8F=E6=88=90=E5=91=98=E6=96=B9=E6=B3=95?= =?UTF-8?q?x=E3=80=81y=E3=80=81z?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + mcguide/20-玩法开发/10-基本概念/10-Vector3.md | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/.gitignore b/.gitignore index 5173a93..dba7df0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ package-lock.json package.json .DS_Store +.idea diff --git a/mcguide/20-玩法开发/10-基本概念/10-Vector3.md b/mcguide/20-玩法开发/10-基本概念/10-Vector3.md index c0329d0..210d16d 100644 --- a/mcguide/20-玩法开发/10-基本概念/10-Vector3.md +++ b/mcguide/20-玩法开发/10-基本概念/10-Vector3.md @@ -296,6 +296,72 @@ c = Vector3.Cross(a, b) ## 成员方法 +### x + +- 描述 + + 返回该向量的x坐标值。 + +- 返回值 + + | 数据类型 | 说明 | + | :------- | :-------------- | + | float | 该向量x的坐标值 | + +- 示例 + +```python +from common.utils.mcmath import Vector3 +a = Vector3(3.0, 4.0, 0.0) +print a.x # 打印 3.0 +``` + + + +### y + +- 描述 + + 返回该向量的y坐标值。 + +- 返回值 + + | 数据类型 | 说明 | + | :------- | :-------------- | + | float | 该向量y的坐标值 | + +- 示例 + +```python +from common.utils.mcmath import Vector3 +a = Vector3(3.0, 4.0, 0.0) +print a.y # 打印 4.0 +``` + + + +### z + +- 描述 + + 返回该向量的z坐标值。 + +- 返回值 + + | 数据类型 | 说明 | + | :------- | :-------------- | + | float | 该向量z的坐标值 | + +- 示例 + +```python +from common.utils.mcmath import Vector3 +a = Vector3(3.0, 4.0, 0.0) +print a.z # 打印 0.0 +``` + + + ### Length - 描述