Show / Hide Table of Contents

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.Double minRadius

Minimum gravity radius before gravity intensity begins to decrease

System.Double maxRadius

Max gravity radius at lowest intensity

System.Double falloff

Gravity falloff between minRadius and maxRadius

System.Double intensity

Gravity strength

Returns
Type Description
IMySphericalNaturalGravityComponent

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
IMyEntity entity

The entity you're adding gravity to

System.Double minRadius

Minimum gravity radius before gravity intensity begins to decrease

System.Double maxRadius

Max gravity radius at lowest intensity

System.Double falloff

Gravity falloff between minRadius and maxRadius

System.Double intensity

Gravity strength

Returns
Type Description
IMySphericalNaturalGravityComponent

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

IMyModAPINaturalGravityImplementation implementation

ModAPI custom gravity provider

Returns
Type Description
IMyModAPINaturalGravityComponent

AddNaturalModAPIGravityToEntity(IMyEntity, IMyModAPINaturalGravityImplementation)

Adds natural gravity to an entity.

Declaration
IMyModAPINaturalGravityComponent AddNaturalModAPIGravityToEntity(IMyEntity entity, IMyModAPINaturalGravityImplementation implementation)
Parameters
Type Name Description
IMyEntity entity

The entity you're adding gravity to

IMyModAPINaturalGravityImplementation implementation

Minimum gravity radius before gravity intensity begins to decrease

Returns
Type Description
IMyModAPINaturalGravityComponent

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.Single

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.Single 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
IMyEntity entity

Entity to check for gravity

Returns
Type Description
System.Boolean

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.Double raySize

Size of the ray to test with. (Cylinder test)

Returns
Type Description
System.Boolean

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

IMyNaturalGravityComponent nearestProvider

Outputs the strongest natural gravity component detected

Returns
Type Description
System.Double

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.Double sphereSize

Sphere size to test with.

Returns
Type Description
System.Boolean

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
IMyNaturalGravityComponent 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
IMyEntity entity

The entity you're removing natural gravity from.

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