Boid Class Reference

A single little something, maybe a bird, maybe a fly, maybe a robot. More...

#include <boid.h>

List of all members.

Public Member Functions

 Boid (irr::IrrlichtDevice *d, const irr::c8 *filePath)
 Boid (irr::IrrlichtDevice *d, Boid &other)
 ~Boid ()
 Destructor.
void update (irr::u32 deltaTime)
void setScale (irr::f32 scale)
bool inBoidNeighborhood (Boid *other, irr::f32 minDistance, irr::f32 maxDistance, irr::f32 cosMaxAngle)
void addDebugText (irr::c8 *text, irr::s32 value)

Public Attributes

irr::core::vector3df position
irr::core::vector3df velocity
 Public accessible speed. All FlockAnimators alter this.
irr::core::vector3df speed
irr::core::vector3df forward
 Public accessible forward (synonym: orientation, lookAt, direction).
irr::core::stringc meshFilePath


Detailed Description

A single little something, maybe a bird, maybe a fly, maybe a robot.

Holds a mesh and update its position according to last position and velocity.

Definition at line 10 of file boid.h.


Constructor & Destructor Documentation

Boid::Boid irr::IrrlichtDevice *  d,
const irr::c8 *  filePath
 

Constructor.

Parameters:
d : An IrrclichtDevice*, needed to access media.
filePath : A string (path and name) of a config file. Data driven Boid creation can be done with this.

Boid::Boid irr::IrrlichtDevice *  d,
Boid other
 

Copy Constructor.

Parameters:
d : An IrrlichtDevice*, needed to access media.
other : A reference to another Boid, which will be cloned.


Member Function Documentation

void Boid::addDebugText irr::c8 *  text,
irr::s32  value
 

Renders text as debug information right below the Boid. This can be performed multiple times per frame, thus anybody who has a reference or pointer to this Boid can add some debug information.

Parameters:
text : A string as hint to dislpay
value : A signed integer as value to dislpay

bool Boid::inBoidNeighborhood Boid other,
irr::f32  minDistance,
irr::f32  maxDistance,
irr::f32  cosMaxAngle
 

Checks if an other Boid is in this Boid neighborhood.

Parameters:
other : A pointer to a Boid, which should be tested.
minDistance : A float, as minimum radius of neighborhood.
maxDistance : A float, as maximum radius of neighborhood.
cosMaxAngle : A float, as angle where this Boid can "see" other Boid.
Returns:
Returns true if other Boid is this Boid neighborhood.

void Boid::setScale irr::f32  scale  ) 
 

Sets scale of Boid mesh. A single float is used to extrude mesh in all 3 dimensions of space.

Parameters:
scale : A float defining new scale of Boid mesh.

void Boid::update irr::u32  deltaTime  ) 
 

Call this every frame to render the Boid mesh into scene.

Parameters:
deltaTime : An unsigned integer representing milliseconds since last call.


Member Data Documentation

irr::core::stringc Boid::meshFilePath
 

Public accessible path and name to *.3ds file.

Todo:
make this private.

Definition at line 68 of file boid.h.

irr::core::vector3df Boid::position
 

Public accessible position in 3d space.

Todo:
make this private (we must secure no one alters position directly).

Definition at line 54 of file boid.h.

irr::core::vector3df Boid::speed
 

Public accessible speed.

Todo:
speed not used? or change type to f32?

Definition at line 61 of file boid.h.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 17:09:58 2007 for Swarm by  doxygen 1.4.6-NO