Uses of Class
net.risingworld.api.utils.Vector3f
Package
Description
-
Uses of Vector3f in net.risingworld.api
Modifier and TypeMethodDescriptionstatic Vector3f
Server.getDefaultSpawnPosition()
Gets the global default spawn position.Modifier and TypeMethodDescriptionstatic ConstructionElement
World.createConstructionElement
(int shape, int texture, float textureScale, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale) Spawns a new construction element (i.e a block) at a given position.static ConstructionElement
World.createConstructionElement
(int shape, int texture, float textureScale, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale, Vector3f surfaceOffset, Vector3f surfaceScale) Spawns a new construction element (i.e a block) at a given position.static ConstructionElement
World.createConstructionElement
(int shape, int texture, float textureScale, int color, Vector3i chunkPosition, Vector3i blockPosition, Quaternion rotation, Vector3f scale) Spawns a new construction element (i.e a block) at a given position.static ObjectElement
World.createObject
(int typeID, int variant, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale) Spawns a new object (e.g doors, furniture, lamps etc) at a given position.static Plant
World.createPlant
(int typeID, Vector3f worldPosition, Quaternion rotation, Vector3f scale) static WorldItem
World.findNearestItem
(short itemID, Vector3f position) static WorldItem
World.findNearestItem
(Vector3f position) Gets the world item which has the shortest distance to a position.static Npc
World.findNearestNpc
(short typeID, Vector3f position) Gets the npc (with a certain type id) which has the shortest distance to a world position.static Npc
World.findNearestNpc
(Vector3f position) Gets the npc (any npc) which has the shortest distance to a world position.static Player
Server.findNearestPlayer
(Vector3f position) Gets the player who has the shortest distance to a particular world position.static Vehicle
World.findNearestVehicle
(short typeID, Vector3f position) Gets the vehicle (with a certain type id) which has the shortest distance to a world position.static Vehicle
World.findNearestVehicle
(Vector3f position) Gets the vehicle (any vehicle) which has the shortest distance to a world position.static WorldItem[]
World.getAllItemsInRange
(Vector3f position, float range) Gets all world items (i.e items that were either spawned through thespawnItem()
method or items that have been dropped by players) which are in range to a specific world position.static Npc[]
World.getAllNpcsInRange
(short typeID, Vector3f position, float range) Gets all npcs with the provided type ID which are in range to a specific world position.static Npc[]
World.getAllNpcsInRange
(Vector3f position, float range) Gets all npcs which are in range to a specific world position.static Vehicle[]
World.getAllVehiclesInRange
(Vector3f position, float range) Gets all vehicles which are in range to a specific world position.static void
Server.setDefaultSpawnPosition
(Vector3f position) Sets the global default spawn position.static WorldItem
World.spawnClothingItem
(short clothingID, int variant, int stack, int color, long infoID, Vector3f position, Quaternion rotation, boolean physical) Spawns a global clothing item in the world, i.e an item which represents a garment.static WorldItem
World.spawnConstructionItem
(byte constructionID, int texture, int stack, int color, Vector3f position, Quaternion rotation, boolean physical) static WorldItem
World.spawnItem
(short itemID, int texture, int stack, Vector3f position, Quaternion rotation, boolean physical) Spawns an item in the world.static Npc
World.spawnNpc
(short typeID, int variant, Vector3f position, Quaternion rotation) Spawns a new npc in the world.static Npc
World.spawnNpc
(short typeID, int variant, Vector3f position, Quaternion rotation, boolean temporary) Spawns a new npc in the world.static Npc
World.spawnNpc
(short typeID, Vector3f position, Quaternion rotation) Spawns a new npc in the world.static WorldItem
World.spawnObjectItem
(short objectID, int variant, int stack, Vector3f position, Quaternion rotation, boolean physical) Spawns an object item in the world, i.e an item which represents an object.static Vehicle
World.spawnVehicle
(short typeID, int constructionStage, int color, Vector3f position, Quaternion rotation) Spawns a new vehicle in the world.static void
World.triggerExplosion
(Vector3f position, Quaternion rotation, Vector3f scale, float damageFactor) Creates an explosion in the world. -
Uses of Vector3f in net.risingworld.api.assets
Modifier and TypeMethodDescriptionvoid
void
Modifier and TypeMethodDescriptionvoid
MeshAsset.addNormals
(ArrayList<Vector3f> normals) void
MeshAsset.addVertices
(ArrayList<Vector3f> vertices) void
MeshAsset.setNormals
(ArrayList<Vector3f> normals) void
MeshAsset.setVertices
(ArrayList<Vector3f> vertices) -
Uses of Vector3f in net.risingworld.api.collider
-
Uses of Vector3f in net.risingworld.api.definitions
Modifier and TypeFieldDescriptionObjects.ObjectDefinition.boundscale
Scale factors which will be applied to the object bounds when placing it.Plants.PlantDefinition.boundscale
Scale factors which will be applied to the bounds when placing it.Objects.ObjectDefinition.maxscale
Maximum xyz scale factorObjects.ObjectDefinition.minscale
Minimum xyz scale factorItems.ItemDefinition.position
Item model offset when holding in handsItems.ItemDefinition.renderoffset
Optional offset when rendering the item (e.g as custom icon or for crafting preview)Objects.ObjectDefinition.renderoffset
Optional offset of the object when rendering the object iconObjects.ObjectDefinition.rendertransform
Optional offset of the camera when rendering the object iconObjects.ObjectDefinition.resizefactor
Determines how much the element should be resized along x, y and z (0-1).Objects.ObjectDefinition.selectorhelperoffset
If there is a helper object, this is the local offset of itConstructions.ConstructionDefinition.startsize
Initial size of this element when first holding it in hands (relevant for selector)Items.ItemInfo.targetitemoffset
Only for world items: Offset after performing the actionItems.ItemInfo.targetitemscale
Only for world items: Scale after performing the action. -
Uses of Vector3f in net.risingworld.api.events.npc
Modifier and TypeMethodDescriptionNpcDeathEvent.getDeathPosition()
Gets the position where the npc died.NpcSpawnEvent.getPosition()
-
Uses of Vector3f in net.risingworld.api.events.player
Modifier and TypeMethodDescriptionPlayerDeathEvent.getDeathPosition()
Gets the position where the player died.PlayerCreateAreaEvent.getEndPosition()
Gets the selected end position for the area.PlayerWeaponFireEvent.getFirePosition()
PlayerStartFishingEvent.getFishingPosition()
Gets the fishing position, or more precisely, the bobber position.PlayerElementHitEvent.getHitNormal()
Deprecated, for removal: This API element is subject to removal in a future version.PlayerGameObjectHitEvent.getHitNormal()
Gets the normal, i.e the normal of the surface that was hit (the direction in which the surface points).PlayerElementHitEvent.getHitPosition()
Deprecated, for removal: This API element is subject to removal in a future version.PlayerGameObjectHitEvent.getHitPosition()
Gets the coordinates where the element was hit exactly.PlayerHitNpcEvent.getHitPosition()
Gets the coordinates where the npc was hit exactly.PlayerHitPlayerEvent.getHitPosition()
Gets the coordinates where the player was hit exactly.PlayerEnterAreaEvent.getNewPlayerPosition()
Gets the new player position (within the area).PlayerEnterChunkEvent.getNewPlayerPosition()
Gets the new player position (within the new chunk).PlayerEnterSectorEvent.getNewPlayerPosition()
Gets the new player position (within the new sector).PlayerEnterWorldPartEvent.getNewPlayerPosition()
Gets the new player position (within the new world part).PlayerLeaveAreaEvent.getNewPlayerPosition()
Gets the new player position (outside the area).PlayerSetSpawnPointEvent.getNewSpawnPosition()
PlayerEnterAreaEvent.getOldPlayerPosition()
Gets the previous player position (still outside the area).PlayerEnterChunkEvent.getOldPlayerPosition()
Gets the previous player position (within the previous chunk).PlayerEnterSectorEvent.getOldPlayerPosition()
Gets the previous player position (within the previous sector).PlayerEnterWorldPartEvent.getOldPlayerPosition()
Gets the previous player position (within the previous world part).PlayerLeaveAreaEvent.getOldPlayerPosition()
Gets the previous player position (still inside the area).PlayerSetSpawnPointEvent.getOldSpawnPosition()
Gets the previously set spawn position for this type (if any was set).PlayerChangePositionEvent.getPosition()
Gets the new position of the player.PlayerCreateBlueprintEvent.getPosition()
Gets the target world position of the blueprint, or more precisely, the center position of the affected area.PlayerDropItemEvent.getPosition()
Gets the item drop position.PlayerDropItemFromStorageEvent.getPosition()
Gets the item drop position.PlayerRespawnEvent.getSpawnPosition()
Gets the spawn position.PlayerSpawnEvent.getSpawnPosition()
Gets the spawn coordinates (where the player will spawn this time).PlayerCreateAreaEvent.getStartPosition()
Gets the selected start position for the area.PlayerTeleportEvent.getTargetPosition()
Gets the new position of the player.PlayerDrinkWaterEvent.getWorldPosition()
Gets the world position of the water source.Modifier and TypeMethodDescriptionvoid
PlayerCreateAreaEvent.setEndPosition
(Vector3f position) Sets a new end position for the area.void
PlayerWeaponFireEvent.setFirePosition
(Vector3f position) void
PlayerHitNpcEvent.setHitPosition
(Vector3f position) Sets the coordinates where the npc was hit exactly.void
PlayerHitPlayerEvent.setHitPosition
(Vector3f position) Sets the coordinates where the player was hit exactly.void
PlayerSetSpawnPointEvent.setNewSpawnPosition
(Vector3f position) void
PlayerChangePositionEvent.setPosition
(Vector3f position) void
PlayerRespawnEvent.setSpawnPosition
(Vector3f position) Sets the spawn position of the player.void
PlayerCreateAreaEvent.setStartPosition
(Vector3f position) Sets a new start position for the area.void
PlayerTeleportEvent.setTargetPosition
(Vector3f position) -
Uses of Vector3f in net.risingworld.api.events.player.world
Modifier and TypeMethodDescriptionPlayerHitConstructionEvent.getHitPosition()
Gets the world coordinates where the construction element was hit exactly.PlayerHitObjectEvent.getHitPosition()
Gets the world coordinates where the object was hit exactly.PlayerHitTerrainEvent.getHitPosition()
Gets the world coordinates where the terrain was hit exactly.PlayerHitVegetationEvent.getHitPosition()
Gets the world coordinates where the plant was hit exactly.PlayerHitWaterEvent.getHitPosition()
Gets the coordinates where the water surface was hit exactly.PlayerEditConstructionEvent.getNewPosition()
Gets the new world position of the construction element as a Vector3f.PlayerEditConstructionEvent.getNewSize()
Gets the new size (x, y, z) of the construction element as a Vector3f.PlayerEditConstructionEvent.getNewSurfaceOffset()
PlayerEditConstructionEvent.getNewSurfaceScale()
PlayerPlaceBlueprintEvent.getPosition()
Gets the world position of the blueprint center (i.e where the blueprint will be placed).PlayerPlaceObjectEvent.getPosition()
Gets the world position of the object as a Vector3f.PlayerPlaceBlueprintEvent.getScale()
Gets the scale factor of the blueprint.PlayerPlaceObjectEvent.getScale()
Gets the scale factor of the object along the x, y and z axis.Modifier and TypeMethodDescriptionvoid
PlayerPlaceBlueprintEvent.setPosition
(Vector3f position) Changes the world position for the blueprint (i.e the position where the blueprint will be placed).void
PlayerPlaceConstructionEvent.setPosition
(Vector3f position) Changes the world position of the construction element.void
PlayerPlaceObjectEvent.setPosition
(Vector3f position) Changes the object world position.void
PlayerPlaceVegetationEvent.setPosition
(Vector3f position) Changes the plant position.void
Changes the scale factor of the blueprint.void
Changes the size of the construction element. -
Uses of Vector3f in net.risingworld.api.events.world
Modifier and TypeMethodDescriptionProjectileFireEvent.getDirection()
Gets the direction of the projectile.ProjectileHitEvent.getHitNormal()
Gets the normal of the surface which was hit by the projectile.ProjectileHitEvent.getHitPosition()
Gets the world position where the projectile hit the target.ProjectileHitEvent.getHitVelocity()
Gets the velocity of the projectile when it hit the target.PlantGrowthEvent.getPlantPosition()
Gets the world position of the plant as a Vector3f.ExplosionEvent.getPosition()
Gets the global world position of the explosion.ProjectileFireEvent.getPosition()
Gets the global world position where the projectile was launched.Modifier and TypeMethodDescriptionvoid
ProjectileFireEvent.setDirection
(Vector3f direction) Changes the direction of the projectile.void
ExplosionEvent.setPosition
(Vector3f position) Changes the global world position of the explosion.void
ProjectileFireEvent.setPosition
(Vector3f position) Changes the global world position of the projectile. -
Uses of Vector3f in net.risingworld.api.objects
Modifier and TypeMethodDescriptionArea.getEndPosition()
Gets the end world position of the area.Npc.getPosition()
Gets the current world position of the npc.Player.getPosition()
Gets a Vector3f containing the current x, y and z coordinate of the player (world position).Vehicle.getPosition()
Gets the world position of the vehicle.WorldItem.getPosition()
Gets a Vector3f containing the current global x, y and z coordinate of this item.Player.getPreviousPosition()
Gets the previous position of the player (the player had the last frame).Area.getSize()
Item.ConstructionItem.getSize()
Player.getSpawnPosition
(SpawnPointType spawnPoint) Gets the spawn position for this player (i.e where the player would respawn upon death).Area.getStartPosition()
Gets the start world position of the area.Npc.getVectorToNearestPlayer()
Gets a normalized vector from the npc position to the position of the nearest player.Npc.getViewDirection()
Gets the current view direction of the npc as a normalized vector.Player.getViewDirection()
Gets the current view direction of the player.Player.getViewPosition()
Gets the view position of the player, i.e the world position of the player eyes.MetaObject.getWorldPosition()
Gets the world position of the object.Sign.getWorldPosition()
Gets the world position of the sign.Modifier and TypeMethodDescriptionvoid
WorldItem.applyPhysicalImpulse
(Vector3f impulse) Applies a physical impulse to the item (applied to the center).void
WorldItem.applyPhysicalImpulse
(Vector3f offset, Vector3f impulse) Applies a physical impulse to the item (applied to the position defined by the local offset).void
Player.createScreenshot
(Vector3f position, Vector3f direction, int width, int height, float quality, boolean includeUI, Callback<BufferedImage> callback) Creates a screenshot from an arbitrary world position with the desired resolution and converts it into a BufferedImage.boolean
Area.isPointInArea
(Vector3f point) Gets whether or not the point is inside this area.void
Forces the npc to move to the provided position.void
Moves the player (smoothly) to the target position.Player.playSound
(SoundAsset sound, boolean loop, float volume, float pitch, float minDistance, float maxDistance, Vector3f position) Plays a custom 3D sound at the given position.Player.playSound
(SoundAsset sound, boolean loop, float volume, float pitch, Vector3f position) Plays a custom 3D sound at the given position.Player.playSound
(SoundAsset sound, Vector3f position) Plays a custom 3D sound at the given position.void
Player.raycast
(Vector3f direction, float distance, int layerMask, boolean includeTriggers, Callback<RaycastResult> callback) Performs a raycast from the player view position to the provided direction.void
Player.raycastFromWorldPosition
(Vector3f position, Vector3f direction, float distance, int layerMask, boolean includeTriggers, Callback<RaycastResult> callback) Performs a raycast from a world position.void
Player.respawn
(Vector3f position, Quaternion rotation) Respawns the player at the given position.void
Sets a new start and end position for this area.void
Area.setEndPosition
(Vector3f endPosition) Sets an end position for this area (start and end position determine the area size).void
Npc.setPosition
(Vector3f position) Sets the world position of the npc (teleports the npc).void
Player.setPosition
(Vector3f position) Sets the world position of the player.void
Vehicle.setPosition
(Vector3f position) Sets the world position of the vehicle.void
WorldItem.setPosition
(Vector3f position) Sets the global position of the item.void
WorldItem.setPositionAndRotation
(Vector3f position, Quaternion rotation) void
Player.setSpawnPoint
(SpawnPointType spawnPoint, Vector3f position, Quaternion rotation, String name) void
Player.setSpawnPoint
(SpawnPointType spawnPoint, Vector3f position, Quaternion rotation, String name, long relatedObjectID, int chunkPosX, int chunkPosY, int chunkPosZ) void
Area.setStartPosition
(Vector3f startPosition) Sets a start position for this area (start and end position determine the area size).void
Npc.setViewDirection
(Vector3f direction) Sets the view direction of the npc.void
Player.setViewDirection
(Vector3f direction) Sets the view direction of the player. -
Uses of Vector3f in net.risingworld.api.objects.world
Modifier and TypeMethodDescriptionConstructionElement.getScale()
Gets the scale (along x, y and z) of this construction element.ObjectElement.getScale()
Gets the scale (along x, y and z) of this object.Plant.getScale()
Gets the scale (along x, y and z) of this plant.ConstructionElement.getSurfaceOffset()
ConstructionElement.getSurfaceScale()
ConstructionElement.getWorldPosition()
Gets the world position of this element.ObjectElement.getWorldPosition()
Gets the world position of this object.Plant.getWorldPosition()
Gets the world position of this plant.Modifier and TypeMethodDescriptionvoid
Sets a new scale for this construction element.void
Sets a new scale for this object.void
Sets a new scale for this plant.void
ConstructionElement.setSurfaceOffset
(Vector3f offset) void
ConstructionElement.setSurfaceOffsetAndScale
(Vector3f offset, Vector3f scale) void
ConstructionElement.setSurfaceScale
(Vector3f scale) -
Uses of Vector3f in net.risingworld.api.sounds
Modifier and TypeMethodDescriptionvoid
Sound.setDirection
(Vector3f direction) void
Sound.setPosition
(Vector3f position) Changes the world position of a sound.void
Sound.setVelocity
(Vector3f velocity) -
Uses of Vector3f in net.risingworld.api.utils
Modifier and TypeFieldDescriptionstatic final Vector3f
Vector3f.BACK
A unit vector along the -Z axis (backward direction)static final Vector3f
Vector3f.DOWN
A unit vector along the -Y axis (down direction)static final Vector3f
Vector3f.FORWARD
A unit vector along the Z axis (forward direction)static final Vector3f
Vector3f.LEFT
A unit vector along the -X axis (left direction)static final Vector3f
Vector3f.ONE
A vector with values 1, 1, 1static final Vector3f
Vector3f.RIGHT
A unit vector along the X axis (right direction)static final Vector3f
Vector3f.UP
A unit vector along the Y axis (up direction)static final Vector3f
Vector3f.ZERO
A vector with values 0, 0, 0Modifier and TypeMethodDescriptionVector3f.add
(float addX, float addY, float addZ) Creates a new vector with the same values of this vector and adds the provided values.Creates a new vector with the same values of this vector and adds the values of the provided vector.Vector3f.addLocal
(float addX, float addY, float addZ) Adds the provided values to the values of this vector.Adds the values of the provided vector to the values of this vector.Vector3f.copy()
Creates a copy of this Vector.Creates a new vector containing the cross product of this vector and another vector.Vector3f.crossLocal
(float v2x, float v2y, float v2z) Calculates the cross product of this vector and the provided coordinates.Vector3f.crossLocal
(Vector3f other) Calculates the cross product of this vector and another vector.Creates a new vector with the same values of this vector and divides the values of the provided vector.Vector3f.divideLocal
(float scalar) Vector3f.divideLocal
(Vector3f other) Vector3f.fromString
(String input) static Vector3f
Utils.VectorUtils.getAlignedDirection
(Vector3f direction, Vector3f normal) Gets a direction vector aligned to a normal.static Vector3f
Utils.VectorUtils.getAlignedDirection
(Vector3f direction, Vector3f normal, Vector3f storeTo) Bounds.getCenter()
Gets the bounds center.RaycastResult.getCollisionNormal()
Gets the collision normal, i.e the normal of the surface the ray hit.
This normal is already normalized.RaycastResult.getCollisionPoint()
Gets the collision point, i.e the position where the ray hit a collider.
Note: If you want to get the world position of the hit object itself instead, seeRaycastResult.getObjectPosition()
static Vector3f
Utils.VectorUtils.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
Utils.VectorUtils.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
Utils.ChunkUtils.getGlobalPosition
(Vector3i chunkPosition, Vector3i blockPosition) static Vector3f
Utils.ChunkUtils.getGlobalPosition
(Vector3i chunkPosition, Vector3i blockPosition, Vector3f storeTo) RaycastResult.getObjectPosition()
Gets the world position of the element that was hit by this ray.static Vector3f
Utils.VectorUtils.getXYZInFrontOfPlayer
(Player player, float distance) Gets the position in front of the player (with the given distance to the player).static Vector3f
Utils.VectorUtils.getXYZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo) Gets the position in front of the player (with the given distance to the player).static Vector3f
Utils.VectorUtils.getXZInFrontOfPlayer
(Player player, float distance) static Vector3f
Utils.VectorUtils.getXZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo) Vector3f.interpolate
(Vector3f startVector, Vector3f finalVector, float mu) Creates a new vector containing the interpolated values between the start vector and the final vector.Vector3f.interpolateLocal
(Vector3f finalVector, float mu) Interpolates this vector to the provided final vector, e.g if this vector is (0, 5, 10), and the final vector is (-10, 0, 10), the result (by using a mu-value of 0.5f) would be (-5, 2.5f, 10)Vector3f.interpolateLocal
(Vector3f startVector, Vector3f finalVector, float mu) Interpolates between the provided start and end vector and stores the result in this vector.Multiplies the quaternion by a Vector3f.Vector3f.mult
(float scalar) Creates a new vector with the same values of this vector and multiplies them with the provided scalar.Vector3f.mult
(float multX, float multY, float multZ) Creates a new vector with the same values of this vector and multiplies the provided values.Creates a new vector with the same values of this vector and multiplies the values of the provided vector.Multiplies the quaternion by a Vector3f.Vector3f.multLocal
(float scalar) Multiplies the values of this vector with the provided scalar.Vector3f.multLocal
(float multX, float multY, float multZ) Multiplies the values of this vector with the provided values.Multiplies the values of this vector with the values of the provided vector.Vector3f.negate()
Creates a new vector which contains negated values of this vector.Vector3f.negateLocal()
Negates all values of this vector.Vector3f.normalize()
Creates a new vector containing normalized values of this vector (i.e as a unit vector).Vector3f.normalizeLocal()
Normalizes this vector (i.e turn it into a unit vector).Vector3f.set
(float x, float y, float z) Sets the x, y and z values of this vector to the provided values.Sets the x, y and z values of this vector to the values of the provided vector.Vector3f.setX
(float x) Sets the x value of this vector.Vector3f.setY
(float y) Sets the y value of this vector.Vector3f.setZ
(float z) Sets the z value of this vector.Vector3f.subtract
(float subtractX, float subtractY, float subtractZ) Creates a new vector with the same values of this vector and subtracts the provided values.Creates a new vector with the same values of this vector and subtracts the values of the provided vector.Vector3f.subtractLocal
(float subtractX, float subtractY, float subtractZ) Subtracts the provided values from the values of this vector.Vector3f.subtractLocal
(Vector3f other) Subtracts the values of the provided vector from the values of this vector.Modifier and TypeMethodDescriptionCreates a new vector with the same values of this vector and adds the values of the provided vector.Adds the values of the provided vector to the values of this vector.float
Vector3f.angleBetween
(Vector3f other) Gets the angle between this vector and another vector.Creates a new vector containing the cross product of this vector and another vector.Vector3f.crossLocal
(Vector3f other) Calculates the cross product of this vector and another vector.float
Gets the distance between this vector and another vector.float
Vector3f.distanceSquared
(Vector3f other) Gets the squared distance between this vector and another Vector3f.Creates a new vector with the same values of this vector and divides the values of the provided vector.Vector3f.divideLocal
(Vector3f other) float
Gets the dot product of this vector with the provided vector.static Vector3f
Utils.VectorUtils.getAlignedDirection
(Vector3f direction, Vector3f normal) Gets a direction vector aligned to a normal.static Vector3f
Utils.VectorUtils.getAlignedDirection
(Vector3f direction, Vector3f normal, Vector3f storeTo) static Vector3i
Utils.ChunkUtils.getBlockPosition
(Vector3f globalPosition, Vector3i chunkPosition) Calculates a block position (within the provided chunk position)static void
Utils.ChunkUtils.getChunkAndBlockPosition
(Vector3f globalPosition, Vector3i chunkPositionStore, Vector3i blockPositionStore) Calculates a chunk offset and the according block position (within this chunk) from a given global position and stores the results in the providedVector3i's
.static Vector3i
Utils.ChunkUtils.getChunkPosition
(Vector3f globalPosition) Calculates a chunk offset from a given global position and stores the result in aVector3i
.static Vector3i
Utils.ChunkUtils.getChunkPosition
(Vector3f globalPosition, Vector3i storeTo) Calculates a chunk offset from a given global position and stores the result in the providedVector3i
.static Vector3f
Utils.VectorUtils.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
Utils.VectorUtils.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
Utils.ChunkUtils.getGlobalPosition
(Vector3i chunkPosition, Vector3i blockPosition, Vector3f storeTo) static Vector3f
Utils.VectorUtils.getXYZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo) Gets the position in front of the player (with the given distance to the player).static Vector3f
Utils.VectorUtils.getXZInFrontOfPlayer
(Player player, float distance, Vector3f storeTo) Vector3f.interpolate
(Vector3f startVector, Vector3f finalVector, float mu) Creates a new vector containing the interpolated values between the start vector and the final vector.Vector3f.interpolateLocal
(Vector3f finalVector, float mu) Interpolates this vector to the provided final vector, e.g if this vector is (0, 5, 10), and the final vector is (-10, 0, 10), the result (by using a mu-value of 0.5f) would be (-5, 2.5f, 10)Vector3f.interpolateLocal
(Vector3f startVector, Vector3f finalVector, float mu) Interpolates between the provided start and end vector and stores the result in this vector.boolean
Vector3f.isOrthogonal
(Vector3f other) Checks if this vector is orthogonal to another vector (i.e the angle between both vectors is ~ 90° degree).boolean
Bounds.isPointInVolume
(Vector3f point) Checks if the given point (represented as aVector3f
) is inside the bounds."Looks at" a given direction, i.e the quaternion will be set based on the direction."Looks at" a given direction, i.e the quaternion will be set based on the direction and an up vector.Multiplies the quaternion by a Vector3f.Creates a new vector with the same values of this vector and multiplies the values of the provided vector.Multiplies the quaternion by a Vector3f.Multiplies the values of this vector with the values of the provided vector.Sets the x, y and z values of this vector to the values of the provided vector.Creates a new vector with the same values of this vector and subtracts the values of the provided vector.Vector3f.subtractLocal
(Vector3f other) Subtracts the values of the provided vector from the values of this vector.static String
Utils.StringUtils.vector3fToString
(Vector3f vector3f) -
Uses of Vector3f in net.risingworld.api.world.batch
Modifier and TypeMethodDescriptionvoid
ConstructionPlaceBatch.add
(int shape, int texture, float textureScale, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale, Vector3f surfaceOffset, Vector3f surfaceScale) void
PlantPlaceBatch.add
(int typeID, Vector3f worldPosition, Quaternion rotation, Vector3f scale) -
Uses of Vector3f in net.risingworld.api.worldelements
Modifier and TypeMethodDescriptionGameObject.getLocalPosition()
Gets the local position of this object, relative to its parent.GameObject.getLocalScale()
Gets the current local scale of this game object.Modifier and TypeMethodDescriptionvoid
GameObject.moveToLocalPosition
(Vector3f position, float speed) Smoothly moves this object to a target local position.void
GameObject.moveToLocalPosition
(Vector3f position, float speed, Callback<Consumer<Vector3f>> callback) Smoothly moves this object to a target local position.void
GameObject.moveToLocalTransform
(Vector3f position, Quaternion rotation, float speed) Smoothly moves and rotates this object to a target local position and rotation.void
GameObject.setLocalPosition
(Vector3f position) Sets the position of this object, relative to its parent.void
Prefab.setLocalPosition
(String path, Vector3f position) Sets the position of the prefab or a child of this prefab, relative to its parent.void
GameObject.setLocalScale
(Vector3f scale) Sets the local scale of this object, relative to its parent.void
Prefab.setLocalScale
(String path, Vector3f scale) Sets the local scale of the prefab or a child of this prefab, relative to its parent.void
Prefab.setMaterialParameter
(String path, String parameter, Vector3f value) Sets a material parameter.void
Prefab.setVFXParameter
(String path, String parameter, Vector3f value) Modifier and TypeMethodDescriptionvoid
GameObject.moveToLocalPosition
(float x, float y, float z, float speed, Callback<Consumer<Vector3f>> callback) Smoothly moves this object to a target local position.void
GameObject.moveToLocalPosition
(Vector3f position, float speed, Callback<Consumer<Vector3f>> callback) Smoothly moves this object to a target local position.void
Prefab.readLocalPosition
(String path, Player player, Callback<Vector3f> callback) Reads the actual local position of the prefab (or a child of this prefab, specified by the path) from a particular player.void
GameObject.readWorldPosition
(Player player, Callback<Vector3f> callback) Reads the actual world position of the game object from a particular player.void
Prefab.readWorldPosition
(String path, Player player, Callback<Vector3f> callback) Reads the actual world position of the prefab (or a child of this prefab, specified by the path) from a particular player.