Fluid interaction subtype for Arbiter.

Constructor

new()

@private

Variables

overlap:Float

Overlap area of Shapes in fluid interaction.

This value is strictly positive, and represents the amount of overlap between the Shapes used in buoyancy computations.

This value can be modified during a related PreListener handler.

position:Vec2

Centre of buoyancy for fluid interaction.

This value can be modified during a related PreListener handler.

Methods

@:value({ body : null })buoyancyImpulse(?body:Body):Vec3

Determine impulse on a given body due to buoyancy.

If the body is null, then the buoyancy impulse will be returned without consideration to any specific body involved, and no angular impulses can be derived.

Parameters:

body

The body to query impulse for. (default null)

Returns:

The buoyancy impulse for given body.

Throws:

#

If body is non-null, and unrelated to this Arbiter.

@:value({ body : null })dragImpulse(?body:Body):Vec3

Determine impulse on a given body due to fluid drag.

If the body is null, then the drag impulse will be returned without consideration to any specific body involved.

Parameters:

body

The body to query impulse for. (default null)

Returns:

The drag impulse for given body.

Throws:

#

If body is non-null, and unrelated to this Arbiter.

@:value({ freshOnly : false, body : null })totalImpulse(?body:Body, freshOnly:Bool = false):Vec3

Determine total impulse on a given body due to fluid interaction.

If the body is null, then the total impulse will be computed without consideration to any specific body involved, and no angular impulses can be derived for the linear portion of the impulses.

Parameters:

body

The body to query impulse for. (default null)

freshOnly

This parameter is unused for FluidArbiters. (default false)

Returns:

The total impulse for given body.

Throws:

#

If body is non-null, and unrelated to this Arbiter.

Inherited Variables

Defined by Arbiter

read onlybody1:Body

The first body in Arbiter interaction.

It will always be the case that arb.shape1.body == arb.body1

read onlybody2:Body

The second body in Arbiter interaction.

It will always be the case that arb.shape2.body == arb.body2

read onlycollisionArbiter:Null<CollisionArbiter>

Fast equivalent to casting this object to a CollisionArbiter.

This value is null when this arbiter is not a collision type.

read onlyfluidArbiter:Null<FluidArbiter>

Fast equivalent to casting this object to a FluidArbiter.

This value is null when this arbiter is not a fluid type.

read onlyisSleeping:Bool

Flag representing arbiter sleep state.

When true, this arbiter is sleeping.

read onlyshape1:Shape

The first shape in Arbiter interaction.

It will always be the case that arb.shape1.id < arb.shape2.id

read onlyshape2:Shape

The second shape in Arbiter interaction.

It will always be the case that arb.shape1.id < arb.shape2.id

read onlystate:PreFlag

The interaction state of this Arbiter.

This flag will, except for in a PreListener handler, always be either ImmState.ACCEPT or ImmState.IGNORE
During a PreListener handler, you can query this property to see what the current state of the arbiter has been set to, and returning null from the handler will keep the state unchanged.

read onlytype:ArbiterType

The type of this Arbiter.

@:value(null)zpp_inner:ZPP_Arbiter = null

@private

Inherited Methods

Defined by Arbiter

inlineisCollisionArbiter():Bool

Equivalent to: arb.type == ArbiterType.COLLISION

Returns:

True if this Arbiter is a Collision type arbiter.

inlineisFluidArbiter():Bool

Equivalent to: arb.type == ArbiterType.FLUID

Returns:

True if this Arbiter is a Fluid type arbiter.

inlineisSensorArbiter():Bool

Equivalent to: arb.type == ArbiterType.SENSOR

Returns:

True if this Arbiter is a Sensor type arbiter.

@:keeptoString():String

@private