Click or drag to resize

IPhysicsUtils.ApplyGravity Method

Applies the forces that affect a rigidbody on a celestial body.

Namespace:  KASAPIv2
Assembly:  KAS-API-v2 (in KAS-API-v2.dll) Version: KAS API v2
Syntax
C#
void ApplyGravity(
	Rigidbody rb,
	Vessel vessel,
	double rbAirDragMult = 1
)
Request Example View Source

Parameters

rb
Type: UnityEngine.Rigidbody
The rigidbody to apply the forces to.
vessel
Type: (Default Namespace).Vessel
The vessel to use as a base point for the gravity and atmosphere properties. When there is no good choice, just pick the closest one.
rbAirDragMult (Optional)
Type: System.Double
The multiplier that tells how significantly the rigidbody is resisting to the air flow.
Remarks
This method replicates the logic from FlightIntegrator for the physical objects. Alas, this method is not available for a plain rigidbody.
See Also