![]() |
DC/RTS Documentation
v1.62
A Unity3D System Incorporating the Functionality of a Dungeon Crawler or Real Time Strategy System
|
This class generates a grid a long the xz plane. More...
Classes | |
class | GridComparer |
Used for Sorting GridSquares within a Data Structure that Contains an IComparer. More... | |
class | GridSquare |
Represents a 3D GridSquare within the xz-plane. More... | |
class | GridSquareQuadrant |
Used for Being Able to Easily keep Track of GridSquares Tied to Specific Quadrants. More... | |
Public Member Functions | |
List< GridSquare > | CalculateGridSquares (int rowSize, int colSize, int initRow, int initCol, bool addToMainGrid) |
Calculates a List of GridSquare objects More... | |
int[] | DetermineGridCheckPoints (Vector3 moveToPoint, bool flag) |
Determines the Grid Coordinates of a Desired Vector3 within the GridGenerator. More... | |
PathFinder | getPathFinder () |
Gets the PathFinder associated with this GridGenerator. More... | |
void | CalculateNewPath (Vector3 init, Vector3 final) |
Wrapper Around PathFinder.CalculateNewPath for Calculating the Movement Path Given an Initial and Final World Position. More... | |
void | CalculateNewPath (Transform moveObj, Vector3 final) |
Wrapper Around PathFinder.CalculateNewPath for Calculating the Movement Path Given a Unity3D Transform Object and a Final World Position. More... | |
GridSquare | getDesiredGridSquare (int r, int c) |
Retrieves a GridSquare from a specific Row and Column. More... | |
GridSquareQuadrant | getDesiredQuadrant (int qr, int qc) |
Retrieves a GridQuadrant from a specific Quad Row and Quad Column. More... | |
List< GridSquare > | getCalculatedPathTiles () |
Allows for Retrieval of the Paths Calculated Path Tiles. More... | |
void | ResetGrid () |
Resets both the GridQuandrants and GridSquares that are attached to the GridQuadrants. More... | |
int | getRows () |
Returns the total number of grid rows. More... | |
int | getColumns () |
Returns the total number of grid columns. More... | |
Static Public Member Functions | |
static RaycastHit | CollectedRaycastInfo (Ray ray, float dist, int layerMask) |
Utility function for Collecting Information about a Raycast. More... | |
Public Attributes | |
LayerMask | IgnoreMask |
The Layermask this GridGenerator will Ignore (Control Objects, NPC Objects, Creature Objects, etc) More... | |
int | Rows = 16 |
The Number of Rows this GridGenerator is Made Up of. More... | |
int | Columns = 16 |
The Number of Columns this GridGenerator is Made Up of. More... | |
int | GridWidth = 10 |
The Width of an Individual GridSquare. More... | |
int | GridHeight = 20 |
The Height of an Individual GridSquare. More... | |
int | GridDepth = 10 |
The Depth of an Individual GridSquare. More... | |
int | GridQuadSize = 8 |
Used for Dividing the Grid Into Individual Quadrants Made Up of GridQuadSize GridSquares. More... | |
float | MinSlopeAngle = 5.0f |
The Minimum Slope Angle to Determine. More... | |
float | MaxSlopeAngle = 30.0f |
The Maximum Slope Angle to Determine. More... | |
float | Rigidity = .1f |
Linear Rigidity, in Terms of How Bumpy the GridGenerator will Allow a GridSquare Along it's GridSquare Generation. More... | |
float | AngularRigidity = 0.01f |
Angular Rigidity, in Terms of the Factor of how Smooth a Slope is. More... | |
bool | EightAdjacentSquares = true |
Eight Adjacent Squares (true) or Four Adjacent Squares (false)? More... | |
This class generates a grid a long the xz plane.
The grid is made up of GridQuadrants that are made up of GridSquares, where the grid is determined based off raycasts. The calculated grids are stored in a 2D array of GridSquares, which can be acessed by: getDesiredGridSquare(int r, int c) function. This GridGenerator is utilized within the PathFinder.cs object, with the A* pathfinding implementation.
For the grid to generate properly, at this time, slopes need to be parallel to either the x or z axis.
List<GridSquare> GridGenerator.CalculateGridSquares | ( | int | rowSize, |
int | colSize, | ||
int | initRow, | ||
int | initCol, | ||
bool | addToMainGrid | ||
) |
Calculates a List of GridSquare objects
rowSize | The size of the row count |
colSize | The size of the column count |
initRow | The initial row to start at |
initCol | The initial column to start at |
addToMainGrid | Add calculated GridSquares to the Main GridGenerator or return just a List of GridSquares? |
void GridGenerator.CalculateNewPath | ( | Vector3 | init, |
Vector3 | final | ||
) |
Wrapper Around PathFinder.CalculateNewPath for Calculating the Movement Path Given an Initial and Final World Position.
init | Initial Position. |
final | Final Position. |
void GridGenerator.CalculateNewPath | ( | Transform | moveObj, |
Vector3 | final | ||
) |
Wrapper Around PathFinder.CalculateNewPath for Calculating the Movement Path Given a Unity3D Transform Object and a Final World Position.
moveObj | The Unity3D Transform Object to Move. |
final | The Final Position. |
|
static |
Utility function for Collecting Information about a Raycast.
ray | The Ray to Cast |
dist | The Distance |
layerMask | The Layer Mask to Ignore |
int [] GridGenerator.DetermineGridCheckPoints | ( | Vector3 | moveToPoint, |
bool | flag | ||
) |
Determines the Grid Coordinates of a Desired Vector3 within the GridGenerator.
moveToPoint | The Desired Move To Point |
flag | If true returns actual grid coordinates, if false returns {-1, -1} if the grid coordinate doesn't exist |
List<GridSquare> GridGenerator.getCalculatedPathTiles | ( | ) |
Allows for Retrieval of the Paths Calculated Path Tiles.
int GridGenerator.getColumns | ( | ) |
Returns the total number of grid columns.
GridSquare GridGenerator.getDesiredGridSquare | ( | int | r, |
int | c | ||
) |
Retrieves a GridSquare from a specific Row and Column.
r | The Row |
c | The Column |
GridSquareQuadrant GridGenerator.getDesiredQuadrant | ( | int | qr, |
int | qc | ||
) |
Retrieves a GridQuadrant from a specific Quad Row and Quad Column.
qr | The Quadrant Row |
qc | The Quadrant Column |
PathFinder GridGenerator.getPathFinder | ( | ) |
Gets the PathFinder associated with this GridGenerator.
int GridGenerator.getRows | ( | ) |
Returns the total number of grid rows.
void GridGenerator.ResetGrid | ( | ) |
Resets both the GridQuandrants and GridSquares that are attached to the GridQuadrants.
float GridGenerator.AngularRigidity = 0.01f |
Angular Rigidity, in Terms of the Factor of how Smooth a Slope is.
int GridGenerator.Columns = 16 |
The Number of Columns this GridGenerator is Made Up of.
bool GridGenerator.EightAdjacentSquares = true |
Eight Adjacent Squares (true) or Four Adjacent Squares (false)?
int GridGenerator.GridDepth = 10 |
The Depth of an Individual GridSquare.
int GridGenerator.GridHeight = 20 |
The Height of an Individual GridSquare.
This Height is also Used for Calculating from the Top Down, it's a Very Important Factor in the Calculation.
int GridGenerator.GridQuadSize = 8 |
Used for Dividing the Grid Into Individual Quadrants Made Up of GridQuadSize GridSquares.
int GridGenerator.GridWidth = 10 |
The Width of an Individual GridSquare.
LayerMask GridGenerator.IgnoreMask |
The Layermask this GridGenerator will Ignore (Control Objects, NPC Objects, Creature Objects, etc)
float GridGenerator.MaxSlopeAngle = 30.0f |
The Maximum Slope Angle to Determine.
float GridGenerator.MinSlopeAngle = 5.0f |
The Minimum Slope Angle to Determine.
float GridGenerator.Rigidity = .1f |
Linear Rigidity, in Terms of How Bumpy the GridGenerator will Allow a GridSquare Along it's GridSquare Generation.
int GridGenerator.Rows = 16 |
The Number of Rows this GridGenerator is Made Up of.