Public Member Functions

bl7::rigidbodies2::Buoyancy Class Reference

#include <Buoyancy.h>

Inheritance diagram for bl7::rigidbodies2::Buoyancy:
bl7::rigidbodies2::ForceGenerator

List of all members.

Public Member Functions

virtual ~Buoyancy (void)
 Buoyancy (const float volume, const float max_depth, const ml7::Vector2 &center, const float density=1000.0f, const ml7::Vector2 &surface=ml7::Vector2(0.0f, 1.0f), const ml7::Vector2 &origin=ml7::Vector2(0.0f, 0.0f))
float get_volume () const
float get_max_depth () const
const ml7::Vector2get_center () const
float get_density () const
const ml7::Vector2get_surface () const
const ml7::Vector2get_origin () const
void set_volume (const float volume)
void set_max_depth (const float max_depth)
void set_center (const ml7::Vector2 &center)
void set_density (const float density)
void set_surface (const ml7::Vector2 &surface)
void set_origin (const ml7::Vector2 &origin)

Detailed Description

A force generator that applies buoyancy forces to 2d rigid bodies. One instance may be used for multiple rigid bodies, if they all are about to have the same volume (and shape).


Constructor & Destructor Documentation

virtual bl7::rigidbodies2::Buoyancy::~Buoyancy ( void   )  [inline, virtual]

Destructor.

bl7::rigidbodies2::Buoyancy::Buoyancy ( const float  volume,
const float  max_depth,
const ml7::Vector2 center,
const float  density = 1000.0f,
const ml7::Vector2 surface = ml7::Vector2(0.0f, 1.0f),
const ml7::Vector2 origin = ml7::Vector2(0.0f, 0.0f) 
) [inline]

Explicit constructor with parameters specifying the volume of sunken objects (rigid bodies), the depth from which the maximum buoyancy force is reached, the center point of buoyancy in body coordinates, the density of the liquid, the surface normal (and height above 0 as the vector's magnitude) and the origin, the surface relates to.


Member Function Documentation

const ml7::Vector2& bl7::rigidbodies2::Buoyancy::get_center (  )  const [inline]

Returns the center point of buoyancy in body coordinates.

float bl7::rigidbodies2::Buoyancy::get_density (  )  const [inline]

Returns the density of the liquid.

float bl7::rigidbodies2::Buoyancy::get_max_depth (  )  const [inline]

Returns the submersion depth from which the maximum buoyancy is reached.

const ml7::Vector2& bl7::rigidbodies2::Buoyancy::get_origin (  )  const [inline]

Returns the origin to which the surface normal and level relate.

const ml7::Vector2& bl7::rigidbodies2::Buoyancy::get_surface (  )  const [inline]

Returns the surface normal (and height/level above 0) of the liquid.

float bl7::rigidbodies2::Buoyancy::get_volume (  )  const [inline]

Returns the volume of objects (rigid bodies).

void bl7::rigidbodies2::Buoyancy::set_center ( const ml7::Vector2 center  )  [inline]

Sets the center point of buoyancy in body coordinates.

void bl7::rigidbodies2::Buoyancy::set_density ( const float  density  )  [inline]

Sets the density of the liquid.

void bl7::rigidbodies2::Buoyancy::set_max_depth ( const float  max_depth  )  [inline]

Sets the submersion depth from which the maximum buoyancy is reached.

void bl7::rigidbodies2::Buoyancy::set_origin ( const ml7::Vector2 origin  )  [inline]

Sets the origin to which the surface normal and level relate.

void bl7::rigidbodies2::Buoyancy::set_surface ( const ml7::Vector2 surface  )  [inline]

Sets the surface normal (and height/level above 0) of the liquid.

void bl7::rigidbodies2::Buoyancy::set_volume ( const float  volume  )  [inline]

Sets the colume of objects (rigid bodies).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines