Class BuoyancyController
- Namespace
- Alis.Core.Physic.Controllers
- Assembly
- Alis.dll
The buoyancy controller class
public sealed class BuoyancyController : ControllerInheritance
Inherited Members
Constructors
BuoyancyController(AABB, float, float, float, Vector2)
Initializes a new instance of the Alis.Core.Physic.Controllers.BuoyancyController class.
public BuoyancyController(AABB container, float density, float linearDragCoefficient, float rotationalDragCoefficient, Vector2 gravity)Parameters
containerAABB-
Only bodies inside this AABB will be influenced by the controller
densityfloat-
Density of the fluid
linearDragCoefficientfloat-
Linear drag coefficient of the fluid
rotationalDragCoefficientfloat-
Rotational drag coefficient of the fluid
gravityVector2-
The direction gravity acts. Buoyancy force will act in opposite direction of gravity.
Fields
AngularDragCoefficient
Controls the rotational drag that the fluid exerts on the bodies within it. Use higher values will simulate thick fluid, like honey, lower values to simulate water-like fluids.
public float AngularDragCoefficientField Value
Density
Density of the fluid. Higher values will make things more buoyant, lower values will cause things to sink.
public float DensityField Value
LinearDragCoefficient
Controls the linear drag that the fluid exerts on the bodies within it. Use higher values will simulate thick fluid, like honey, lower values to simulate water-like fluids.
public float LinearDragCoefficientField Value
Velocity
Acts like waterflow. Defaults to 0,0.
public Vector2 VelocityField Value
_container
The container
private AABB _containerField Value
_gravity
The gravity
private readonly Vector2 _gravityField Value
_normal
The normal
private Vector2 _normalField Value
_offset
The offset
private float _offsetField Value
_uniqueBodies
The body
private readonly ICollection<Body> _uniqueBodiesField Value
Properties
Container
Gets or sets the value of the container
public AABB Container { get; set; }Property Value
Methods
Update(float)
Updates the dt
public override void Update(float dt)Parameters
dtfloat-
The dt