Class hierarchy Compound list File list Compound Members

# World Class Reference

Generic Objects' World. More...

Inherits World_Object.

List of all members.

## Public Members

- World ()
    Construct a world.

- virtual long add (Object* O)
    this checks to make sure that any Object added to a World is derived from World_Object.

- virtual long preRender (View& view)
    This method is called once before any rendering is done.

- virtual long render (View& view)
    Subclases must override this to supply rendering.

- virtual long postRender (View& view)
    This method is called once after all rendering is done.

- virtual long preObjectRender (World_Object* O, View& view)
    This method is called once per object before it is rendered.

- virtual long postObjectRender (World_Object* O, View& view)
    This method is called once per object after it is rendered.

- virtual long advance (float Fraction)
    Subclasses may override this to provide state changes.

- virtual long preObjectAdvance (World_Object* O, float Fraction)
    This method is called once per object before it is advanced.

- virtual long postObjectAdvance (World_Object* O, float Fraction)
    This method is called once per object after it is advanced.

- long advance (float Fraction, float Precision)
    Gradual Advance.

## Detailed Description

Generic Objects' World.

Provides a root to the objects' tree.

## Member Function Documentation

### World::World()

Construct a world.

### virtual long World::add(Object* O)`[virtual]`

this checks to make sure that any Object added to a World is derived from World_Object.

Returns -1 if dynamic_cast fails.

Reimplemented from World_Object.

### virtual long World::preRender(View& view)`[virtual]`

This method is called once before any rendering is done.

It should return non-zero to skip rendering. Default implementation calls view.beginRendering().

Reimplemented from World_Object.

### virtual long World::render(View& view)`[virtual]`

Subclases must override this to supply rendering.

Default implemetation renders the child objects of the world.

Reimplemented from World_Object.

### virtual long World::postRender(View& view)`[virtual]`

This method is called once after all rendering is done.

Default implemetation calls view.endRendering().

Reimplemented from World_Object.

### virtual long World::preObjectRender(World_Object* O, View& view)`[virtual]`

This method is called once per object before it is rendered.

If it returns a non-zero value, the object will not be rendered.

### virtual long World::postObjectRender(World_Object* O, View& view)`[virtual]`

This method is called once per object after it is rendered.

### virtual long World::advance(float Fraction)`[virtual]`

Subclasses may override this to provide state changes.

Default implemetation calls advance() for each child object of the world. Fraction gives the amount of time to provide change for (in seconds).

Reimplemented from World_Object.

### virtual long World::preObjectAdvance(World_Object* O, float Fraction)`[virtual]`

This method is called once per object before it is advanced.

### virtual long World::postObjectAdvance(World_Object* O, float Fraction)`[virtual]`

This method is called once per object after it is advanced.

### long World::advance(float Fraction, float Precision)

Gradual Advance.

This is will advance a given World instance by Fraction. It is intended to be called once per frame. It has two purposes: 1) Call the world's advance routine at least twice per frame (this helps prevent collided objects from appearing overlapped on the screen). 2) Break the Fraction into manageable chunks. Precision gives the max fraction with which the World's advance code is to be called with. Mutiple calls are made to World::advance() when the Fraction remaining is greater than Precision. Note that physics codes normally are more accurate with a lower Precision value, but there is a trade off. If it is set too low, too much time will be spent in advance routines. Note that World::advance() will only be called with a fraction > EPSILON.

The documentation for this class was generated from the following file:

- WO_World.h