# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLPACS::CGlobalRetriever Class Reference

A class that allows to retrieve surface in a large amount of zones (referred as instances.). More...

#include <global_retriever.h>

Inheritance diagram for NLPACS::CGlobalRetriever:

NLPACS::UGlobalRetriever List of all members.

Collisions part.

enum  TCollisionType { Circle, BBox }
void findCollisionChains (CCollisionSurfaceTemp &cst, const NLMISC::CAABBox &bboxMove, const NLMISC::CVector &origin) const
 reset and fill cst.CollisionChains with possible collisions in bboxMove+origin. More...

void testCollisionWithCollisionChains (CCollisionSurfaceTemp &cst, const CVector2f &startCol, const CVector2f &deltaCol, CSurfaceIdent startSurface, float radius, const CVector2f bbox[4], TCollisionType colType) const
 reset and fill cst.CollisionDescs with effective collisions against current cst.CollisionChains. More...

CSurfaceIdent testMovementWithCollisionChains (CCollisionSurfaceTemp &cst, const CVector2f &startCol, const CVector2f &deltaCol, CSurfaceIdent startSurface) const
 reset and fill cst.MoveDescs with effective collisions of a point movement against current cst.CollisionChains. More...

void testRotCollisionWithCollisionChains (CCollisionSurfaceTemp &cst, const CVector2f &startCol, CSurfaceIdent startSurface, const CVector2f bbox[4]) const
 reset and fill cst.CollisionDescs with effective collisions against current cst.CollisionChains. More...

bool verticalChain (const CCollisionChain &colChain) const
 test if a collisionChain separate 2 walls. More...


Public Types

typedef std::vector< CLocalPathCGlobalPath

Public Methods

Initialisation
 CGlobalRetriever (const CRetrieverBank *bank=NULL)
 Constructor. More...

virtual ~CGlobalRetriever ()
void init ()
 Setup an empty global retriever. More...

void initQuadGrid ()
 Fill the quadgrid with the instances. More...

void initRetrieveTable ()
 Init the retrieve table. More...

Selectors
const NLMISC::CAABBoxgetBBox () const
 Gets the BBox of the global retriever. More...

const std::vector< CRetrieverInstance > & getInstances () const
 Gets the vector of retriever instances that compose the global retriever. More...

const CRetrieverInstancegetInstance (uint id) const
 Gets the retriever instance referred by its id. More...

void selectInstances (const NLMISC::CAABBox &bbox, CCollisionSurfaceTemp &cst) const
 Select the instances that are in contact with the given bbox. More...

const CRetrieverBankgetRetrieverBank () const
 Get the retriever bank associated to this global retriever. More...

const CLocalRetrievergetRetriever (uint32 id) const
 Get the local retriever. More...

uint32 getMaterial (const UGlobalPosition &pos) const
 Get the material at this position. More...

bool isInterior (const UGlobalPosition &pos) const
 Test if the position is an interior. More...

bool isWaterPosition (const UGlobalPosition &pos, float &waterHeight) const
 Test if the position is in water. More...

Position retrieving methods.
UGlobalPosition retrievePosition (const NLMISC::CVector &estimated) const
 Retrieves the position of an estimated point in the global retriever. More...

UGlobalPosition retrievePosition (const NLMISC::CVectorD &estimated) const
 Retrieves the position of an estimated point in the global retriever (double instead.). More...

UGlobalPosition retrievePosition (const NLMISC::CVector &estimated, float threshold) const
 Retrieves the position of an estimated point in the global retriever. More...

UGlobalPosition retrievePosition (const NLMISC::CVectorD &estimated, double threshold) const
 Retrieves the position of an estimated point in the global retriever (double instead.). More...

sint32 getIdentifier (const std::string &id) const
 Return the retriever id from the string id. More...

const std::string & getIdentifier (const UGlobalPosition &position) const
 Get the identifier of the global position. More...

bool buildInstance (const std::string &id, const NLMISC::CVectorD &position, sint32 &instanceId)
 Builds a instance of retriever, and link it on the ground (or wherever). More...

void removeInstance (sint32 instanceId)
 Removes an instance of retriever (perform all unlinks necessary). More...

