Class MultipartBalloonNodeVector
java.lang.Object
net.jeqo.bloons.balloon.multipart.nodes.MultipartBalloonNodeVector
- All Implemented Interfaces:
Serializable
A custom vector to store the axis of a balloon node
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a blank model node vector.MultipartBalloonNodeVector
(float x, float y, float z) Creates a segment vector holding a 3D space. -
Method Summary
Modifier and TypeMethodDescriptionstatic MultipartBalloonNodeVector
Creates a new segment vector derived from 2 segment vectors added together.static MultipartBalloonNodeVector
add
(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2, MultipartBalloonNodeVector target) Adds two segment vectors together and sets it to target if provided.copy()
Copies a segment vector.float
heading()
Gets the heading of a segment.void
set
(float x, float z) Sets a 2D's vectors axis.void
set
(float x, float y, float z) Sets a 3D's vectors axis.static MultipartBalloonNodeVector
Subtracts two segment vectors from each other.static MultipartBalloonNodeVector
subtract
(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2, MultipartBalloonNodeVector target) Subtracts two vectors from each other and sets it to a target is provided.
-
Field Details
-
x
public float xModel node vector axis. -
y
public float y -
z
public float z
-
-
Constructor Details
-
MultipartBalloonNodeVector
public MultipartBalloonNodeVector()Creates a blank model node vector. -
MultipartBalloonNodeVector
public MultipartBalloonNodeVector(float x, float y, float z) Creates a segment vector holding a 3D space.- Parameters:
x
- X axis.y
- Y axis.z
- Z axis.
-
-
Method Details
-
set
public void set(float x, float y, float z) Sets a 3D's vectors axis.- Parameters:
x
- X axis float.y
- Y axis float.z
- Z axis float.
-
set
public void set(float x, float z) Sets a 2D's vectors axis.- Parameters:
x
- X axis float.z
- Z axis float.
-
copy
Copies a segment vector.- Returns:
- The copy of the vector.
-
add
public static MultipartBalloonNodeVector add(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2) Creates a new segment vector derived from 2 segment vectors added together.- Parameters:
v1
- Segment vector 1.v2
- Segment vector 2.- Returns:
- The combined segment vector.
-
add
public static MultipartBalloonNodeVector add(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2, MultipartBalloonNodeVector target) Adds two segment vectors together and sets it to target if provided.- Parameters:
v1
- Segment vector 1.v2
- Segment vector 2.target
- Target vector.- Returns:
- The combined vectors.
-
subtract
public static MultipartBalloonNodeVector subtract(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2) Subtracts two segment vectors from each other.- Parameters:
v1
- Segment vector 1.v2
- Segment vector 2.- Returns:
- The result of the two subtracted vectors.
-
subtract
public static MultipartBalloonNodeVector subtract(MultipartBalloonNodeVector v1, MultipartBalloonNodeVector v2, MultipartBalloonNodeVector target) Subtracts two vectors from each other and sets it to a target is provided.- Parameters:
v1
- Segment vector 1.v2
- Segment vector 2.target
- Target vector.- Returns:
- The result of the subtraction.
-
heading
public float heading()Gets the heading of a segment.- Returns:
- The heading of the segment.
-