目录

Vector4

Class Info

public class Vector4 implements Parcelable

四维向量。

Public Field Summary

Qualifier and Type

Field and Description

static final Vector4

ONE

四维向量Vector4(1, 1, 1, 1)。

static final Vector4

ZERO

0向量。

float

w

四维向量的W值。

float

x

四维向量的X值。

float

y

四维向量的Y值。

float

z

四维向量的Z值。

Public Constructor Summary

Constructor Name

Vector4(float x, float y, float z, float w)

构造方法,使用X、Y、Z、W值进行初始化Vector4。

Vector4(Vector4 other)

构造方法,使用其他四维向量初始化Vector4。

Public Method Summary

Qualifier and Type

Method Name and Description

static Vector4

add(Vector4 lhs, Vector4 rhs)

四维向量加法。

static float

dot(Vector4 lhs, Vector4 rhs)

四维向量点乘。

float

length()

获取四维向量的模长。

static Vector4

subtract(Vector4 lhs, Vector4 rhs)

四维向量减法。

Public Fields

[h2]ONE

Property

public static final Vector4 ONE

四维向量Vector4(1, 1, 1, 1)。

[h2]ZERO

Property

public static final Vector4 ZERO

0向量。

[h2]w

Property

public float w

四维向量的W值。

[h2]x

Property

public float x

四维向量的X值。

[h2]y

Property

public float y

四维向量的Y值。

[h2]z

Property

public float z

四维向量的Z值。

Public Constructors

[h2]Vector4(float x, float y, float z, float w)

Constructor

public Vector4(float x, float y, float z, float w)

使用X,Y,Z,W值进行初始化。

Parameters

Name

Description

x

四维向量的X值。

y

四维向量的Y值。

z

四维向量的Z值。

w

四维向量的W值。

[h2]Vector4(Vector4 other)

Constructor

public Vector4(Vector4 other)

使用其他四维向量初始化。

Parameters

Name

Description

other

四维向量。

Public Methods

[h2]add

Method

public static Vector4 add(Vector4 lhs, Vector4 rhs)

四维向量加法。

Parameters

Name

Description

lhs

四维向量。

rhs

四维向量。

Returns

Type

Description

Vector4

两个四维向量的和。

[h2]dot

Method

public static float dot(Vector4 lhs, Vector4 rhs)

四维向量点乘。

Parameters

Name

Description

lhs

四维向量。

rhs

四维向量。

Returns

Type

Description

float

两个四维向量的点积。

[h2]length

Method

public float length()

获取四维向量的模长。

Returns

Type

Description

float

四维向量的模长。

[h2]subtract

Method

public static Vector4 subtract(Vector4 lhs, Vector4 rhs)

四维向量减法。

Parameters

Name

Description

lhs

四维向量被减数。

rhs

四维向量减数。

Returns

Type

Description

Vector4

两个四维向量的差。