The types and functions described here can be found in the ANSI C header files
RclsoftwareGravelv3PhyApiTypes.h and RclsoftwareGravelv3PhyApi.h.
Type definitions
Standard built-in type definitions
Return value enumeration
Timeframe enumeration
Gravel handle type definition
Gravel 3D vector definition
Gravel object definition
API functions
Standard built-in type definitions
| bool8_t | 8-bit boolean (1 == true, 0 == false) |
| uint8_t | 8-bit unsigned byte |
| uint64_t | 64-bit unsigned integer |
| float64_t | 64-bit IEEE 754 floating point number |
| size_t | 32-bit unsigned integer (same size as a pointer) |
/***********************
GravelAPIResult
***********************/
typedef enum GravelAPIResultTAG
{
gravelResultOk = 0x0000,
gravelResultInsideObject = 0x0001,
gravelResultException = 0x0101,
gravelResultNullPointer = 0x0102,
gravelResultInvalidHandle = 0x0103,
gravelResultInvalidParameter = 0x0104,
gravelResultMemoryAllocationFailure = 0x0105,
gravelResultErrorMask = 0x7fffFF00,
gravelResultForce32BitEnum = 0x7fffFFFF
}
GravelAPIResult;
|
A 32bit enumeration describing the possible return values of the API's functions.
| gravelResultOk | The function completed successfully. |
| gravelResultInsideObject | Warning: The specified location is inside an object. |
| gravelResultException | Error: An exception occured. |
| gravelResultNullPointer | Error: One of the parameters is a null pointer. |
| gravelResultInvalidHandle | Error: One of the parameters is a null handle. |
| gravelResultInvalidParameter | Error: One of the parameters is invalid. |
| gravelResultMemoryAllocationFailure | Error: The required memory could not be allocated. |
Note:
/**************************
GravelAPITimeframe
**************************/
typedef enum GravelAPITimeframeTAG
{
gravelTimeframeSeconds = 0,
gravelTimeframeMinutes = 1,
gravelTimeframeHours = 2,
gravelTimeframeForce32BitEnum = 0x7fffFFFF
}
GravelAPITimeframe;
|
A 32bit enumeration describing the timeframes supported by Gravel v3.
The timeframe specifies the timeunit of the simulation:
| Timeframe | Velocity | Acceleration |
| gravelTimeframeSeconds | Meters per second | Meters per second per second |
| gravelTimeframeMinutes | Meters per minute | Meters per minute per minute |
| gravelTimeframeHours | Meters per hour | Meters per hour per hour |
/***************************
GravelAPISceneHandle
***************************/
struct GravelAPISceneTAG;
typedef struct GravelAPISceneTAG* GravelAPISceneHandle;
|
The GravelAPISceneHandle identifies an individual Gravel scene.
It is obtained by calling createGravelScene or createGravelSceneWithData, and is a required parameter for all other API functions.
/**********************
GravelAPIVector
**********************/
typedef struct GravelAPIVectorTAG /* win32: 24 bytes */
{
float64_t x;
float64_t y;
float64_t z;
}
GravelAPIVector;
|
This structure describes a 3D vector in Gravel.
/**********************
GravelAPIObject
**********************/
typedef struct GravelAPIObjectTAG /* win32: 80 bytes */
{
float64_t mass; /* kilograms */
float64_t equatorialRadius; /* meters */
float64_t polarDiameter; /* meters */
GravelAPIVector location; /* meters */
GravelAPIVector velocity; /* meters per timeunit */
const uint8_t* data; /* Generic data */
size_t dataLength; /* Data length */
}
GravelAPIObject;
typedef const GravelAPIObject* GravelAPIObjectCPointer;
|
This structure describes all the information about an astronomical object that Gravel needs in order to simulate its behaviour:
| mass | The mass of the object, in kilo-grams. |
| equatorialRadius polarDiameter |
The size of the object, in meters. For the purpose of collision detection, Gravel v3 uses these two values to calculate the size of a sphere which fully encloses the object. |
| location | A vector describing the location of the object, in meters. |
| velocity | A vector describing the velocity of the object, in meters per timeunit. |
| data dataLength | Generic data which is stored with the object. This could for instance be graphics information used for rendering the object in a 3D view. |
Description: Parameters:
|
Description: Parameters:
Remarks: |
Description: Parameters:
Remarks: |
|
calculateLocalGravelAcceleration
Description:
Parameters:
Remarks: |
Description: Parameters:
|
Description: Parameters:
Remarks: |
Description: Deletes the Gravel scene. Parameters:
|
Description: Parameters:
|
Description: Parameters:
|
Description: Parameters:
Remarks: |
Description: Parameters:
Remarks: |
Description: Parameters:
|
Description: Parameters:
|
Description: Parameters:
|
Description: Parameters:
Remarks: |