NLMISC::CVector getGlobalPosition (const UGlobalPosition &global) const
 Converts a global position object into a 'human-readable' CVector. More...

NLMISC::CVectorD getDoubleGlobalPosition (const UGlobalPosition &global) const
 Converts a global position object into a 'human-readable' CVector (double instead.). More...

bool testRaytrace (const NLMISC::CVectorD &v0, const NLMISC::CVectorD &v1)
 Make a raytrace test. For the time, always return false. More...

Mutators
const CRetrieverInstancemakeInstance (uint32 retriever, uint8 orientation, const NLMISC::CVector &origin)
 Creates an instance of local retriever at the origine position with the given orientation. More...

CRetrieverInstancegetInstanceFullAccess (uint id)
 Gets the instance by its id, with full read/write access. More...

void setRetrieverBank (const CRetrieverBank *bank)
 Sets the retriever bank. More...

void resetAllLinks ()
 Resets all links within the global retriever. More...

void initAll ()
 Inits all the instances inside the global retriever. More...

void makeLinks (uint n)
 Links the instance referred by its id to its neighbors. More...

void makeAllLinks ()
 Links all the instances inside the global retriever. More...

void check () const
 Checks the retriever for errors. More...

float distanceToBorder (const UGlobalPosition &pos) const
void getBorders (const UGlobalPosition &pos, std::vector< NLMISC::CLine > &edges)
void serial (NLMISC::IStream &f)
 Serialises the global retriever. More...

Collisions part.
const TCollisionSurfaceDescVectortestCylinderMove (const UGlobalPosition &start, const NLMISC::CVector &delta, float radius, CCollisionSurfaceTemp &cst) const
 Test a movement of a cylinder against surface world. More...

const TCollisionSurfaceDescVectortestBBoxMove (const UGlobalPosition &start, const NLMISC::CVector &delta, const NLMISC::CVector &locI, const NLMISC::CVector &locJ, CCollisionSurfaceTemp &cst) const
 Test a movement of a bbox against surface world. More...

UGlobalPosition doMove (const UGlobalPosition &start, const NLMISC::CVector &delta, float t, CCollisionSurfaceTemp &cst, bool rebuildChains=false) const
 apply a movement of a point against surface world. More...

const CRetrievableSurfacegetSurfaceById (const CSurfaceIdent &surfId) const
 retrieve a surface by its Id. More...

const TCollisionSurfaceDescVectortestBBoxRot (const CGlobalPosition &start, const NLMISC::CVector &locI, const NLMISC::CVector &locJ, CCollisionSurfaceTemp &cst) const
 Test a rotation of a BBox against the surfaces. More...

float getMeanHeight (const UGlobalPosition &pos) const
 return the mean height of the surface under pos.. More...

void updateHeight (UGlobalPosition &pos) const
 Upadates the height of the given global position. More...

Pathfinding part.
void findAStarPath (const UGlobalPosition &begin, const UGlobalPosition &end, std::vector< CRetrieverInstance::CAStarNodeAccess > &path, uint32 forbidFlags) const
 Finds an A* path from a given global position to another. More...

void findPath (const UGlobalPosition &begin, const UGlobalPosition &end, CGlobalPath &path, uint32 forbidFlags=0) const
 Finds a path from a given global position to another. More...


Protected Methods

CCollisionSurfaceTempgetInternalCST () const

Protected Attributes

const CRetrieverBank_RetrieverBank
 The CRetrieverBank where the commmon retrievers are stored. More...

std::vector< CRetrieverInstance_Instances
 The instances of the global retriever. More...

CQuadGrid< uint32_InstanceGrid
 The grid of instances. More...

NLMISC::CAABBox _BBox
 The axis aligned bounding box of the global retriever. More...


Private Types


Private Methods

Pathfinding part.
CRetrieverInstance::CAStarNodeInfogetNode (CRetrieverInstance::CAStarNodeAccess &access) const
 Gets the CAStarNodeInfo referred by its access. More...


Private Attributes

CCollisionSurfaceTemp _InternalCST
std::vector< uint8_RetrieveTable
 Used to retrieve the surface. Internal use only, to avoid large amount of new/delete. More...


