Ctrl+K

BuoyancyController

Declaration

public sealed class tainicom.Aether.Physics2D.Controllers.BuoyancyController

Inherits: tainicom.Aether.Physics2D.Controllers.Controller

Constructors

BuoyancyController

Initializes a new instance of the BuoyancyController class.

void BuoyancyController(AABB container, float density, float linearDragCoefficient, float rotationalDragCoefficient, Vector2 gravity)

Parameters:

Name Type Description
container tainicom.Aether.Physics2D.Collision.AABB Only bodies inside this AABB will be influenced by the controller
density System.Single Density of the fluid
linearDragCoefficient System.Single Linear drag coefficient of the fluid
rotationalDragCoefficient System.Single Rotational drag coefficient of the fluid
gravity Strawberry.Math.Vector2 The direction gravity acts. Buoyancy force will act in opposite direction of gravity.

Properties

Container

AABB Container { get set }

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.

float AngularDragCoefficient

Density

Density of the fluid. Higher values will make things more buoyant, lower values will cause things to sink.

float Density

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.

float LinearDragCoefficient

Velocity

Acts like waterflow. Defaults to 0,0.

Vector2 Velocity

Methods

Update override

void Update(float dt)

Parameters:

Name Type Description
dt System.Single