HexMapLibrary
Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Wunderwunsch.HexMapLibrary.HexMouse Class Reference

Updates every frame with the position of the mouse cursor on the XZ-Plane in different coordinate systems. More...

Inheritance diagram for Wunderwunsch.HexMapLibrary.HexMouse:

Public Member Functions

virtual void Update ()
 Update is called once per frame More...
 
void Init (HexMap hexMap)
 Call this at start of game or when the map changes to assign the HexMap More...
 

Properties

bool CursorIsOnMap [get, private set]
 Indicates whether the cursor is on the map. More...
 
Vector3 CartesianCoordInfiniteGrid [get, private set]
 cartesian coordinate without map wrap considered More...
 
Vector3 CartesianCoordWrapped [get, private set]
 cartesian coordinate with map wrap considered More...
 
Vector3Int CubeCoordRaw [get, private set]
 cube coordinate without map wrap More...
 
Vector3Int TileCoord [get, private set]
 cube coordinate with map wrap More...
 
Vector2Int OffsetCoordInfiniteGrid [get, private set]
 offset coordinate without map wrap More...
 
Vector2Int OffsetCoord [get, private set]
 offset coordinate with map wrap More...
 
Vector3Int ClosestEdgeCoordInfiniteGrid [get, private set]
 closest edge coordinate without map wrap More...
 
Vector3Int ClosestEdgeCoord [get, private set]
 closest edge coordinate with map wrap More...
 
Ray SelectionRay [get, private set]
 equals Camera.main.ScreenPointToRay(Input.mousePosition); More...
 
Vector3Int ClosestCornerCoordInfiniteGrid [get, private set]
 closest corner coordinate without map wrap More...
 
Vector3Int ClosestCornerCoord [get, private set]
 closest corner coordinate with map wrap More...
 

Private Member Functions

Vector3 GetPlanePosition ()
 returns the cartesian of the mouse, using the active Camera and casting a ray on the XZ-plane More...
 
void UpdateMousePositionData ()
 updates all the mouse position data More...
 

Private Attributes

HexMap hexMap
 Map which is assigned to the mouse - should always be the current visible map in cases where you have multiple maps. if it is null then it will just skip map wrapping and clamping. More...
 
Plane plane
 collision plane to cast rays against to get mouse position; More...
 

Detailed Description

Updates every frame with the position of the mouse cursor on the XZ-Plane in different coordinate systems.

Member Function Documentation

◆ Update()

virtual void Wunderwunsch.HexMapLibrary.HexMouse.Update ( )
virtual

Update is called once per frame

◆ Init()

void Wunderwunsch.HexMapLibrary.HexMouse.Init ( HexMap  hexMap)

Call this at start of game or when the map changes to assign the HexMap

◆ GetPlanePosition()

Vector3 Wunderwunsch.HexMapLibrary.HexMouse.GetPlanePosition ( )
private

returns the cartesian of the mouse, using the active Camera and casting a ray on the XZ-plane

◆ UpdateMousePositionData()

void Wunderwunsch.HexMapLibrary.HexMouse.UpdateMousePositionData ( )
private

updates all the mouse position data

Member Data Documentation

◆ hexMap

HexMap Wunderwunsch.HexMapLibrary.HexMouse.hexMap
private

Map which is assigned to the mouse - should always be the current visible map in cases where you have multiple maps. if it is null then it will just skip map wrapping and clamping.

◆ plane

Plane Wunderwunsch.HexMapLibrary.HexMouse.plane
private

collision plane to cast rays against to get mouse position;

Property Documentation

◆ CursorIsOnMap

bool Wunderwunsch.HexMapLibrary.HexMouse.CursorIsOnMap
getprivate set

Indicates whether the cursor is on the map.

◆ CartesianCoordInfiniteGrid

Vector3 Wunderwunsch.HexMapLibrary.HexMouse.CartesianCoordInfiniteGrid
getprivate set

cartesian coordinate without map wrap considered

◆ CartesianCoordWrapped

Vector3 Wunderwunsch.HexMapLibrary.HexMouse.CartesianCoordWrapped
getprivate set

cartesian coordinate with map wrap considered

◆ CubeCoordRaw

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.CubeCoordRaw
getprivate set

cube coordinate without map wrap

◆ TileCoord

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.TileCoord
getprivate set

cube coordinate with map wrap

◆ OffsetCoordInfiniteGrid

Vector2Int Wunderwunsch.HexMapLibrary.HexMouse.OffsetCoordInfiniteGrid
getprivate set

offset coordinate without map wrap

◆ OffsetCoord

Vector2Int Wunderwunsch.HexMapLibrary.HexMouse.OffsetCoord
getprivate set

offset coordinate with map wrap

◆ ClosestEdgeCoordInfiniteGrid

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.ClosestEdgeCoordInfiniteGrid
getprivate set

closest edge coordinate without map wrap

◆ ClosestEdgeCoord

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.ClosestEdgeCoord
getprivate set

closest edge coordinate with map wrap

◆ SelectionRay

Ray Wunderwunsch.HexMapLibrary.HexMouse.SelectionRay
getprivate set

equals Camera.main.ScreenPointToRay(Input.mousePosition);

◆ ClosestCornerCoordInfiniteGrid

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.ClosestCornerCoordInfiniteGrid
getprivate set

closest corner coordinate without map wrap

◆ ClosestCornerCoord

Vector3Int Wunderwunsch.HexMapLibrary.HexMouse.ClosestCornerCoord
getprivate set

closest corner coordinate with map wrap