Friends

class CRetrieverInstance

Detailed Description

A class that allows to retrieve surface in a large amount of zones (referred as instances.).

Author:
Benjamin Legros , Nevrax France
Date:
2001

Definition at line 61 of file global_retriever.h.


Member Typedef Documentation

typedef std::vector<CLocalPath> NLPACS::CGlobalRetriever::CGlobalPath
 

Definition at line 99 of file global_retriever.h.

Referenced by findPath.


Member Enumeration Documentation

enum NLPACS::CGlobalRetriever::TCollisionType [private]
 

Enumeration values:
Circle 
BBox 

Definition at line 394 of file global_retriever.h.


Constructor & Destructor Documentation

NLPACS::CGlobalRetriever::CGlobalRetriever const CRetrieverBank   bank = NULL [inline]
 

Constructor.

Creates a global retriever with given width, height and retriever bank.

Definition at line 130 of file global_retriever.h.

References _RetrieverBank.

virtual NLPACS::CGlobalRetriever::~CGlobalRetriever   [inline, virtual]
 

Definition at line 133 of file global_retriever.h.


Member Function Documentation

bool NLPACS::CGlobalRetriever::buildInstance const std::string &    id,
const NLMISC::CVectorD   position,
sint32   instanceId
[virtual]
 

Builds a instance of retriever, and link it on the ground (or wherever).

Parameters:
id  a valid retriever id to be instanciated
a  valid position where the retriever should be instanciated
Returns:
false if failed

Implements NLPACS::UGlobalRetriever.

void NLPACS::CGlobalRetriever::check   const
 

Checks the retriever for errors.

Definition at line 127 of file global_retriever.cpp.

References _Instances, _RetrieverBank, CRetrieverInstance, getRetriever, and nlwarning.

float NLPACS::CGlobalRetriever::distanceToBorder const UGlobalPosition   pos const [virtual]
 

Implements NLPACS::UGlobalRetriever.

Definition at line 226 of file global_retriever.cpp.

References _Instances, and getRetriever.

NLPACS::UGlobalPosition NLPACS::CGlobalRetriever::doMove const UGlobalPosition   start,
const NLMISC::CVector   delta,
float    t,
CCollisionSurfaceTemp   cst,
bool    rebuildChains = false
const
 

apply a movement of a point against surface world.

This should be called after test???Move(). NB: It's up to you to give good t, relative to result of test???Move(). Else, undefined results... NB: if you don't give same start/delta as in preceding call to testMove(), and rebuildChains==false, start is returned (nlstop in debug).

Parameters:
start  is the start position of the movement. (must be same as passed in test???Move()).
delta  is the requested movement (must be same as passed in test???Move()).
t  must be in [0,1]. t*delta is the actual requested movement.
cst  is the CCollisionSurfaceTemp object used as temp computing (one per thread). (must be same as passed in test???Move()).
rebuildChains  true if doMove() is not called just after the testMove(). Then CGlobalRetriever must recompute some part of the data needed to performing his task.
Returns:
new position of the entity.

Definition at line 1712 of file global_retriever.cpp.

References NLMISC::clamp, NLPACS::CCollisionSurfaceTemp::CollisionDescs, findCollisionChains, getInstance, NLPACS::UGlobalPosition::InstanceId, NLPACS::UGlobalPosition::LocalPosition, nlassert, nlstop, NLPACS::CCollisionSurfaceTemp::PrecDeltaPos, NLPACS::CCollisionSurfaceTemp::PrecStartPos, NLPACS::CCollisionSurfaceTemp::PrecStartSurface, NLPACS::CCollisionSurfaceTemp::PrecValid, res, NLPACS::SnapPrecision, t, testMovementWithCollisionChains, NLPACS::Vector2sAccuracy, x, and y.

void NLPACS::CGlobalRetriever::findAStarPath const UGlobalPosition   begin,
const UGlobalPosition   end,
std::vector< CRetrieverInstance::CAStarNodeAccess > &    path,
uint32    forbidFlags
const
 

Finds an A* path from a given global position to another.

Todo:
secure search to avoid crashes...

Referenced by findPath.

