Interface IMyGravityProviderSystem
Describes gravity ModAPI
Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyGravityProviderSystem
Methods
AddNaturalGravity(Vector3D, Double, Double, Double, Double)
Adds natural gravity to a position.
Declaration
IMySphericalNaturalGravityComponent AddNaturalGravity(Vector3D position, double minRadius, double maxRadius, double falloff, double intensity)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | position | Position coordinates at the center of the natural gravity |
System. |
minRadius | Minimum gravity radius before gravity intensity begins to decrease |
System. |
maxRadius | Max gravity radius at lowest intensity |
System. |
falloff | Gravity falloff between minRadius and maxRadius |
System. |
intensity | Gravity strength |
Returns
Type | Description |
---|---|
IMy |
AddNaturalGravityToEntity(IMyEntity, Double, Double, Double, Double)
Adds natural gravity to an entity.
Declaration
IMySphericalNaturalGravityComponent AddNaturalGravityToEntity(IMyEntity entity, double minRadius, double maxRadius, double falloff, double intensity)
Parameters
Type | Name | Description |
---|---|---|
IMy |
entity | The entity you're adding gravity to |
System. |
minRadius | Minimum gravity radius before gravity intensity begins to decrease |
System. |
maxRadius | Max gravity radius at lowest intensity |
System. |
falloff | Gravity falloff between minRadius and maxRadius |
System. |
intensity | Gravity strength |
Returns
Type | Description |
---|---|
IMy |
AddNaturalModAPI(Vector3D, IMyModAPINaturalGravityImplementation)
Adds natural gravity to a position.
Declaration
IMyModAPINaturalGravityComponent AddNaturalModAPI(Vector3D position, IMyModAPINaturalGravityImplementation implementation)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | position | Position coordinates at the center of the natural gravity |
IMy |
implementation | ModAPI custom gravity provider |
Returns
Type | Description |
---|---|
IMy |
AddNaturalModAPIGravityToEntity(IMyEntity, IMyModAPINaturalGravityImplementation)
Adds natural gravity to an entity.
Declaration
IMyModAPINaturalGravityComponent AddNaturalModAPIGravityToEntity(IMyEntity entity, IMyModAPINaturalGravityImplementation implementation)
Parameters
Type | Name | Description |
---|---|---|
IMy |
entity | The entity you're adding gravity to |
IMy |
implementation | Minimum gravity radius before gravity intensity begins to decrease |
Returns
Type | Description |
---|---|
IMy |
CalculateArtificialGravityInPoint(Vector3D)
Provides a vector of all artificial gravity at a set of coordinates.
Declaration
Vector3 CalculateArtificialGravityInPoint(Vector3D worldPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPoint | Position coordinates to check |
Returns
Type | Description |
---|---|
Vector3 |
CalculateHighestNaturalGravityMultiplierInPoint(Vector3D)
Provides the highest natural gravity multiplier at a set of coordinates.
Declaration
float CalculateHighestNaturalGravityMultiplierInPoint(Vector3D worldPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPoint | Position coordinates to check |
Returns
Type | Description |
---|---|
System. |
CalculateNaturalGravityInPoint(Vector3D)
Provides a vector of all natural gravity at a set of coordinates.
Declaration
Vector3 CalculateNaturalGravityInPoint(Vector3D worldPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPoint | Position coordinates to check |
Returns
Type | Description |
---|---|
Vector3 |
CalculateNaturalGravityInPoint(Vector3D, out Single)
Calculates all natural gravity at provided coordinates, returns gravity vector, and outputs gravity multiplier
Declaration
Vector3 CalculateNaturalGravityInPoint(Vector3D worldPoint, out float naturalGravityMultiplier)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPoint | Position coordinates to check |
System. |
naturalGravityMultiplier | Gravity multiplier output |
Returns
Type | Description |
---|---|
Vector3 |
CalculateTotalGravityInPoint(Vector3D)
Provides a vector of all natural and artificial gravity at a sec of coordinates.
Declaration
Vector3 CalculateTotalGravityInPoint(Vector3D worldPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPoint | Position coordinates to check |
Returns
Type | Description |
---|---|
Vector3 |
DoesEntityHaveGravityProvider(IMyEntity)
Determines if a provided entity is generating gravity (artificial or natural).
Declaration
bool DoesEntityHaveGravityProvider(IMyEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IMy |
entity | Entity to check for gravity |
Returns
Type | Description |
---|---|
System. |
DoesTrajectoryIntersectNaturalGravity(Vector3D, Vector3D, Double)
Checks if the specified trajectory intersects any natural gravity wells.
Declaration
bool DoesTrajectoryIntersectNaturalGravity(Vector3D start, Vector3D end, double raySize = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | start | Starting point of the trajectory. |
Vector3D | end | Destination of the trajectory. |
System. |
raySize | Size of the ray to test with. (Cylinder test) |
Returns
Type | Description |
---|---|
System. |
GetStrongestNaturalGravityWell(Vector3D, out IMyNaturalGravityComponent)
Determines the strongest natural gravity source at a given set of coordinates.
Declaration
double GetStrongestNaturalGravityWell(Vector3D worldPosition, out IMyNaturalGravityComponent nearestProvider)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | worldPosition | Position coordinates to check |
IMy |
nearestProvider | Outputs the strongest natural gravity component detected |
Returns
Type | Description |
---|---|
System. |
Gravity intensity value |
IsPositionInNaturalGravity(Vector3D, Double)
This quickly checks if a given position is in any natural gravity.
Declaration
bool IsPositionInNaturalGravity(Vector3D position, double sphereSize = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | position | Position to check |
System. |
sphereSize | Sphere size to test with. |
Returns
Type | Description |
---|---|
System. |
True if there is natural gravity at this position, false otherwise. |
RemoveNaturalGravity(IMyNaturalGravityComponent)
Removes the natural gravity component provided.
Declaration
void RemoveNaturalGravity(IMyNaturalGravityComponent gravity)
Parameters
Type | Name | Description |
---|---|---|
IMy |
gravity | Natural gravity component to remove. |
RemoveNaturalGravityFromEntity(IMyEntity)
Removes the natural gravity from a provided entity.
Declaration
void RemoveNaturalGravityFromEntity(IMyEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IMy |
entity | The entity you're removing natural gravity from. |