Skip to main content

Vector3

Complete API reference for Vector3, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Vector

Component: no


public class Vector3

Constructors

SignatureDescription
Vector3(Vector3)Executes Vector3 and returns after the underlying engine call finishes.
Vector3()Executes Vector3 and returns after the underlying engine call finishes.
Vector3(float)Creates a new instance of Vector3.
Vector3(int)Creates a new instance of Vector3.
Vector3(float, float, float)Creates a new instance of Vector3.
Vector3(int, int, int)Creates a new instance of Vector3.
Vector3(float, float, int)Creates a new instance of Vector3.
Vector3(int, float, int)Creates a new instance of Vector3.
Vector3(int, float, float)Creates a new instance of Vector3.
Vector3(int, int, float)Creates a new instance of Vector3.

Attributes

NameTypeDescription
instanceVector3Represents the instance value stored on this instance. Read or assign to update the property.

Virtual Attributes

NameTypeAccessDescription
xfloatget/setReturns the X component of this Vector3.
yfloatget/setReturns the Y component of this Vector3.
zfloatget/setReturns the Z component of this Vector3.

Methods

SignatureReturnsDescription
getXY()Vector2Returns a Vector2 with the X and Y components of this Vector3.
getXZ()Vector2Returns a Vector2 with the X and Z components of this Vector3.
getYZ()Vector2Returns a Vector2 with the Y and Z components of this Vector3.
getYX()Vector2Returns a Vector2 with the Y and X components of this Vector3.
getZX()Vector2Returns a Vector2 with the Z and X components of this Vector3.
getZY()Vector2Returns a Vector2 with the Z and Y components of this Vector3.
setXY(Vector2)voidSets the X and Y components of this Vector3 with the values of the specified Vector2.
setXZ(Vector2)voidSets the X and Z components of this Vector3 with the values of the specified Vector2.
setYZ(Vector2)voidSets the Y and Z components of this Vector3 with the values of the specified Vector2.
setYX(Vector2)voidSets the Y and X components of this Vector3 with the values of the specified Vector2.
setZX(Vector2)voidSets the Z and X components of this Vector3 with the values of the specified Vector2.
setZY(Vector2)voidSets the Z and Y components of this Vector3 with the values of the specified Vector2.
setXY(float, float)voidSets the X and Y components of this Vector3.
setXZ(float, float)voidSets the X and Z components of this Vector3.
setYZ(float, float)voidSets the Y and Z components of this Vector3.
setYX(float, float)voidSets the Y and X components of this Vector3.
setZX(float, float)voidSets the Z and X components of this Vector3.
setZY(float, float)voidSets the Z and Y components of this Vector3.
sumX(float)voidAdds the specified value to the X component of this Vector3.
sumY(float)voidAdds the specified value to the Y component of this Vector3.
sumZ(float)voidAdds the specified value to the Z component of this Vector3.
subX(float)voidSubtracts the specified value from the X component of this Vector3.
subY(float)voidSubtracts the specified value from the Y component of this Vector3.
subZ(float)voidSubtracts the specified value from the Z component of this Vector3.
mulX(float)voidMultiplies the X component of this Vector3 by the specified value.
mulY(float)voidMultiplies the Y component of this Vector3 by the specified value.
mulZ(float)voidMultiplies the Z component of this Vector3 by the specified value.
divX(float)voidDivides the X component of this Vector3 by the specified value.
divY(float)voidDivides the Y component of this Vector3 by the specified value.
divZ(float)voidDivides the Z component of this Vector3 by the specified value.
mul(Vector3)Vector3Multiplies this Vector3 by the specified Vector3 and returns a new Vector3.
mul(float, float, float)Vector3Multiplies this Vector3 by the specified X, Y and Z values and returns a new Vector3.
mul(float)Vector3Multiplies this Vector3 by the specified value and returns a new Vector3.
mulLocal(Vector3)voidMultiplies this Vector3 by the specified Vector3 and updates this Vector3.
mulLocal(Vector2)voidMultiplies this Vector3 by the specified Vector2 and updates this Vector3.
mulLocal(float, float, float)voidMultiplies this Vector3 by the specified X, Y and Z values and updates this Vector3.
mulLocal(float)voidMultiplies this Vector3 by the specified value and updates this Vector3.
multiply(Vector3)Vector3Multiplies this Vector3 by the specified Vector3 and returns a new Vector3.
multiply(float, float, float)Vector3Multiplies this Vector3 by the specified X, Y and Z values and returns a new Vector3.
multiply(float)Vector3Multiplies this Vector3 by the specified value and returns a new Vector3.
div(Vector3)Vector3Divides this Vector3 by the specified Vector3 and returns a new Vector3.
div(float, float, float)Vector3Divides this Vector3 by the specified X, Y and Z values and returns a new Vector3.
div(float)Vector3Divides this Vector3 by the specified value and returns a new Vector3.
divLocal(Vector3)voidDivides this Vector3 by the specified Vector3 and updates this Vector3.
divLocal(Vector2)voidDivides this Vector3 by the specified Vector2 and updates this Vector3.
divLocal(float, float, float)voidDivides this Vector3 by the specified X, Y and Z values and updates this Vector3.
divLocal(float)voidDivides this Vector3 by the specified value and updates this Vector3.
divide(Vector3)Vector3Divides this Vector3 by the specified Vector3 and returns a new Vector3.
divide(float, float, float)Vector3Divides this Vector3 by the specified X, Y and Z values and returns a new Vector3.
divide(float)Vector3Divides this Vector3 by the specified value and returns a new Vector3.
sum(Vector3)Vector3Adds the specified Vector3 to this Vector3 and returns a new Vector3.
sum(float, float, float)Vector3Adds the specified X, Y and Z values to this Vector3 and returns a new Vector3.
sum(float)Vector3Adds the specified value to this Vector3 and returns a new Vector3.
sumLocal(Vector3)voidAdds the specified Vector3 to this Vector3 and updates this Vector3.
sumLocal(Vector2)voidAdds the specified Vector2 to this Vector3 and updates this Vector3.
sumLocal(float, float, float)voidAdds the specified X, Y and Z values to this Vector3 and updates this Vector3.
sumLocal(float)voidAdds the specified value to this Vector3 and updates this Vector3.
add(Vector3)Vector3Adds the specified Vector3 to this Vector3 and returns a new Vector3.
add(float, float, float)Vector3Adds the specified X, Y and Z values to this Vector3 and returns a new Vector3.
add(float)Vector3Adds the specified value to this Vector3 and returns a new Vector3.
sub(Vector3)Vector3Subtracts the specified Vector3 from this Vector3 and returns a new Vector3.
sub(float, float, float)Vector3Subtracts the specified X, Y and Z values from this Vector3 and returns a new Vector3.
sub(float)Vector3Subtracts the specified value from this Vector3 and returns a new Vector3.
subLocal(Vector3)voidSubtracts the specified Vector3 from this Vector3 and updates this Vector3.
subLocal(Vector2)voidSubtracts the specified Vector2 from this Vector3 and updates this Vector3.
subLocal(float, float, float)voidSubtracts the specified X, Y and Z values from this Vector3 and updates this Vector3.
subLocal(float)voidSubtracts the specified value from this Vector3 and updates this Vector3.
subtract(Vector3)Vector3Subtracts the specified Vector3 from this Vector3 and returns a new Vector3.
subtract(float, float, float)Vector3Subtracts the specified X, Y and Z values from this Vector3 and returns a new Vector3.
subtract(float)Vector3Subtracts the specified value from this Vector3 and returns a new Vector3.
equals(Vector3)booleanChecks if this Vector3 is equal to the specified Vector3.
equals(float, float, float)booleanChecks if this Vector3 is equal to the specified X, Y and Z values.
equals(float)booleanChecks if all components of this Vector3 are equal to the specified value.
set(Vector3)voidSets the components of this Vector3 to the specified Vector3.
set(float, float, float)voidSets the components of this Vector3 to the specified X, Y and Z values.
set(float)voidSets all components of this Vector3 to the specified value.
lerp(Vector3, float)voidInterpolates/smoothes between this Vector3 and the specified Vector3 based on the provided speed/interval and updates this Vector3.
lerp(float, float, float, float)voidInterpolates/smoothes between this Vector3 and the specified X, Y and Z values based on the provided speed/interval and updates this Vector3.
lerp(float, float)voidInterpolates/smoothes between this Vector3 and the specified value based on the provided speed/interval and updates this Vector3.
lerpInSeconds(Vector3, float)voidInterpolates/smoothes between this Vector3 and the specified Vector3 based on the provided speed/interval in one second and updates this Vector3.
lerpInSeconds(float, float, float, float)voidInterpolates/smoothes between this Vector3 and the specified X, Y and Z values based on the provided speed/interval in one second and updates this Vector3.
lerpInSeconds(float, float)voidInterpolates/smoothes between this Vector3 and the specified value based on the provided speed/interval in one second and updates this Vector3.
blend(Vector3, float)Vector3Blends between this Vector3 and the specified Vector3 based on the provided blend factor (0 to 1) and updates this Vector3.
blend(float, float, float, float)Vector3Blends between this Vector3 and the specified X, Y and Z values based on the provided blend factor (0 to 1) and updates this Vector3.
blend(float, float)Vector3Blends between this Vector3 and the specified value based on the provided blend factor (0 to 1) and updates this Vector3.
blendLocal(Vector3, float)voidBlends between this Vector3 and the specified Vector3 based on the provided blend factor (0 to 1) and updates this Vector3.
blendLocal(float, float, float, float)voidBlends between this Vector3 and the specified X, Y and Z values based on the provided blend factor (0 to 1) and updates this Vector3.
blendLocal(float, float)voidBlends between this Vector3 and the specified value based on the provided blend factor (0 to 1) and updates this Vector3.
normalize()Vector3Returns a normalized copy of this Vector3 (length equals 1).
normalizeLocal()voidNormalizes this Vector3 (sets its length to 1).
length()floatReturns the length (magnitude) of this Vector3.
sqrLength()floatReturns the squared length of this Vector3. Faster than length() as it doesn't use a square root; useful for comparing distances.
magnitude()floatReturns the magnitude of this Vector3.
sqrMagnitude()floatReturns the squared magnitude of this Vector3. Faster than magnitude() as it doesn't use a square root; useful for comparing distances.
rotate(float, float, float)Vector3Rotates this Vector3 by the specified angles (in degrees) and returns the resulting Vector3.
rotate(Vector3)Vector3Rotates this Vector3 by the specified rotation Vector3 (in degrees) and returns the resulting Vector3.
rotate(Quaternion)Vector3Rotates this Vector3 by the specified Quaternion rotation and returns the resulting Vector3.
rotateAroundPivot(float, float, float, Vector3)Vector3Rotates this Vector3 around the specified pivot point using the given rotation angles (in degrees) and returns the resulting Vector3.
rotateAroundPivot(Vector3, Vector3)Vector3Rotates this Vector3 around the specified pivot point using the given rotation Vector3 (in degrees) and returns the resulting Vector3.
rotateAroundPivot(Quaternion, Vector3)Vector3Rotates this Vector3 around the specified pivot point using the given Quaternion rotation and returns the resulting Vector3.
distance(Vector3)floatReturns the distance between this Vector3 and the specified Vector3.
sqrDistance(Vector3)floatReturns the squared distance between this Vector3 and the specified Vector3. Faster than distance() as it doesn't use a square root; useful for comparing distances.
dot(Vector3)floatReturns the dot product of this Vector3 and the specified Vector3.
dot(float, float, float)floatReturns the dot product of this Vector3 and the specified X, Y and Z values.
dot(float)floatReturns the dot product of this Vector3 and the specified value, used for all components.
cross(Vector3)Vector3Returns the cross product of this Vector3 and the specified Vector3.
cross(float, float, float)Vector3Returns the cross product of this Vector3 and the specified X, Y and Z values.
copy()Vector3Returns a copy of this Vector3.
toString()StringReturns a String representation of this Vector3.
toString(int)StringReturns a String representation of this Vector3 with the specified number of decimal places.
equals(Object)booleanChecks if this Vector3 is equal to the specified object.
pointerEquals(Object)booleanChecks if this Vector3 is the same instance as the specified object.
notEquals(Object)booleanChecks if this Vector3 is not equal to the specified object.
greaterThan(Object)booleanChecks if this Vector3 is greater than the specified object (by magnitude).
greaterThan(float)booleanChecks if this Vector3 is greater than the specified value (by magnitude).
greaterThan(int)booleanChecks if this Vector3 is greater than the specified value (by magnitude).
greaterThan(long)booleanChecks if this Vector3 is greater than the specified value (by magnitude).
greaterThan(double)booleanChecks if this Vector3 is greater than the specified value (by magnitude).
greaterOrEqualsThan(Object)booleanChecks if this Vector3 is greater than or equal to the specified object (by magnitude).
greaterOrEqualsThan(float)booleanChecks if this Vector3 is greater than or equal to the specified value (by magnitude).
greaterOrEqualsThan(int)booleanChecks if this Vector3 is greater than or equal to the specified value (by magnitude).
greaterOrEqualsThan(long)booleanChecks if this Vector3 is greater than or equal to the specified value (by magnitude).
greaterOrEqualsThan(double)booleanChecks if this Vector3 is greater than or equal to the specified value (by magnitude).
lessThan(Object)booleanChecks if this Vector3 is less than the specified object (by magnitude).
lessThan(float)booleanChecks if this Vector3 is less than the specified value (by magnitude).
lessThan(int)booleanChecks if this Vector3 is less than the specified value (by magnitude).
lessThan(long)booleanChecks if this Vector3 is less than the specified value (by magnitude).
lessThan(double)booleanChecks if this Vector3 is less than the specified value (by magnitude).
lessOrEqualsThan(Object)booleanChecks if this Vector3 is less than or equal to the specified object (by magnitude).
lessOrEqualsThan(float)booleanChecks if this Vector3 is less than or equal to the specified value (by magnitude).
lessOrEqualsThan(int)booleanChecks if this Vector3 is less than or equal to the specified value (by magnitude).
lessOrEqualsThan(long)booleanChecks if this Vector3 is less than or equal to the specified value (by magnitude).
lessOrEqualsThan(double)booleanChecks if this Vector3 is less than or equal to the specified value (by magnitude).
sum(Object)TReturns the sum of this Vector3 and the specified object.
sumEqual(Object)voidSums the specified object to this Vector3.
div(Object)TReturns the division of this Vector3 by the specified object.
divEqual(Object)voidDivides this Vector3 by the specified object.
mul(Object)TReturns the multiplication of this Vector3 by the specified object.
mulEqual(Object)voidMultiplies this Vector3 by the specified object.
sub(Object)TReturns the subtraction of this Vector3 and the specified object.
subEqual(Object)voidSubtracts the specified object from this Vector3.
addAdd()voidIncrements this Vector3 by 1.
removeRemove()voidDecrements this Vector3 by 1.
serializeToString()StringReturns a String representation of this Vector3 in the format '[X;Y;Z]'.
deserializeLocal(String)voidDeserializes a String in the format '[X;Y;Z]' and sets the values to this Vector3.