void NLPACS::CGlobalRetriever::findCollisionChains CCollisionSurfaceTemp   cst,
const NLMISC::CAABBox   bboxMove,
const NLMISC::CVector   origin
const [private]
 

reset and fill cst.CollisionChains with possible collisions in bboxMove+origin.

result: collisionChains, computed localy to origin.

Definition at line 1008 of file global_retriever.cpp.

References _Instances, _RetrieverBank, CRetrieverInstance, getInstance, getRetriever, nlassert, selectInstances, and NLMISC::CAABBox::setCenter.

Referenced by doMove, testBBoxMove, testBBoxRot, and testCylinderMove.

void NLPACS::CGlobalRetriever::findPath const UGlobalPosition   begin,
const UGlobalPosition   end,
CGlobalPath   path,
uint32    forbidFlags = 0
const
 

Finds a path from a given global position to another.

Todo:
include path width

Definition at line 896 of file global_retriever.cpp.

References _Instances, _InternalCST, _RetrieverBank, AStarTicks, CGlobalPath, ChainTicks, findAStarPath, NLPACS::UGlobalPosition::LocalPosition, PathTicks, SurfTicks, ThisAStarTicks, ThisChainTicks, ThisPathTicks, ThisSurfTicks, and NLMISC::TTicks.

const NLMISC::CAABBox& NLPACS::CGlobalRetriever::getBBox   const [inline, virtual]
 

Gets the BBox of the global retriever.

Implements NLPACS::UGlobalRetriever.

Definition at line 153 of file global_retriever.h.

Referenced by initQuadGrid.

void NLPACS::CGlobalRetriever::getBorders const UGlobalPosition   pos,
std::vector< NLMISC::CLine > &    edges
[virtual]
 

Implements NLPACS::UGlobalRetriever.

Definition at line 234 of file global_retriever.cpp.

References _Instances, _InternalCST, CRetrieverInstance, and getRetriever.

CVectorD NLPACS::CGlobalRetriever::getDoubleGlobalPosition const UGlobalPosition   global const [virtual]
 

Converts a global position object into a 'human-readable' CVector (double instead.).

Implements NLPACS::UGlobalRetriever.

Definition at line 674 of file global_retriever.cpp.

References _Instances, NLPACS::UGlobalPosition::InstanceId, and NLPACS::UGlobalPosition::LocalPosition.

CVector NLPACS::CGlobalRetriever::getGlobalPosition const UGlobalPosition   global const [virtual]
 

Converts a global position object into a 'human-readable' CVector.

Implements NLPACS::UGlobalRetriever.

Definition at line 661 of file global_retriever.cpp.

References _Instances.

const string & NLPACS::CGlobalRetriever::getIdentifier const UGlobalPosition   position const [virtual]
 

Get the identifier of the global position.

Implements NLPACS::UGlobalRetriever.

Definition at line 588 of file global_retriever.cpp.

References _Instances, getRetriever, and NLPACS::UGlobalPosition::InstanceId.

sint32 NLPACS::CGlobalRetriever::getIdentifier const std::string &    id const [virtual]
 

Return the retriever id from the string id.

Implements NLPACS::UGlobalRetriever.

const CRetrieverInstance& NLPACS::CGlobalRetriever::getInstance uint    id const [inline]
 

Gets the retriever instance referred by its id.

Definition at line 160 of file global_retriever.h.

References _Instances, CRetrieverInstance, and id.

Referenced by doMove, findCollisionChains, getMeanHeight, getSurfaceById, testBBoxMove, testBBoxRot, testCollisionWithCollisionChains, testCylinderMove, and testMovementWithCollisionChains.

CRetrieverInstance& NLPACS::CGlobalRetriever::getInstanceFullAccess uint    id [inline]
 

Gets the instance by its id, with full read/write access.

Definition at line 272 of file global_retriever.h.

References _Instances, CRetrieverInstance, and id.

const std::vector<CRetrieverInstance>& NLPACS::CGlobalRetriever::getInstances   const [inline]
 

Gets the vector of retriever instances that compose the global retriever.

Definition at line 157 of file global_retriever.h.

References _Instances.

