VEE_SceneBox Class Reference

#include <vee_scene.h>

Collaboration diagram for VEE_SceneBox:

Collaboration graph
[legend]
List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes


Member Typedef Documentation

typedef VEE_PointerStoreSet<VEE_Object> VEE_SceneBox::ObjectStore
 

typedef ObjectStore::iterator VEE_SceneBox::iterator
 

typedef VEE_PointerStoreSet<VEE_ForceObject> VEE_SceneBox::ForceStore [protected]
 


Constructor & Destructor Documentation

VEE_SceneBox::VEE_SceneBox  ) 
 

Creates and uninitialized (thus unusable) VEE_SceneBox.

VEE_SceneBox::VEE_SceneBox VEE_SceneBox parent,
const VEE_Vector3 low,
const VEE_Vector3 high
 

Creates an initialized VEE_SceneBox.

VEE_SceneBox::~VEE_SceneBox  )  [virtual]
 

Deletes this box, also deleting any child boxes.


Member Function Documentation

void VEE_SceneBox::init VEE_SceneBox parent,
const VEE_Vector3 low,
const VEE_Vector3 high
 

Initialize a scene box.

  • parent The parent (container) of this box.
  • low The location of the corner with the lowest x, y and z.
  • high The location of the corner with the highest x, y and z.

void VEE_SceneBox::setArea const VEE_Vector3 low,
const VEE_Vector3 high
[inline]
 

bool VEE_SceneBox::addObject VEE_Object o  ) 
 

Adds an object to the box-graph.

The object may end up anywhere in the graph.

The scene-box field of the argument object is also set to the correct value.

Returns:
If the object is outside the largest scene box, then false is returned. Usually this method returns true.
See also:
VEE_SceneBox::addChildObject

bool VEE_SceneBox::addNewObject VEE_Object o  ) 
 

Adds an object to the box-graph.

The object may end up anywhere in the graph.

The scene-box field of the argument object is also set to the correct value.

Returns:
If the object is outside the largest scene box, then false is returned. Usually this method returns true.
See also:
VEE_SceneBox::addChildObject

bool VEE_SceneBox::addObject VEE_ForceObject  ) 
 

DO NOT CALL.

This method is here only to make sure one does not accidentally add force objects with "addObject".

bool VEE_SceneBox::addNewForce VEE_ForceObject  ) 
 

Use this method to add new force objects to the scene.

void VEE_SceneBox::addChildObject VEE_Object o  ) 
 

Adds an object to either this box or below in the hierarchy.

The scene-box field of the argument object is also set to the correct value.

It is assumed that the object is truly within this box. It is also assumed that the object is not a child of this before this call.

The argument is not checked for correctness.

See also:
VEE_SceneBox::addObject

void VEE_SceneBox::removeChildObject VEE_Object o  ) 
 

Removes a direct child object.

If VEE is compiled with error reporting this method will both check the argument for sanity and check that the operation was successful. in error conditions warning values will be printed as necessary.

void VEE_SceneBox::addForceHere VEE_ForceObject o,
const VEE_BoundingBox bbox,
const VEE_SceneBox caller = 0
 

void VEE_SceneBox::addForceSomewhere VEE_ForceObject o,
const VEE_BoundingBox bbox,
const VEE_SceneBox caller = 0
 

void VEE_SceneBox::forgetForce VEE_ForceObject o  ) 
 

void VEE_SceneBox::updateScene int  frame  ) 
 

Updates the registering locations of all the objects and force objects.

void VEE_SceneBox::updateScene  )  [inline]
 

void VEE_SceneBox::getObjects ObjectStore target  ) 
 

Get all the child objects of this box recursively.

void VEE_SceneBox::getForces std::set< VEE_ForceObject * > *  target  ) 
 

uint VEE_SceneBox::totalChildren  ) 
 

Total number of child objects (recursive).

uint VEE_SceneBox::totalForces  ) 
 

void VEE_SceneBox::update uint  splitTreshold,
uint  collapseTreshold,
int  allowRecursionLevels
 

The main updating method.

void VEE_SceneBox::update uint  splitTreshold,
uint  collapseTreshold,
int  allowRecursionLevels,
float  dt
 

bool VEE_SceneBox::updateTree uint  splitTreshold,
uint  collapseTreshold,
int  allowRecursionLevels = 10
 

Updates the current box-graph.

New branches are grown and shrunk as necessary.

