public class Vector4 extends Object
| Modifier and Type | Field and Description |
|---|---|
float |
W
Public members
|
float |
X
Public members
|
float |
Y
Public members
|
float |
Z
Public members
|
| Constructor and Description |
|---|
Vector4()
Default constructor, sets x, y and z to 0
|
Vector4(float x,
float y,
float z,
float w)
Constructor with arguments
|
Vector4(Vector3 value,
float w) |
Vector4(Vector4 vector)
Constructor from another Vector4
|
| Modifier and Type | Method and Description |
|---|---|
static Vector4 |
cross(Vector4 v1,
Vector4 v2)
The cross product of two vectors FIXME
|
float |
distanceTo(Vector4 vectorTo)
Gets the distance to another Vector (as a point)
|
Vector4 |
divide(float scalar)
Returns the vector divided by the scalar
|
static float |
dot(Vector4 v1,
Vector4 v2)
The dot product of two vectors
|
boolean |
equals(Object obj) |
Vector4 |
getZero() |
int |
hashCode() |
Vector4 |
increment(Vector4 vector)
Increments this vector
|
float |
magnitude()
Gets the magnitude of a vector
|
float |
magnitudeSqr()
Gets the squared magnitude of the vector
|
Vector4 |
minus(Vector4 v1)
Subtracts one vector from another
|
Vector4 |
multiply(float scalar) |
Vector4 |
negate()
Gets the negated vector
|
Vector4 |
plus(Vector4 v1)
Adds two vectors
|
Vector4 |
scale(float scalar)
Returns the scaled vector
|
String |
toString() |
Vector4 |
unitVector()
Gets the unit (normalised) vector from this vector
|
public float X
public float Y
public float Z
public float W
public Vector4()
public Vector4(float x,
float y,
float z,
float w)
x - The x-coordinatey - The y-coordinatez - The z-coordinatepublic Vector4(Vector3 value, float w)
public Vector4(Vector4 vector)
vector - Another 3D Vectorpublic Vector4 getZero()
public static float dot(Vector4 v1, Vector4 v2)
v1 - The first vectorv2 - The second vectorpublic static Vector4 cross(Vector4 v1, Vector4 v2)
v1 - The first vectorv2 - The second vectorpublic float magnitude()
public float magnitudeSqr()
public Vector4 negate()
public Vector4 scale(float scalar)
scalar - the scalar to scale bypublic Vector4 increment(Vector4 vector)
vector - the vector to increment bypublic Vector4 multiply(float scalar)
Vector4.scale(float)public Vector4 divide(float scalar)
scalar - the scalar to divide bypublic Vector4 plus(Vector4 v1)
v1 - the other vectorpublic Vector4 minus(Vector4 v1)
v1 - vector to subtract from thispublic float distanceTo(Vector4 vectorTo)
vectorTo - the vector to measure topublic Vector4 unitVector()
Copyright (c) 2008-2025 Aspose Pty Ltd. All Rights Reserved.