Static Methods

SignatureReturnsDescription
genericInterface()GenericClassInspectorEntryExecutes genericInterface and returns after the underlying engine call finishes.
inspectorController()ClassInspectorEntryExecutes inspectorController and returns after the underlying engine call finishes.
zero()Vector3Returns a Vector3 with all components set to zero (0, 0, 0).
one()Vector3Returns a Vector3 with all components set to one (1, 1, 1).
smoothDamp(Vector3, Vector3, Vector3, float, float, float)Vector3Smoothly moves the current vector towards the target vector with smoothing control, maximum speed, in the defined interval.
smoothDamp(Vector3, Vector3, Vector3, float, float, float, Vector3)Vector3Smoothly moves the current vector towards the target vector with smoothing control, maximum speed, in the defined interval and stores the result in the specified vector.
reflect(Vector3, Vector3)Vector3Reflects direction vector off a plane defined by the normal.
reflect(Vector3, Vector3, Vector3)Vector3Reflects direction vector off a plane defined by the normal and stores the result in the specified vector.
angle(Vector3, Vector3)floatReturns the angle in degrees between the two specified vectors.
triangleNormal(Vector3, Vector3, Vector3)Vector3Calculates the normal of the triangle defined by the three specified vertices.
triangleNormal(Vector3, Vector3, Vector3, Vector3)Vector3Calculates the normal of the triangle defined by the three specified vertices and stores the result in the specified vector.
Max(Vector3, Vector3)Vector3Returns a new Vector3 with the largest component values from the two given vectors.
Min(Vector3, Vector3)Vector3Returns a new Vector3 with the smallest component values from the two given vectors.
Negate(Vector3)Vector3Returns a Vector3 pointing upwards (0, 1, 0).
down()Vector3Returns a Vector3 pointing downwards (0, -1, 0).
back()Vector3Returns a Vector3 pointing backwards (0, 0, -1).
forward()Vector3Returns a Vector3 pointing forwards (0, 0, 1).
left()Vector3Returns a Vector3 pointing to the left (-1, 0, 0).
right()Vector3Returns a Vector3 pointing to the right (1, 0, 0).
isNull(Object)booleanChecks if the specified object is null.