Package net.risingworld.api.utils
Klasse Utils.VectorUtils
java.lang.Object
net.risingworld.api.utils.Utils.VectorUtils
- Umschließende Klasse:
Utils
Vector functions.
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Vector3f
getAlignedDirection
(Vector3f direction, Vector3f normal) Gets a direction vector aligned to a normal.static Vector3f
getAlignedDirection
(Vector3f direction, Vector3f normal, Vector3f storeTo) static Vector3f
getDirection
(Vector3f from, Vector3f to) Gets the direction between two points (from -> to) as a normalized vector (unit vector, i.e length == 1).static Vector3f
getDirection
(Vector3f from, Vector3f to, Vector3f storeTo) Gets the direction between two points (from -> to) as a normalized vector (unit vector, i.e length == 1).static Vector3f
getXYZInFrontOfPlayer
(Player player, float distance) Gets the position in front of the player (with the given distance to the player).static Vector3f
getXYZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo) Gets the position in front of the player (with the given distance to the player).static Vector3f
getXZInFrontOfPlayer
(Player player, float distance) static Vector3f
getXZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo)
-
Konstruktordetails
-
VectorUtils
public VectorUtils()
-
-
Methodendetails
-
getXZInFrontOfPlayer
-
getXZInFrontOfPlayer
-
getXYZInFrontOfPlayer
Gets the position in front of the player (with the given distance to the player). This function takes the full player view direction into account, i.e. if the player looks up in the sky, the resulting position is above the player.- Parameter:
player
- the player.distance
- the desired distance between the player and the resulting position.- Gibt zurück:
- a new vector representing the position in front of the player.
- Siehe auch:
-
getXYZInFrontOfPlayer
Gets the position in front of the player (with the given distance to the player). This function takes the full player view direction into account, i.e. if the player looks up in the sky, the resulting position is above the player.- Parameter:
player
- the player.distance
- the desired distance between the player and the resulting position.storeTo
- the vector you want to store the result in. If null is provided, a new vector will be created.- Gibt zurück:
- the position in front of the player.
- Siehe auch:
-
getDirection
Gets the direction between two points (from -> to) as a normalized vector (unit vector, i.e length == 1).- Parameter:
from
- the start position.to
- the end position.- Gibt zurück:
- a new unit vector representing the direction between position "from" and position "to"
-
getDirection
Gets the direction between two points (from -> to) as a normalized vector (unit vector, i.e length == 1).- Parameter:
from
- the start position.to
- the end position.storeTo
- the vector you want to store the resulting direction in. If null is provided, a new vector will be created.- Gibt zurück:
- a unit vector representing the direction between position "from" and position "to"
-
getAlignedDirection
Gets a direction vector aligned to a normal.- Parameter:
direction
- the original direction (as unit vector).normal
- the normal (as unit vector) you want to align the direction to.- Gibt zurück:
- a unit vector representing the new direction, based on the original direction and the provided normal.
- Example: Get rotation based on a direction and ground normal
-
getAlignedDirection
-