CCollisionSurfaceTemp& NLPACS::CGlobalRetriever::getInternalCST   const [inline, protected]
 

Definition at line 422 of file global_retriever.h.

References _InternalCST.

Referenced by NLPACS::CRetrieverInstance::initEdgeQuad.

uint32 NLPACS::CGlobalRetriever::getMaterial const UGlobalPosition   pos const [inline, virtual]
 

Get the material at this position.

Implements NLPACS::UGlobalRetriever.

Definition at line 176 of file global_retriever.h.

References _Instances, CRetrieverInstance, and getRetriever.

float NLPACS::CGlobalRetriever::getMeanHeight const UGlobalPosition   pos const [virtual]
 

return the mean height of the surface under pos..

Implements NLPACS::UGlobalRetriever.

Definition at line 2090 of file global_retriever.cpp.

References _RetrieverBank, CRetrieverInstance, and getInstance.

Referenced by updateHeight.

CRetrieverInstance::CAStarNodeInfo& NLPACS::CGlobalRetriever::getNode CRetrieverInstance::CAStarNodeAccess   access const [inline, private]
 

Gets the CAStarNodeInfo referred by its access.

Definition at line 384 of file global_retriever.h.

References _Instances.

const CLocalRetriever& NLPACS::CGlobalRetriever::getRetriever uint32    id const [inline]
 

Get the local retriever.

Definition at line 172 of file global_retriever.h.

References _RetrieverBank, and id.

Referenced by check, distanceToBorder, findCollisionChains, getBorders, getIdentifier, getMaterial, NLPACS::CRetrieverInstance::initEdgeQuad, initRetrieveTable, isWaterPosition, NLPACS::CRetrieverInstance::linkEdgeQuad, makeInstance, and makeLinks.

const CRetrieverBank* NLPACS::CGlobalRetriever::getRetrieverBank   const [inline]
 

Get the retriever bank associated to this global retriever.

Definition at line 169 of file global_retriever.h.

References _RetrieverBank.

const NLPACS::CRetrievableSurface * NLPACS::CGlobalRetriever::getSurfaceById const CSurfaceIdent   surfId const
 

retrieve a surface by its Id.

NULL if not found or if -1.

Definition at line 993 of file global_retriever.cpp.

References _RetrieverBank, getInstance, NLPACS::CSurfaceIdent::RetrieverInstanceId, and NLPACS::CSurfaceIdent::SurfaceId.

Referenced by verticalChain.

void NLPACS::CGlobalRetriever::init  
 

Setup an empty global retriever.

Definition at line 55 of file global_retriever.cpp.

References _BBox, _InstanceGrid, NLMISC::CAABBox::setCenter, and NLMISC::CAABBox::setHalfSize.

void NLPACS::CGlobalRetriever::initAll  
 

Inits all the instances inside the global retriever.

Definition at line 320 of file global_retriever.cpp.

References _Instances, _RetrieverBank, initQuadGrid, and initRetrieveTable.

void NLPACS::CGlobalRetriever::initQuadGrid  
 

Fill the quadgrid with the instances.

Definition at line 63 of file global_retriever.cpp.

References _InstanceGrid, _Instances, and getBBox.

Referenced by initAll, and serial.

void NLPACS::CGlobalRetriever::initRetrieveTable  
 

Init the retrieve table.

Definition at line 73 of file global_retriever.cpp.

References _Instances, _RetrieveTable, and getRetriever.

Referenced by initAll, and serial.

bool NLPACS::CGlobalRetriever::isInterior const UGlobalPosition   pos const [inline, virtual]
 

Test if the position is an interior.

Implements NLPACS::UGlobalRetriever.

Definition at line 191 of file global_retriever.h.

References _Instances.

bool NLPACS::CGlobalRetriever::isWaterPosition const UGlobalPosition   pos,
float &    waterHeight
const [inline, virtual]
 

Test if the position is in water.

Implements NLPACS::UGlobalRetriever.

Definition at line 200 of file global_retriever.h.

References _Instances, CRetrieverInstance, and getRetriever.

void NLPACS::CGlobalRetriever::makeAllLinks  
 

Links all the instances inside the global retriever.

Definition at line 311 of file global_retriever.cpp.

