com.supermap.ar.areffect
Class Vector
- java.lang.Object
-
- com.supermap.ar.areffect.Vector
-
public class Vector extends java.lang.Object
AR vector. It is used for determining the rotation axis The direction of each vector is from the origin of coordinates to the specific point
-
-
Constructor Summary
Constructors Constructor and Description Vector(float x, float y, float z)
Constructs an AR vector
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static Vector
add(Vector lhs, Vector rhs)
Adds two Vector3'sstatic Vector
cross(Vector lhs, Vector rhs)
Get cross product of two Vector3'sstatic float
dot(Vector lhs, Vector rhs)
Get dot product of two Vector3'sfloat
getX()
Gets the x coordinatefloat
getY()
Gets the y coordinatefloat
getZ()
Gets the z coordinatefloat
length()
float
lengthSquared()
Vector
negated()
Negates a Vector3Vector
scaled(float a)
Uniformly scales a Vector3void
setX(float x)
Sets the x coordinatevoid
setY(float y)
Sets the y coordinatevoid
setZ(float z)
Sets the z coordinatestatic Vector
subtract(Vector lhs, Vector rhs)
Subtract two Vector3
-
-
-
Constructor Detail
-
Vector
public Vector(float x, float y, float z)
Constructs an AR vector- Parameters:
x
-y
-z
-
-
-
Method Detail
-
setX
public void setX(float x)
Sets the x coordinate- Parameters:
x
-
-
getX
public float getX()
Gets the x coordinate- Returns:
-
setY
public void setY(float y)
Sets the y coordinate- Parameters:
y
-
-
getY
public float getY()
Gets the y coordinate- Returns:
-
getZ
public float getZ()
Gets the z coordinate- Returns:
-
setZ
public void setZ(float z)
Sets the z coordinate- Parameters:
z
-
-
scaled
public Vector scaled(float a)
Uniformly scales a Vector3- Returns:
- a Vector3 multiplied by a scalar amount
-
negated
public Vector negated()
Negates a Vector3- Returns:
- A Vector3 with opposite direction
-
add
public static Vector add(Vector lhs, Vector rhs)
Adds two Vector3's- Returns:
- The combined Vector3
-
subtract
public static Vector subtract(Vector lhs, Vector rhs)
Subtract two Vector3- Returns:
- The combined Vector3
-
dot
public static float dot(Vector lhs, Vector rhs)
Get dot product of two Vector3's- Returns:
- The scalar product of the Vector3's
-
cross
public static Vector cross(Vector lhs, Vector rhs)
Get cross product of two Vector3's- Returns:
- A Vector3 perpendicular to Vector3's
-
length
public float length()
- Returns:
-
lengthSquared
public float lengthSquared()
- Returns:
-
-