Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | Namespace Members | Class Members

Environment Namespace Reference


Detailed Description

Environment contains variables for the physics, and the topological nature of the world (cyclic in X/Y or not).

Author:
Nicolas Brodu


Functions

const double wrappedDist2 (const osg::Vec3d &p1, const osg::Vec3d &p2)
 Compute the squared distance between 2 points, taking in account the world wrap if this is the case.
const double wrapCoord (double coord, const double &offset, const double &cycle)
const osg::Vec3d wrapPosition (const osg::Vec3d &position)
 Return a position inside the world primary cycle/offset from the given position.
const osg::Vec3d wrappedDiffVector (const osg::Vec3d &p1, const osg::Vec3d &p2)
 Return the p1 - p2 vector, taking in account the world wrap.
const double square (const double &x)
 allow to use const temporaries instead of declaring variables

Variables

double cycleX = 0.0
 Set this value to the world diameter in X Default is 0.0, meaning no cycle.
double cycleY = 0.0
 Set this value to the world diameter in Y Default is 0.0, meaning no cycle.
double cycleOffsetX = 0.0
 Set this value to the offset in world position which represents a boundary limit Default is 0.0.
double cycleOffsetY = 0.0
 Set this value to the offset in world position which represents a boundary limit Default is 0.0.
double dragCoefficient = 0.0
 Drag allows moving objects to stop when no energy remains.
double gravity = 0.0
 Gravity takes place after clamping to max force, it's not of the agents resort.
Simulatorsimu = 0
 Global simulation manager. Null by default, please allocate this according to your system.
EventQueueViewerviewer = 0
 In graphical mode, global reference to the (modified) OSG Viewer. Null by default, please allocate this in the main program, with the next function if necessary.
DrawableSporeCloudcloud = 0
 The spore cloud for the agents. Null by default, please set this up in the main program if you use it.
osg::Group * root = 0
double agentsAITimeStep = 0.15
 Simulation time steps. To be provided by the main application.
double agentsIntegrationTimeStep = 0.04
double cloudIntegrationTimeStep = 0.3
bool batch = false
 Whether to update the graphical osg parts or not.
int WindowWidth = 800
 Window parameters. Defaults to 800, 600, 240, 212 (centered on 1280/1024) TODO: Auto-detect screen dimensions. Temporary workaround: set these values in your main program before allocating the viewer.
int WindowHeight = 600
int WindowXOffset = 240
int WindowYOffset = 212
const double Infinity
 OS dependent code: do our best.


Function Documentation

const osg::Vec3d Environment::wrappedDiffVector const osg::Vec3d &  p1,
const osg::Vec3d &  p2
 

Return the p1 - p2 vector, taking in account the world wrap.

This is not the same as wrapping the positions and substracting!

const osg::Vec3d Environment::wrapPosition const osg::Vec3d &  position  ) 
 

Return a position inside the world primary cycle/offset from the given position.

Has no effect when not wrapping


Variable Documentation

double Environment::cycleOffsetX = 0.0
 

Set this value to the offset in world position which represents a boundary limit Default is 0.0.

Note: This value is overriden by a call to createLocalityDatabase with a cyclic condition (the default). Thus, just calling createLocalityDatabase would set this value properly. This value is still settable for cases where a locality database isn't used.

double Environment::cycleOffsetY = 0.0
 

Set this value to the offset in world position which represents a boundary limit Default is 0.0.

Note: This value is overriden by a call to createLocalityDatabase with a cyclic condition (the default). Thus, just calling createLocalityDatabase would set this value properly. This value is still settable for cases where a locality database isn't used.

double Environment::cycleX = 0.0
 

Set this value to the world diameter in X Default is 0.0, meaning no cycle.

Note: This value is overriden by a call to createLocalityDatabase with a cyclic condition (the default). Thus, just calling createLocalityDatabase would set this value properly. This value is still settable for cases where a locality database isn't used.

double Environment::cycleY = 0.0
 

Set this value to the world diameter in Y Default is 0.0, meaning no cycle.

Note: This value is overriden by a call to createLocalityDatabase with a cyclic condition (the default). Thus, just calling createLocalityDatabase would set this value properly. This value is still settable for cases where a locality database isn't used.

double Environment::dragCoefficient = 0.0
 

Drag allows moving objects to stop when no energy remains.

Moving objects are slowed down by dragCoefficient times their squared speed value. Default value is 0.0.

double Environment::gravity = 0.0
 

Gravity takes place after clamping to max force, it's not of the agents resort.

It adds a -z component to the force.

Note: gravity is only applied when calling setSteeringForce, which is normally called at AI update frequency. In the case of an object with no AI, please call setSteeringForce once after setting the gravity, or the object won't move at all! Note2: There is no gravity by default.

const double Environment::Infinity
 

Initial value:

 
    std::numeric_limits<double>::has_infinity ?
    std::numeric_limits<double>::infinity() :




    std::numeric_limits<double>::max()
OS dependent code: do our best.


Generated on Mon Mar 28 11:28:17 2005 for Crogai by  doxygen 1.4.1