可选
arg: never可选
arg2: neverAssigns the values of the passed in vector to this vector. Returns itself.
将传入向量的值赋给此向量。返回自身。
cross
Computes the cross product of this and the passed in vector, returning itself.
计算此向量与传入向量的叉积,返回自身。
dot
Computes the dot product of this and the passed in vector.
计算此向量与传入向量的点积。
floor
Floor the components of a vector to produce a new vector
对向量的各个分量向下取整,生成新的向量。
lerp
Constructs a new vector using linear interpolation on each component from two vectors.
使用在两个向量的每个分量上的线性插值构造新的向量。
magnitude
The magnitude of the vector
返回向量的模长。
multiply
Element-wise multiplication of two vectors together. Not to be confused with Vector3Builder.dot product or Vector3Builder.cross product
normalize
Normalizes this vector, returning itself.
归一化此向量,返回自身。
rotateX
Rotates the vector around the x axis counterclockwise (left hand rule)
Angle in radians
rotateY
Rotates the vector around the y axis counterclockwise (left hand rule)
Angle in radians
rotateZ
Rotates the vector around the z axis counterclockwise (left hand rule)
Angle in radians
scale
Scales this by the passed in value, returning itself.
使用传入的值数乘此向量,返回自身。
slerp
Constructs a new vector using spherical linear interpolation on each component from two vectors.
使用在两个向量的每个分量上的球面线性插值构造新的向量。
toString
Create a string representation of a vector
以指定的格式返回向量的字符串表示。
可选
options: { decimals?: number; delimiter?: string }
Vector3 wrapper class which can be used as a Vector3 for APIs on @minecraft/server which require a Vector, but also contain additional helper methods. This is an alternative to using the core Vector 3 utility methods directly, for those who prefer a more object-oriented approach. This version of the class is mutable and changes state inline.
For an immutable version of the build, use ImmutableVector3Builder.
用于 @minecraft/server 中需要用到三维向量的 API 的 Vector3 包装类,同时也包含额外的帮助方法。 这是对直接使用核心 Vector 3 实用方法的一种替代,适用于偏好面向对象方法的人。 此类的该版本是可变的,并且在内联中会更改状态。
若要使用构建的不可变版本,请使用 ImmutableVector3Builder。