Class Info |
|---|
public class Vector3 implements Parcelable 三维向量。 |
Qualifier and Type | Field and Description |
|---|---|
static final Vector3 | 三维向量Vector3(0, 0, 1)。 |
static final Vector3 | 三维向量Vector3(0, -1, 0)。 |
static final Vector3 | 三维向量Vector3(0, 0, -1)。 |
static final Vector3 | 三维向量Vector3(-1, 0, 0)。 |
static final Vector3 | 三维向量Vector3(1, 1, 1)。 |
static final Vector3 | 三维向量Vector3(1, 0, 0)。 |
static final Vector3 | 三维向量Vector3(0, 1, 0)。 |
static final Vector3 | 0向量。 |
float | 三维向量的X值。 |
float | 三维向量的Y值。 |
float | 三维向量的Z值。 |
Qualifier and Type | Method Name and Description |
|---|---|
static Vector3 | 三维向量加法。 |
static float | angleBetween(Vector3 lhs, Vector3 rhs) 获取两个三维向量的夹角。 |
static Vector3 | cross(Vector3 lhs, Vector3 rhs) 三维向量叉乘。 |
static float | 三维向量点乘。 |
float | length() 获取三维向量的模长。 |
| 获取当前向量的归一化向量。 | |
static Vector3 | subtract(Vector3 lhs, Vector3 rhs) 三维向量减法。 |
Constructor |
|---|
public Vector3(float x, float y, float z) 使用X、Y、Z值进行初始化。 |
Parameters
Name | Description |
|---|---|
x | 三维向量的X值。 |
y | 三维向量的Y值。 |
z | 三维向量的Z值。 |
Constructor |
|---|
public Vector3(Vector3 other) 使用其他三维向量初始化。 |
Parameters
Name | Description |
|---|---|
other | 三维向量。 |
Parameters
Name | Description |
|---|---|
lhs | 三维向量。 |
rhs | 三维向量。 |
Returns
Type | Description |
|---|---|
float | 两个三维向量的夹角,单位弧度。 |