References _Instances, makeLinks, and resetAllLinks.

const NLPACS::CRetrieverInstance & NLPACS::CGlobalRetriever::makeInstance uint32    retriever,
uint8    orientation,
const NLMISC::CVector   origin
 

Creates an instance of local retriever at the origine position with the given orientation.

Definition at line 333 of file global_retriever.cpp.

References _BBox, _InstanceGrid, _Instances, _RetrieveTable, CRetrieverInstance, NLMISC::CAABBox::extend, NLMISC::CAABBox::getHalfSize, getRetriever, and id.

void NLPACS::CGlobalRetriever::makeLinks uint    n
 

Links the instance referred by its id to its neighbors.

Definition at line 273 of file global_retriever.cpp.

References _Instances, _InternalCST, _RetrieverBank, CRetrieverInstance, getRetriever, nlwarning, and selectInstances.

Referenced by makeAllLinks.

void NLPACS::CGlobalRetriever::removeInstance sint32    instanceId [virtual]
 

Removes an instance of retriever (perform all unlinks necessary).

Implements NLPACS::UGlobalRetriever.

Definition at line 628 of file global_retriever.cpp.

References _Instances, CRetrieverInstance, and nlwarning.

void NLPACS::CGlobalRetriever::resetAllLinks  
 

Resets all links within the global retriever.

Definition at line 303 of file global_retriever.cpp.

References _Instances.

Referenced by makeAllLinks.

NLPACS::UGlobalPosition NLPACS::CGlobalRetriever::retrievePosition const NLMISC::CVectorD   estimated,
double    threshold
const [virtual]
 

Retrieves the position of an estimated point in the global retriever (double instead.).

Implements NLPACS::UGlobalRetriever.

Definition at line 484 of file global_retriever.cpp.

References _BBox, _Instances, _InternalCST, _RetrieverBank, CRetrieverInstance, id, NLMISC::CAABBox::include, nlinfo, nlwarning, and selectInstances.

NLPACS::UGlobalPosition NLPACS::CGlobalRetriever::retrievePosition const NLMISC::CVector   estimated,
float    threshold
const [virtual]
 

Retrieves the position of an estimated point in the global retriever.

Implements NLPACS::UGlobalRetriever.

Definition at line 422 of file global_retriever.cpp.

References retrievePosition.

NLPACS::UGlobalPosition NLPACS::CGlobalRetriever::retrievePosition const NLMISC::CVectorD   estimated const [virtual]
 

Retrieves the position of an estimated point in the global retriever (double instead.).

Implements NLPACS::UGlobalRetriever.

Definition at line 571 of file global_retriever.cpp.

References retrievePosition.

NLPACS::UGlobalPosition NLPACS::CGlobalRetriever::retrievePosition const NLMISC::CVector   estimated const [virtual]
 

Retrieves the position of an estimated point in the global retriever.

Implements NLPACS::UGlobalRetriever.

Definition at line 566 of file global_retriever.cpp.

Referenced by retrievePosition.

void NLPACS::CGlobalRetriever::selectInstances const NLMISC::CAABBox   bbox,
CCollisionSurfaceTemp   cst
const
 

Select the instances that are in contact with the given bbox.

The selected instances are stored in CCollisionSurfaceTemp.CollisionInstances

Definition at line 94 of file global_retriever.cpp.

References _InstanceGrid, _Instances, NLMISC::CAABBox::getMax, and NLMISC::CAABBox::getMin.

Referenced by findCollisionChains, makeLinks, and retrievePosition.

void NLPACS::CGlobalRetriever::serial NLMISC::IStream   f
 

Serialises the global retriever.

Definition at line 107 of file global_retriever.cpp.

References _BBox, _Instances, initQuadGrid, initRetrieveTable, NLMISC::IStream::isReading, NLMISC::IStream::serial, NLMISC::IStream::serialCont, and NLMISC::IStream::serialVersion.

void NLPACS::CGlobalRetriever::setRetrieverBank const CRetrieverBank   bank [inline]
 

Sets the retriever bank.

Definition at line 275 of file global_retriever.h.

References _RetrieverBank.

