Utrecht University Crowd Simulation API
UUCS.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "Environment/EnvironmentTypeDefinitions.h"
12 #include "Simulation/CharacterParameterInfo.h"
13 #include "Simulation/PathPlanning/PathPlanningManager.h"
14 #include "Simulation/PathFollowing/PathFollowingManager.h"
15 #include "Simulation/CollisionAvoidance/CollisionAvoidanceManager.h"
16 #include "Simulation/GroupForces/GroupForcesManager.h"
17 #include "Simulation/Character.h"
18 #include "Accessory_Tools/DensityMap_Grid.h"
19 
20 #ifdef _MSC_VER
21  #ifdef UUCS_EXPORTS
22  #define UUCSAPI extern"C" __declspec(dllexport)
23  #else
24  #define UUCSAPI extern"C" __declspec(dllimport)
25  #endif // UUCS_EXPORTS
26 #else
27  #define UUCSAPI extern"C"
28 #endif // _MSC_VER
29 
30 #ifdef _MSC_VER
31  #define UUCS_CALLCONV __cdecl
32 #else
33  #define UUCS_CALLCONV
34 #endif
35 #define DEPRECATED_MESSAGE "function is deprecated"
36 #define DEPRECATED __declspec(deprecated(DEPRECATED_MESSAGE))
37 
42 typedef enum
43 {
45  Moving = 0,
49 
56 typedef struct
57 {
59  int id;
61  double x;
63  double y;
65  LayerIndex layerID;
67  double dirx;
69  double diry;
73 
80 typedef struct
81 {
83  int id;
85  LayerIndex layerID;
87  double vx;
89  double vy;
91  double fx;
93  double fy;
97 
104 typedef struct
105 {
107  int groupID;
109  int* memberIDs;
113 
119 typedef struct
120 {
122  double x;
124  double y;
125 } VertexData;
126 
131 typedef struct
132 {
134  double x;
136  double y;
138  LayerIndex layerID;
140 
147 typedef struct
148 {
150  double x;
152  double y;
154  double z;
155 } VertexData3D;
156 
163 typedef struct
164 {
166  ConnectionIndex id;
167 
170 
173 
175  LayerIndex layerID1;
176 
178  LayerIndex layerID2;
180 
185 typedef struct
186 {
188  PrimitiveIndex id;
193 } ObstacleData;
194 
199 typedef struct
200 {
202  PrimitiveIndex id;
208 
213 typedef struct
214 {
216  LayerIndex id;
225 } LayerData;
226 
227 
228 
233 typedef struct
234 {
244  double xMin;
246  double yMin;
248  double xMax;
250  double yMax;
252 
258 typedef struct
259 {
261  int x;
263  int y;
265  double xPosition;
267  double yPosition;
269  double density;
271 
276 typedef enum
277 {
282 } STATUS_CODE;
283 
284 typedef CharacterParameterName CHARACTER_PARAMETER;
285 typedef CharacterParameterType PARAMETER_TYPE;
286 
287 typedef Character::ControlMode CHARACTER_CONTROL_MODE;
288 
289 typedef DensityMapParameterName DENSITYMAP_PARAMETER;
290 typedef DensityMapType DENSITYMAP_TYPE;
291 //
292 // --- API FUNCTIONS
293 //
294 
295 #pragma region MODELLING
296 
336 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddConnection(VertexData3D endpoint1, VertexData3D endpoint2, LayerIndex layerID1, LayerIndex layerID2, ConnectionIndex& connectionID);
337 
367 
413 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddObstacle(LayerIndex layerID, VertexData* vertices, int numVertices, PrimitiveIndex& obstacleID);
414 
459 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddWalkableArea(LayerIndex layerID, VertexData3D* vertices, int numVertices, PrimitiveIndex& walkableAreaID);
460 
466 
485 
506 
525 
551 
579 
606 
633 
656 
675 
694 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_SimplifyPolygon(VertexData* originalVertices, int numVertices, float epsilon, VertexData* newVertices, int& numNewVertices);
695 
712 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_GetConvexHull(VertexData* originalVertices, int numVertices, VertexData* newVertices, int& numNewVertices);
713 
737 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_PolygonSubtract(VertexData* minuend, int numMiunendVertices, VertexData* subtrahend, int numSubtractPolygons, int* numSubtrahendVertices,
738  VertexData* result, int& numResultVertices);
739 
759 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_PolygonUnion(VertexData* addendList, int numAddPolygons, int* numaddendListVertices,
760  VertexData* result, int& numResultVertices);
761 
762 #pragma endregion
763 
764 #pragma region SIMULATION
765 
776 
794 
826 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_PrepareSimulation(double timeStep, int seed, int nrThreads = 0, CHARACTER_CONTROL_MODE defaultCharacterControlMode = CHARACTER_CONTROL_MODE::Internal);
827 
846 
857 
876 
898 
923 
942 
959 
981 
1002 
1008 #pragma endregion
1009 
1010 #pragma region DENSITYMAP
1011 
1032 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CreateDensityMap(LayerIndex layerIndex, int& id, double xMin = 1.0, double yMin = 1.0, double xMax = 0.0, double yMax = 0.0);
1033 
1048 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CalculateDensityMapWithCharacters(int id, const int* charactersID, int characterNumber);
1049 
1063 
1076 
1088 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetDensityMapSize(int id, int& width, int& height);
1089 
1103 
1115 
1128 
1133 
1134 
1135 #pragma endregion
1136 
1137 #pragma region CHARACTERS
1138 
1173 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddCharacter(double x, double y, LayerIndex layerID, int& id, const char* profileName = "default", bool collisionFreePlacement = true, CHARACTER_CONTROL_MODE controlMode = CHARACTER_CONTROL_MODE::UseSimulationDefault);
1174 
1191 
1217 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddCharacterToGroup(int characterID, int& groupID);
1218 
1237 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetGroupID(int characterID, int& groupID);
1238 
1259 
1286 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterGoal(int characterID, double x, double y, LayerIndex layerID, double radius);
1287 
1310 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterGoal(int characterID, double& x, double& y, LayerIndex& layerID, double& radius);
1311 
1327 
1339 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterIndicativeRouteData(int characterID, int &length, double &score);
1340 
1353 
1382 
1410 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepData(CharacterStepData_Position*& stepData_positions, int& numCharacters_positions,
1411  CharacterStepData_Velocity*& stepData_velocities, int& numCharacters_velocities);
1412 
1442 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepDataInArea(double xMin, double yMin, double xMax, double yMax, LayerIndex layerID,
1443  CharacterStepData_Position*& stepData_positions, int& numCharacters_positions,
1444  CharacterStepData_Velocity*& stepData_velocities, int& numCharacters_velocities);
1445 
1476 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepDataInRange(double xCenter, double yCenter, double radius, LayerIndex layerID,
1477  CharacterStepData_Position*& stepData_positions, int& numCharacters_positions,
1478  CharacterStepData_Velocity*& stepData_velocities, int& numCharacters_velocities);
1479 
1480 
1502 
1523 
1535 
1554 
1573 
1592 
1608 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_PathPlanningMethod(int characterID, PathPlanningMethod::Type& value);
1609 
1625 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_PathFollowingMethod(int characterID, PathFollowingMethod::Type& value);
1626 
1642 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_CollisionAvoidanceMethod(int characterID, CollisionAvoidanceMethod::Type& value);
1643 
1659 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_GroupForcesMethod(int characterID, GroupForcesMethod::Type& value);
1660 
1680 
1700 
1719 
1735 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_PathPlanningMethod(int characterID, PathPlanningMethod::Type value);
1736 
1752 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_PathFollowingMethod(int characterID, PathFollowingMethod::Type value);
1753 
1769 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_CollisionAvoidanceMethod(int characterID, CollisionAvoidanceMethod::Type value);
1770 
1786 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_GroupForcesMethod(int characterID, GroupForcesMethod::Type value);
1787 
1788 
1789 
1790 
1791 
1792 #pragma endregion
1793 
1794 #pragma region OBJECTS
1795 
1830 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddActivityArea(LayerIndex layerID, VertexData* vertices, int numVertices, int& id);
1831 
1852 
1870 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetActivityAreaArrayLengths(int id, int &enteredLength, int &insideLength, int &leftLength);
1871 
1885 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetActivityAreaData(int id, int *characterIDsEntered, int *characterIDsInside, int *characterIDsLeft);
1886 
1947 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddDynamicObstacle(LayerIndex layerID, VertexData* vertices, int numVertices, PrimitiveIndex& obstacleID);
1948 
1985 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_RemoveDynamicObstacle(PrimitiveIndex obstacleID);
1986 #pragma endregion
1987 
1988 #pragma region OTHERS
1989 
1998 
2008 
2018 
2045 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetRandomFreePosition(LayerIndex layerID, double radius, double xMin, double yMin, double xMax, double yMax, double& x, double& y);
2046 
2076 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_IsDiscFreeOfObstacles(double x, double y, LayerIndex layerID, double radius, bool& free);
2077 
2092 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_IsDiscFreeOfCharacters(double x, double y, LayerIndex layerID, double radius, bool& free);
2093 
2113 
2138 UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_PerformTest(int testID, int numCharacters);
2139 #pragma endregion
2140 
2141 
2142 
2143 
2144 
2145 
2146 
2147 
LayerIndex id
The ID of the layer. Each layer has a unique ID within the environment it belongs to...
Definition: UUCS.h:216
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddLayer(LayerIndex &layerID)
Adds an empty layer to the active modelling environment.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SaveEnvironmentToFile(const char *filename)
Saves the active simulation environment as an ENV or PRI file.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetDensityMapResult(int id, DENSITYMAP_TYPE type, DensityMapGrid *densityMap)
Get one of the three types of the density map, i.e.
A struct that represents a 2D position at a certain layer of the environment.
Definition: UUCS.h:131
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_GetConvexHull(VertexData *originalVertices, int numVertices, VertexData *newVertices, int &numNewVertices)
Get the convex hull of a polygon.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_PolygonUnion(VertexData *addendList, int numAddPolygons, int *numaddendListVertices, VertexData *result, int &numResultVertices)
Get the union of a polygon and a list of polygons Can be used to operate obstacle polygons...
int id
The ID of the character. Each simulated character has a unique ID.
Definition: UUCS.h:59
LayerIndex layerID1
The ID of the first layer to which this connection is associated.
Definition: UUCS.h:175
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_GroupForcesMethod(int characterID, GroupForcesMethod::Type value)
Updates a character's group forces method to the specified value.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_Double(int characterID, CHARACTER_PARAMETER parameter, double &value)
Gets the value of a character parameter of type "double".
VertexData * vertices
A VertexData array that stores all vertices that describe the obstacle.
Definition: UUCS.h:190
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetActivityAreaData(int id, int *characterIDsEntered, int *characterIDsInside, int *characterIDsLeft)
Retrieves the CharacterIDs for the Characters that entered, or left the are or are inside of the Acti...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_Int(int characterID, CHARACTER_PARAMETER parameter, int value)
Updates a character parameter of type "int" to the specified value.
double dirx
The X component of the character's orientation vector.
Definition: UUCS.h:67
double yMin
The minimum Y coordinate of the environment.
Definition: UUCS.h:246
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterIndicativeRoute(int characterID, VertexData *path, int length)
Replaces the indactive route of the character by the given path.
A struct that stores the endpoints of a connection, and the IDs of the layers to which this connectio...
Definition: UUCS.h:163
CharacterParameterType PARAMETER_TYPE
Definition: UUCS.h:285
double y
The Y coordinate of the position.
Definition: UUCS.h:124
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetRandomFreePosition(LayerIndex layerID, double radius, double xMin, double yMin, double xMax, double yMax, double &x, double &y)
Finds a random free position on a given layer of the active simulation environment, within the specified axis-aligned bounding box.
int * memberIDs
An array that stores all character IDs that describe the group.
Definition: UUCS.h:109
LayerIndex layerID
The layer ID of the position.
Definition: UUCS.h:138
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetMajorVersion(int &verMajor)
Retrieves the major version of the UUCS API.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_RemoveCharacter(int characterID)
Removes a character from the simulation.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_PolygonSubtract(VertexData *minuend, int numMiunendVertices, VertexData *subtrahend, int numSubtractPolygons, int *numSubtrahendVertices, VertexData *result, int &numResultVertices)
Get the difference of a polygon and a list of polygons Can be used to operate obstacle polygons...
A struct that stores the list of vertices of a walkable area.
Definition: UUCS.h:199
int x
The X index of the grid.
Definition: UUCS.h:261
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_Bool(int characterID, CHARACTER_PARAMETER parameter, bool value)
Updates a character parameter of type "bool" to the specified value.
double y
The Y coordinate of the position.
Definition: UUCS.h:136
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddObstacle(LayerIndex layerID, VertexData *vertices, int numVertices, PrimitiveIndex &obstacleID)
Adds an obstacle on the specified layer of the active modelling environment.
Indicates that the called API function has been successfully executed.
Definition: UUCS.h:279
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_PrepareSimulation(double timeStep, int seed, int nrThreads=0, CHARACTER_CONTROL_MODE defaultCharacterControlMode=CHARACTER_CONTROL_MODE::Internal)
Initializes the simulation.
A struct that stores the desired velocity and force of a character in the simulation at some point in...
Definition: UUCS.h:80
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_RemoveCharacterFromGroup(int characterID)
Removes a character from a group.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddActivityArea(LayerIndex layerID, VertexData *vertices, int numVertices, int &id)
Adds an ActivityArea on the specified layer of the active simulation environment. ...
double x
The X coordinate of the character's position.
Definition: UUCS.h:61
int numVertices
The number of vertices that describe the obstacle, i.e. the size of the vertices array.
Definition: UUCS.h:192
double vx
The X coordinate of the character's intended velocity.
Definition: UUCS.h:87
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_RemoveLayer(LayerIndex layerID)
Removes a layer from the active modelling environment.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterIndicativeRouteData(int characterID, int &length, double &score)
Retrieves and returns the size of the character's indicative route and the score assigned to it...
double y
The Y coordinate of the vertex position.
Definition: UUCS.h:152
double vy
The Y coordinate of the character's intended velocity.
Definition: UUCS.h:89
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_ResetSimulation()
Resets the simulation: removes all characters and sets the simulation time back to 0...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetPatchVersion(int &verPatch)
Retrieves the patch version of the UUCS API.
STATUS_CODE
Denotes a status code of the simulation.
Definition: UUCS.h:276
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddDynamicObstacle(LayerIndex layerID, VertexData *vertices, int numVertices, PrimitiveIndex &obstacleID)
Adds a dynamic obstacle on the specified layer of the active simulation environment.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_RemoveActivityArea(int id)
Removes an ActivityArea from the active simulation.
CharacterMovingState movingState
Indicates whether the Character is moving or reached its goal.
Definition: UUCS.h:71
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetSimulationTime(double &simulationTime)
Stores the simulation time in the given memory address.
CharacterMovingState
Indicates whether a Character reached its goal or is still moving.
Definition: UUCS.h:42
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_IsDiscFreeOfCharacters(double x, double y, LayerIndex layerID, double radius, bool &free)
Checks whether the specified disc does not intersect any obstacles within the active simulation envir...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_RemoveDynamicObstacle(PrimitiveIndex obstacleID)
Removes a dynamic obstacle from the active simulation environment.
int numObstacles
The number of obstacles in the layer, i.e. the size of the obstacles array.
Definition: UUCS.h:220
double fy
The Y component of the force vector that the character experiences according to this engine...
Definition: UUCS.h:93
Character::ControlMode CHARACTER_CONTROL_MODE
Definition: UUCS.h:287
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_PerformTest(int testID, int numCharacters)
Performs a simple test scenario.
VertexData3D endpoint2
The second 3D endpoint of the connection.
Definition: UUCS.h:172
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_LoadCharacterProfiles(const char *filename)
Loads character profiles from an XML file.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddConnection(VertexData3D endpoint1, VertexData3D endpoint2, LayerIndex layerID1, LayerIndex layerID2, ConnectionIndex &connectionID)
Adds a connection to the active modelling environment.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_RemoveConnection(ConnectionIndex connectionID)
Removes a connection from the active modelling environment.
double xMax
The maximum X coordinate of the environment.
Definition: UUCS.h:248
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetGroupID(int characterID, int &groupID)
Retrieves the ID of the group that the specified character belongs to.
WalkableAreaData * walkableAreas
A WalkableAreaData array that stores all walkable areas in the layer.
Definition: UUCS.h:222
LayerData * layers
A LayerData array that stores all layers that describe the environment.
Definition: UUCS.h:236
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddCharacter(double x, double y, LayerIndex layerID, int &id, const char *profileName="default", bool collisionFreePlacement=true, CHARACTER_CONTROL_MODE controlMode=CHARACTER_CONTROL_MODE::UseSimulationDefault)
Adds a character to the simulation.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_PathFollowingMethod(int characterID, PathFollowingMethod::Type value)
Updates a character's path following method to the specified value.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_Cleanup()
Cleans up all modelling-related objects managed by this DLL (i.e. the active modelling environment/la...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_PathPlanningMethod(int characterID, PathPlanningMethod::Type &value)
Gets the type of a character's path planning method.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_GroupForcesMethod(int characterID, GroupForcesMethod::Type &value)
Gets the type of a character's group forces method.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CalculateDensityMapWithCharacters(int id, const int *charactersID, int characterNumber)
Performs a density map calculation step with a given character list.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetActivityAreaArrayLengths(int id, int &enteredLength, int &insideLength, int &leftLength)
Retrieves the lengths of the arrays containing the CharacterID's for the characters that entered...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_RemoveObstacle(PrimitiveIndex obstacleID)
Removes an obstacle from the active modelling environment.
LayerIndex layerID2
The ID of the second layer to which this connection is associated.
Definition: UUCS.h:178
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_Bool(int characterID, CHARACTER_PARAMETER parameter, bool &value)
Gets the value of a character parameter of type "bool".
PrimitiveIndex id
The ID of the walkable area. Each walkable area has a unique ID within the environment it belongs to...
Definition: UUCS.h:202
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterControlMode(int characterID, CHARACTER_CONTROL_MODE newMode)
Changes the control mode of a character.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetDensityMapSize(int id, int &width, int &height)
Gets the width and the height of a density map.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_LoadNavigationMeshFromFile(const char *filename)
Loads a precomputed navigation mesh (as an ECMX or ECM file) into the program.
double z
The Z coordinate of the vertex position.
Definition: UUCS.h:154
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_LoadEnvironmentFromMemory(EnvironmentData *environmentData)
Loads an environment (as an EnvironmentData struct) into the program and sets it as the active simula...
double yPosition
The y Position in the scenario.
Definition: UUCS.h:267
int numMembers
The number of members in the group.
Definition: UUCS.h:111
A struct that stores the IDs of the members of a character group in the simulation at some point in t...
Definition: UUCS.h:104
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Cleanup()
Cleans up all simulation-related objects managed by this DLL (i.e. the active simulation environment...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_AddCharacterToGroup(int characterID, int &groupID)
Adds an existing character as a member of a group.
int numLayers
The number of layers in the environment, i.e. the size of the layers array.
Definition: UUCS.h:238
int groupID
The ID of the group. Each simulated character group has a unique ID.
Definition: UUCS.h:107
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterStepData(CharacterStepData_Position *stepData, int numEntries)
Updates the position and orientation of externally controlled characters according to the specified s...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_SaveEnvironmentToFile(const char *filename)
Saves the active modelling environment as an ENV or PRI file.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterIndicativeRoute(int characterID, VertexDataWithLayer *path)
Retrieves and returns the points of a character's indicative route.
int numWalkableAreas
The number of walkable areas in the layer, i.e. the size of the walkableAreas array.
Definition: UUCS.h:224
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetMinorVersion(int &verMinor)
Retrieves the minor version of the UUCS API.
double density
Indicates whether the Character is moving or reached its goal.
Definition: UUCS.h:269
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepData(CharacterStepData_Position *&stepData_positions, int &numCharacters_positions, CharacterStepData_Velocity *&stepData_velocities, int &numCharacters_velocities)
Stores the positions and orientations of all characters in the simulation in the given array pointer...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterGoal(int characterID, double &x, double &y, LayerIndex &layerID, double &radius)
Retrieves the goal position of a character in the simulation, and lets the character plan a path towa...
A struct that represents a 2D position in the environment.
Definition: UUCS.h:119
Indicates that a Character is still moving.
Definition: UUCS.h:45
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterGroupData(CharacterGroupData *&cGData, int &numCharacterGroups)
Stores the IDs of the members of all character groups in the simulation in the given array pointer...
double xPosition
The x Position in the scenario.
Definition: UUCS.h:265
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SaveNavigationMeshToFile(const char *filename)
Saves the navigation mesh of the active simulation environment as an ECMX or ECM file.
double x
The X coordinate of the position.
Definition: UUCS.h:134
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_RemoveWalkableArea(PrimitiveIndex walkableAreaID)
Removes a walkable area from the active modelling environment.
int numConnections
The number of connections in the environment, i.e. the size of the connections array.
Definition: UUCS.h:242
double fx
The X component of the force vector that the character experiences according to this engine...
Definition: UUCS.h:91
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_IsDiscFreeOfObstacles(double x, double y, LayerIndex layerID, double radius, bool &free)
Checks whether the specified disc does not intersect any obstacles within the active simulation envir...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_PathPlanningMethod(int characterID, PathPlanningMethod::Type value)
Updates a character's path planning method to the specified value.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_CollisionAvoidanceMethod(int characterID, CollisionAvoidanceMethod::Type &value)
Gets the type of a character's collision avoidance method.
DensityMapType DENSITYMAP_TYPE
Definition: UUCS.h:290
DensityMapParameterName DENSITYMAP_PARAMETER
Definition: UUCS.h:289
#define UUCS_CALLCONV
Definition: UUCS.h:33
VertexData3D * vertices
A VertexData3D array that stores all vertices that describe the walkable area.
Definition: UUCS.h:204
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_SaveEnvironmentToMemory(EnvironmentData *&environmentData)
Stores the active modelling environment to an EnvironmentData object.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_Double(int characterID, CHARACTER_PARAMETER parameter, double value)
Updates a character parameter of type "double" to the specified value.
double x
The X coordinate of the position.
Definition: UUCS.h:122
int id
The ID of the character. Each simulated character has a unique ID.
Definition: UUCS.h:83
Indicates that there was an error while executing the called API function.
Definition: UUCS.h:281
Indicates that the Character reached its goal.
Definition: UUCS.h:47
double x
The X coordinate of the vertex position.
Definition: UUCS.h:150
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepDataInArea(double xMin, double yMin, double xMax, double yMax, LayerIndex layerID, CharacterStepData_Position *&stepData_positions, int &numCharacters_positions, CharacterStepData_Velocity *&stepData_velocities, int &numCharacters_velocities)
Stores the positions and orientations of all characters in the specified area in the given array poin...
A struct that stores the list of obstacles and walkable areas of a layer.
Definition: UUCS.h:213
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_ResetDensityMap(int id)
Reset a density map, all of the data will be reset to their initial values.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_ComputeNavigationMesh()
Computes the navigation mesh for the active simulation environment.
int numVertices
The number of vertices that describe the walkable area, i.e. the size of the vertices array...
Definition: UUCS.h:206
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterControlMode(int characterID, CHARACTER_CONTROL_MODE &result)
Gets the current control mode of a character.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterGoal(int characterID, double x, double y, LayerIndex layerID, double radius)
Sets the goal position of a character in the simulation, and lets the character plan a path towards i...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_LoadEnvironmentFromMemory(EnvironmentData *environmentData)
Loads an environment (as an EnvironmentData struct) into the program and sets it as the active modell...
double y
The Y coordinate of the character's position.
Definition: UUCS.h:63
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_AddWalkableArea(LayerIndex layerID, VertexData3D *vertices, int numVertices, PrimitiveIndex &walkableAreaID)
Adds a walkable area on the specified layer of the active modelling environment.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_Int(int characterID, CHARACTER_PARAMETER parameter, int &value)
Gets the value of a character parameter of type "int".
A struct that stores the two dimensional array index, the corresponded positions in the environment...
Definition: UUCS.h:258
PrimitiveIndex id
The ID of the obstacle. Each obstacle has a unique ID within the environment it belongs to...
Definition: UUCS.h:188
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetDensityMapParameter(int id, DENSITYMAP_PARAMETER parameter, double &value)
Gets the value of a density map parameter.
A struct that stores the velocity and orientation of a character in the simulation at some point in t...
Definition: UUCS.h:56
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameter_PathFollowingMethod(int characterID, PathFollowingMethod::Type &value)
Gets the type of a character's path following method.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetCharacterParameter_CollisionAvoidanceMethod(int characterID, CollisionAvoidanceMethod::Type value)
Updates a character's collision avoidance method to the specified value.
ConnectionData * connections
A ConnectionData array that stores all connections in the environment.
Definition: UUCS.h:240
double yMax
The maximum X coordinate of the environment.
Definition: UUCS.h:250
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_SimplifyPolygon(VertexData *originalVertices, int numVertices, float epsilon, VertexData *newVertices, int &numNewVertices)
Simplify a obstacle polygon.
#define UUCSAPI
Definition: UUCS.h:27
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CalculateDensityMap(int id)
Performs a density map calculation step.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterStepDataInRange(double xCenter, double yCenter, double radius, LayerIndex layerID, CharacterStepData_Position *&stepData_positions, int &numCharacters_positions, CharacterStepData_Velocity *&stepData_velocities, int &numCharacters_velocities)
Stores the positions and orientations of all characters in the specified range in the given array poi...
double xMin
The minimum X coordinate of the environment.
Definition: UUCS.h:244
CharacterParameterName CHARACTER_PARAMETER
Definition: UUCS.h:284
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_CreateEnvironment(const char *name)
Creates an empty modelling environment with the specified name and sets it as the active modelling en...
A struct that stores the list of vertices of an obstacle.
Definition: UUCS.h:185
ConnectionIndex id
The unique ID of the connection in the environment.
Definition: UUCS.h:166
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_GetCharacterParameterType(CHARACTER_PARAMETER parameter, PARAMETER_TYPE &type)
Gets the type of a given character parameter.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CreateDensityMap(LayerIndex layerIndex, int &id, double xMin=1.0, double yMin=1.0, double xMax=0.0, double yMax=0.0)
Create a density to a layer, with a given range The grid width is default 0.3m, and the agent measure...
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_DoSimulationStep()
Performs a simulation step.
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_CleanUpDensityMap(int id)
Cleans up a density map with ID.
LayerIndex layerID
The ID of the layer on which the character is located.
Definition: UUCS.h:65
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_Modelling_LoadEnvironmentFromFile(const char *filename)
Loads an environment (as an ENV or PRI file) into the program and sets it as the active modelling env...
LayerIndex layerID
The ID of the layer on which the character is located.
Definition: UUCS.h:85
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_LoadEnvironmentFromFile(const char *filename)
Loads an environment (as an ENV or PRI file) into the program and sets it as the active simulation en...
A struct that stores the list of layers of an environment and the environment boundaries.
Definition: UUCS.h:233
int y
The Y index of the grid.
Definition: UUCS.h:263
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SaveEnvironmentToMemory(EnvironmentData *&environmentData)
Stores the active simulation environment to an EnvironmentData object.
VertexData3D endpoint1
The first 3D endpoint of the connection.
Definition: UUCS.h:169
UUCSAPI STATUS_CODE UUCS_CALLCONV UUCS_SetDensityMapParameter(int id, DENSITYMAP_PARAMETER parameter, double value)
Updates a density map parameter to the specified value.
double diry
The Y component of the character's orientation vector.
Definition: UUCS.h:69
ObstacleData * obstacles
An ObstacleData array that stores all obstacles in the layer.
Definition: UUCS.h:218
A struct that stores the 3D position of a vertex in the environment.
Definition: UUCS.h:147
CharacterMovingState movingState
Indicates whether the Character is moving or reached its goal.
Definition: UUCS.h:95