world::World Class Reference

World class is a container of 3D objects. More...

#include <src_world_world.hh>

List of all members.

Public Member Functions

 World (void)
 ~World ()
void Make (void)
void Attach (SharedPtr< Object > object, const StateBits stateBits=STATE_BIT_DEFAULT, const RefPtr< osg::StateSet > stateSet=new osg::StateSet)
void Attach (RefPtr< Node > node, const StateBits stateBits=STATE_BIT_DEFAULT, const RefPtr< osg::StateSet > stateSet=new osg::StateSet)
void Detach (SharedPtr< Object > object)
void Detach (RefPtr< Node > node)
void OptimizeSceneGraph (void)
bool IfFlat (void)
WorldVertex GetPosition (void)
fp GetRadius (void)
bool SetCompression (const bool enable)
fpx GetCompressionScale (void)
void RotateTangential (Object &object, const SphereVertex &sv)
const Matrix & GetTangentMatrix (const SphereVertex &sv)
WorldVertex ComputeUpVector (const SphereVertex &sv)
WorldVertex ComputeUpVector (Object &object)
BoxVolume GetVolume (void)
bool IfLowAltitude (const WorldVertex &pos)
bool IfDownward (fp n)
bool IfUpward (fp n)

Public Attributes

CLASS_CONST int ALT_UP_DIR = 1
CLASS_CONST int ALT_DOWN_DIR = -1

Private Attributes

CLASS_DESTROY_OBJECT_LISTENER(World,
mWorld) private RefPtr
< GroupNode > 
mRootGroup
shptr< StateSortermStateSorter
 state-sorting
Objects mObjects
 some Object ctors need to attach to hold a reference


Detailed Description

World class is a container of 3D objects.

The representation of the simulated world is factored into graphical and geodesic classes: Geo and World.

World functions as a container of Objects. An Object ctor can ensure it has a reference by calling World::Attach(object) (else, it the ctor passed itself shptr<Object> then premature deletion would occur).


Constructor & Destructor Documentation

world::World::World ( void   ) 

ctor/dtor. Make() is the actual ctor.

world::World::~World (  ) 


Member Function Documentation

void world::World::Make ( void   ) 

Called by world::Init() [world/module.cc].

void world::World::Attach ( SharedPtr< Object object,
const StateBits  stateBits = STATE_BIT_DEFAULT,
const RefPtr< osg::StateSet >  stateSet = new osg::StateSet 
)

void world::World::Attach ( RefPtr< Node >  node,
const StateBits  stateBits = STATE_BIT_DEFAULT,
const RefPtr< osg::StateSet >  stateSet = new osg::StateSet 
)

Attach Node to World under appropriate sub-graph. [see Attach(Object)]

void world::World::Detach ( SharedPtr< Object object  ) 

void world::World::Detach ( RefPtr< Node >  node  ) 

Detach Node from World. Can be called if node is already detached. (mostly a subroutine)

void world::World::OptimizeSceneGraph ( void   ) 

Optimize entire scene-graph.

bool world::World::IfFlat ( void   ) 

If the World is flat ;-) This is queried since FlatPlanet is deficient and some configuration is only applicable to FlatPlanet.

WorldVertex world::World::GetPosition ( void   )  [inline]

fp world::World::GetRadius ( void   ) 

Get radius of World/Planet.

bool world::World::SetCompression ( const bool  enable  ) 

Set compression of World.

Returns:
Previous flag.

fpx world::World::GetCompressionScale ( void   ) 

Get compression scale of World.

void world::World::RotateTangential ( Object object,
const SphereVertex &  sv 
)

Orient an Object to be tangent to a point on the world (in case world is spherical).

const Matrix & world::World::GetTangentMatrix ( const SphereVertex &  sv  ) 

Compute a matrix that is tangent to a point on the world.

WorldVertex world::World::ComputeUpVector ( const SphereVertex &  sv  ) 

Compute a normalized "up vector" extending from a point on the world. A "down vector" can be computed by multipling by -1.0f.

WorldVertex world::World::ComputeUpVector ( Object object  ) 

Compute an "up vector" where an Object is at.

BoxVolume world::World::GetVolume ( void   ) 

Returns:
Volume of world in 3D space.

bool world::World::IfLowAltitude ( const WorldVertex &  pos  ) 

Returns:
True if position is approx at low altitude.

bool world::World::IfDownward ( fp  n  )  [inline]

bool world::World::IfUpward ( fp  n  )  [inline]


Member Data Documentation

CLASS_CONST int world::World::ALT_UP_DIR = 1

CLASS_CONST int world::World::ALT_DOWN_DIR = -1

CLASS_DESTROY_OBJECT_LISTENER ( World, mWorld ) private RefPtr<GroupNode> world::World::mRootGroup [private]

state-sorting

Objects world::World::mObjects [private]

some Object ctors need to attach to hold a reference


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Mon Dec 29 17:27:01 2008