fob::bird Class Reference

A bird in a Flock of Birds. More...

#include <fob.h>

Collaboration diagram for fob::bird:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 bird (fob &parent)
 Default constructor.
 bird (const bird &cpy)
 Copy constructor.
 ~bird (void)
 Default destructor.
const birdoperator= (const bird &rhs)
 Assignment operator.
void get_position (math::vector3 &output) const
 Gets the bird's position.
void get_position (real_t output[3]) const
 Gets the bird's position.
void get_angles (math::vector3 &output)
 Gets the bird's angles (in degress).
void get_angles (real_t output[3])
 Gets the bird's angles (in degress).
void get_quaternion (math::quaternion &output)
 Gets the bird's orientation.
void get_quaternion (real_t output[4])
 Gets the bird's orientation.
void get_matrix (math::matrix4 &output)
 Gets a 4x4 matrix describing the bird's orientation/position.
void get_matrix (real_t output[16])
 Gets a 4x4 matrix describing the bird's orientation/position.
bool set_mode (fob::mode mask)
 Sets what type of data we will get back from the flock for this bird.
void set_rotation (const math::quaternion &rot)
 Applies the given rotation to the each orientation update.
unsigned char get_buttons (void) const
 Returns the currently pressed button.

Friends

class fob


Detailed Description

A bird in a Flock of Birds.

Definition at line 129 of file fob.h.


Member Function Documentation

void fob::bird::get_angles ( real_t  output[3]  )  [inline]

Gets the bird's angles (in degress).

Rotations are relative to the fixed global coordinate frame.

Definition at line 277 of file fob.h.

void fob::bird::get_angles ( math::vector3 output  )  [inline]

Gets the bird's angles (in degress).

Rotations are relative to the fixed global coordinate frame.

Definition at line 264 of file fob.h.

unsigned char fob::bird::get_buttons ( void   )  const [inline]

Returns the currently pressed button.

The flock hardware is not capable of determing if multiple buttons are pressed. If multiple buttons are pressed, any of the pressed buttons may be returned. You can check to see if a button was pressed as follows:

 if( buttons == fob::BUTTON_LEFT )        //left pressed
 else if( buttons == fob::BUTTON_MIDDLE ) //middle pressed
 else if( buttons == fob::BUTTON_RIGHT )  //right pressed
 else                                     //nothing pressed

Definition at line 359 of file fob.h.

void fob::bird::get_matrix ( real_t  output[16]  )  [inline]

Gets a 4x4 matrix describing the bird's orientation/position.

The returned matrix is in row major format.

Definition at line 327 of file fob.h.

void fob::bird::get_matrix ( math::matrix4 output  )  [inline]

Gets a 4x4 matrix describing the bird's orientation/position.

The returned matrix is in row major format.

Definition at line 314 of file fob.h.

bool fob::bird::set_mode ( fob::mode  mask  ) 

Sets what type of data we will get back from the flock for this bird.

Parameters:
mask Bitwised or'ed fob::mode telling what data we want back from the flock. Options are fob::POSITION, fob::ORIENTATION, and fob::BUTTONS.
Returns:
true on success. false on error. Flock that bird is apart of contains error message on error.

Definition at line 168 of file fob.cpp.

References fob::BUTTONS, fob::check_error(), fob::clear_device(), fob::ORIENTATION, fob::POSITION, fob::select_bird(), fob::send_cmd(), and fob::set_error().


Generated on Sat Feb 21 16:38:10 2009 for Flock of Birds Library by  doxygen 1.5.7.1