const NLPACS::TCollisionSurfaceDescVector * NLPACS::CGlobalRetriever::testBBoxMove const UGlobalPosition   start,
const NLMISC::CVector   delta,
const NLMISC::CVector   locI,
const NLMISC::CVector   locJ,
CCollisionSurfaceTemp   cst
const
 

Test a movement of a bbox against surface world.

Parameters:
start  is the start position of the movement.
delta  is the requested movement.
locI  is the oriented I vector of the BBox. I.norm()== Width/2.
locJ  is the oriented J vector of the BBox. J.norm()== Height/2.
cst  is the CCollisionSurfaceTemp object used as temp copmputing (one per thread).
Returns:
list of collision against surface, ordered by increasing time. this is a synonym for cst.CollisionDescs. NB: this array may be modified by CGlobalRetriever on any collision call.

Definition at line 1621 of file global_retriever.cpp.

References findCollisionChains, getInstance, NLMISC::CVector::isNull, testCollisionWithCollisionChains, x, NLMISC::CVector::x, y, and NLMISC::CVector::y.

const NLPACS::TCollisionSurfaceDescVector & NLPACS::CGlobalRetriever::testBBoxRot const CGlobalPosition   start,
const NLMISC::CVector   locI,
const NLMISC::CVector   locJ,
CCollisionSurfaceTemp   cst
const
 

Test a rotation of a BBox against the surfaces.

NB: this function is not perfect because a ContactSurface may appears 2+ times in the returned array.

Parameters:
start  is the center of the bbox.
locI  is the new oriented I vector of the BBox. I.norm()== Width/2.
locJ  is the new oriented J vector of the BBox. J.norm()== Height/2. NB : must have locI^locJ== aK (a>0)
cst  is the CCollisionSurfaceTemp object used as temp copmputing (one per thread).
Returns:
list of collision against surface (ContactTime and ContactNormal has no means). this is a synonym for cst.CollisionDescs. NB: this array may be modified by CGlobalRetriever on any collision call.

Definition at line 1905 of file global_retriever.cpp.

References findCollisionChains, getInstance, testRotCollisionWithCollisionChains, x, NLMISC::CVector::x, y, and NLMISC::CVector::y.

void NLPACS::CGlobalRetriever::testCollisionWithCollisionChains CCollisionSurfaceTemp   cst,
const CVector2f &    startCol,
const CVector2f &    deltaCol,
CSurfaceIdent    startSurface,
float    radius,
const CVector2f    bbox[4],
TCollisionType    colType
const [private]
 

reset and fill cst.CollisionDescs with effective collisions against current cst.CollisionChains.

result: new collisionDescs in cst.

Definition at line 1211 of file global_retriever.cpp.

References _Instances, _RetrieverBank, getInstance, min, nlassert, and t.

Referenced by testBBoxMove, and testCylinderMove.

const NLPACS::TCollisionSurfaceDescVector * NLPACS::CGlobalRetriever::testCylinderMove const UGlobalPosition   start,
const NLMISC::CVector   delta,
float    radius,
CCollisionSurfaceTemp   cst
const
 

Test a movement of a cylinder against surface world.

Parameters:
start  is the start position of the movement.
delta  is the requested movement.
radius  is the radius of the vertical cylinder.
cst  is the CCollisionSurfaceTemp object used as temp copmputing (one per thread).
Returns:
list of collision against surface, ordered by increasing time. this is a synonym for cst.CollisionDescs. NB: this array may be modified by CGlobalRetriever on any collision call.

Definition at line 1548 of file global_retriever.cpp.

References findCollisionChains, getInstance, NLMISC::CVector::isNull, testCollisionWithCollisionChains, NLMISC::CVector::x, and NLMISC::CVector::y.

NLPACS::CSurfaceIdent NLPACS::CGlobalRetriever::testMovementWithCollisionChains CCollisionSurfaceTemp   cst,
const CVector2f &    startCol,
const CVector2f &    deltaCol,
CSurfaceIdent    startSurface
const [private]
 

reset and fill cst.MoveDescs with effective collisions of a point movement against current cst.CollisionChains.