This method uses VEE_SceneBox::trySplit and VEE_SceneBox::tryCollapse to do the real work.

  • splitTreshold Number of elements that are needed, before a paritular box should be split. If this (or any child box) has greater number of direct child objects, then the box is split.
  • collapseTreshold The number of objects that is the minimum before collapsing child boxes into this box.
  • allowRecursionLevels The number of levels that the tree is allowed to grow downdards. If this number is non-zero, then new levels can be added.
Returns:
This method returns true if this box or any child box was modified.

void VEE_SceneBox::updateR float  dt  ) 
 

bool VEE_SceneBox::trySplit uint  treshold,
int  allowRecursionLevels
 

Tries to split the box to eight child boxes recursively.

Returns:
This method returns true if the tree box or any child box was modified.
See also:
VEE_SceneBox::updateTree.

bool VEE_SceneBox::tryCollapse uint  treshold  ) 
 

Tries to collapse the child boxes of this box recursively.

Returns:
This method returns true if this box or any child box was modified.
See also:
VEE_SceneBox::updateTree.

void VEE_SceneBox::refreshTimeLastUpdate  ) 
 

void VEE_SceneBox::incrementFrame  )  [inline]
 

bool VEE_SceneBox::isSplit  )  const [inline]
 

Has the box been split to eight child boxes.

bool VEE_SceneBox::write std::ostream *  s = 0  ) 
 

Writes out all the objects found inside the scenebox.

void VEE_SceneBox::getForce VEE_ForceType  forceType,
const VEE_Object object,
VEE_Vector3 force,
const VEE_Vector3 velocity,
const VEE_Vector3 location
 

VEE::SceneBox::getForce searches for all the forces of the specified force type and returns a single sum of these vectors, the force field, in VEE_Vector3 *force.

uint VEE_SceneBox::getForces VEE_ForceType  forceType,
const VEE_Object object,
VEE_Vector3 force,
uint  n,
const VEE_Vector3 velocity,
const VEE_Vector3 location
 

VEE_SceneBox::getForces calculates the magnitude and the direction of the force field of the specified type acting on the queried locations.

Writes n number of resultant vectors to the structure VEE_Vector *force.

uint VEE_SceneBox::getForcesDown VEE_ForceType  forceType,
const VEE_Object object,
VEE_Vector3 force,
uint  n,
const VEE_Vector3 velocity,
const VEE_Vector3 location
 

Gets a number of forces downwards (recursive).

uint VEE_SceneBox::getForcesNR VEE_ForceType  forceType,
const VEE_Object object,
VEE_Vector3 force,
uint  n,
const VEE_Vector3 velocity,
const VEE_Vector3 location
 

Gets a number of forces (non-recursive).

VEE_SceneBox* VEE_SceneBox::parent  )  [inline]
 

VEE_SceneBox* VEE_SceneBox::children  )  [inline]
 

VEE_SceneBox* VEE_SceneBox::child uint  k  )  [inline]
 

uint VEE_SceneBox::numObjects  )  [inline]
 

uint VEE_SceneBox::numForceObjects  )  [inline]
 

VEE_BoundingBox& VEE_SceneBox::boundingBox  )  [inline]
 

const VEE_BoundingBox& VEE_SceneBox::boundingBox  )  const [inline]
 

uint VEE_SceneBox::numChildBoxes  ) 
 

static long VEE_SceneBox::count  )  [inline, static]
 

iterator VEE_SceneBox::begin  )  [inline]
 

iterator VEE_SceneBox::end  )  [inline]
 

static VEE_Object* VEE_SceneBox::getObject iterator it  )  [inline, static]
 

VEE_SceneBox& VEE_SceneBox::getChild uint  x,
uint  y,
uint  z
[inline, protected]
 

bool VEE_SceneBox::updateSceneLocation VEE_Object o  )  [protected]
 

Update the location of an object in the VEE_SceneBox graph.

The object must be a direct child of this box.

Returns:
This method returns true if the location was modified.

bool VEE_SceneBox::updateForceSceneLocation VEE_ForceObject  )  [protected]
 

void VEE_SceneBox::updateVelocities float  dt  )  [protected]
 

void VEE_SceneBox::tryToSendForcesDown  )  [protected]
 


Member Data Documentation

ObjectStore VEE_SceneBox::m_objects [protected]
 

ForceStore VEE_SceneBox::m_forces [protected]
 

VEE_SceneBox* VEE_SceneBox::m_parent [protected]
 

VEE_SceneBox* VEE_SceneBox::m_children [protected]
 

VEE_BoundingBox VEE_SceneBox::m_bbox [protected]
 

int VEE_SceneBox::m_frame [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Mar 12 21:09:36 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6