result: the surfaceIdent where we stop. -1 if we traverse a Wall, which should not happen because of collision test. NB: for precision pb, startCol and deltaCol should be snapped on a grid of 1/1024 meters, using snapVector(). NB: for precision pb (stop on edge etc....), return a "Precision problem ident", ie (-2,-2).

Definition at line 1411 of file global_retriever.cpp.

References _RetrieverBank, getInstance, nlinfo, and t.

Referenced by doMove.

bool NLPACS::CGlobalRetriever::testRaytrace const NLMISC::CVectorD   v0,
const NLMISC::CVectorD   v1
[virtual]
 

Make a raytrace test. For the time, always return false.

Implements NLPACS::UGlobalRetriever.

Definition at line 2106 of file global_retriever.cpp.

void NLPACS::CGlobalRetriever::testRotCollisionWithCollisionChains CCollisionSurfaceTemp   cst,
const CVector2f &    startCol,
CSurfaceIdent    startSurface,
const CVector2f    bbox[4]
const [private]
 

reset and fill cst.CollisionDescs with effective collisions against current cst.CollisionChains.

result: new collisionDescs in cst.

Definition at line 1972 of file global_retriever.cpp.

Referenced by testBBoxRot.

void NLPACS::CGlobalRetriever::updateHeight UGlobalPosition   pos const [inline]
 

Upadates the height of the given global position.

Definition at line 361 of file global_retriever.h.

References getMeanHeight.

bool NLPACS::CGlobalRetriever::verticalChain const CCollisionChain   colChain const [private]
 

test if a collisionChain separate 2 walls.

Definition at line 1385 of file global_retriever.cpp.

References getSurfaceById.


Friends And Related Function Documentation

friend class CRetrieverInstance [friend]
 

Definition at line 420 of file global_retriever.h.

Referenced by check, findCollisionChains, getBorders, getInstance, getInstanceFullAccess, getMaterial, getMeanHeight, isWaterPosition, makeInstance, makeLinks, removeInstance, and retrievePosition.


Member Data Documentation

NLMISC::CAABBox NLPACS::CGlobalRetriever::_BBox [protected]
 

The axis aligned bounding box of the global retriever.

Definition at line 120 of file global_retriever.h.

Referenced by init, makeInstance, retrievePosition, and serial.

CQuadGrid<uint32> NLPACS::CGlobalRetriever::_InstanceGrid [protected]
 

The grid of instances.

Definition at line 117 of file global_retriever.h.

Referenced by init, initQuadGrid, makeInstance, and selectInstances.

std::vector<CRetrieverInstance> NLPACS::CGlobalRetriever::_Instances [protected]
 

The instances of the global retriever.

Definition at line 114 of file global_retriever.h.

Referenced by check, distanceToBorder, findCollisionChains, findPath, getBorders, getDoubleGlobalPosition, getGlobalPosition, getIdentifier, getInstance, getInstanceFullAccess, getInstances, getMaterial, getNode, initAll, initQuadGrid, initRetrieveTable, isInterior, isWaterPosition, makeAllLinks, makeInstance, makeLinks, removeInstance, resetAllLinks, retrievePosition, selectInstances, serial, and testCollisionWithCollisionChains.

CCollisionSurfaceTemp NLPACS::CGlobalRetriever::_InternalCST [private]
 

Definition at line 103 of file global_retriever.h.

Referenced by findPath, getBorders, getInternalCST, makeLinks, and retrievePosition.

const CRetrieverBank* NLPACS::CGlobalRetriever::_RetrieverBank [protected]
 

The CRetrieverBank where the commmon retrievers are stored.

Definition at line 111 of file global_retriever.h.

Referenced by CGlobalRetriever, check, findCollisionChains, findPath, getMeanHeight, getRetriever, getRetrieverBank, getSurfaceById, initAll, makeLinks, retrievePosition, setRetrieverBank, testCollisionWithCollisionChains, and testMovementWithCollisionChains.

std::vector<uint8> NLPACS::CGlobalRetriever::_RetrieveTable [private]
 

Used to retrieve the surface. Internal use only, to avoid large amount of new/delete.

Definition at line 106 of file global_retriever.h.

Referenced by initRetrieveTable, and makeInstance.


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