26 #include <csgeom/transfrm.h> 27 #include <csutil/parray.h> 28 #include <csutil/weakref.h> 58 csHash<csReversibleTransform*, csPtrKey<iSector> > trans;
63 return trans.GetIterator();
67 void Set(iSector* sector, csReversibleTransform transform)
69 csReversibleTransform* transf = trans.Get(csPtrKey<iSector> (sector), NULL);
73 transf =
new csReversibleTransform();
74 trans.Put(csPtrKey<iSector> (sector), transf);
80 csReversibleTransform*
Get(iSector* sector)
82 csReversibleTransform* got = trans.Get(csPtrKey<iSector> (sector), NULL);
89 csHash<csReversibleTransform*, csPtrKey<iSector> >
::GlobalIterator iter = trans.GetIterator();
115 bool WarpSpace(
const iSector* from,
const iSector* to, csVector3 &pos);
121 bool Connected(
const iSector* from,
const iSector* to);
125 float Distance(
const csVector3 &from_pos,
const iSector* from_sector, csVector3 to_pos,
const iSector* to_sector);
129 float Distance2(
const csVector3 &from_pos,
const iSector* from_sector, csVector3 to_pos,
const iSector* to_sector);
132 float Distance(iMeshWrapper* ent1, iMeshWrapper* ent2);
135 void GetPosition(iMeshWrapper* entity, csVector3 &pos,
float* yrot, iSector* §or);
151 static csVector3
Matrix2Rot(
const csMatrix3 &mat);
psWorld is in charge of managing all regions (zone map files) and loading/unloading them as needed...
bool Connected(const iSector *from, const iSector *to)
Checks whether 2 sectors are connected via a warp portal.
csWeakRef< iEngine > engine
float Distance2(const csVector3 &from_pos, const iSector *from_sector, csVector3 to_pos, const iSector *to_sector)
Calculate the 2d distance between two to points either in same or different sectors. Return INFINITY_DISTANCE if no connection sectors where found.
void GetAllRegionNames(csString &str)
This makes a string out of all region names, separated by | chars.
csArray< sectorTransformation > transarray
static float Matrix2YRot(const csMatrix3 &mat)
obtain final rotation about y axis of an object.
bool WarpSpaceRelative(const iSector *from, const iSector *to, csVector3 &pos)
Changes pos according to the warp portal between adjacent sectors from and to using a relative transf...
csRef< iBgLoader > loader
bool NewRegion(const char *mapfile)
Create a new psRegion entry and load it if specified.
csRef< iStringArray > regions
bool Initialize(iObjectRegistry *object_reg)
Initialize psWorld.
bool WarpSpace(const iSector *from, const iSector *to, csVector3 &pos)
Changes pos according to the warp portal between adjacent sectors from and to.
iEngine * GetEngine()
obtain the engine.
static csVector3 Matrix2Rot(const csMatrix3 &mat)
obtain the rotation about the axes - expensive.
iObjectRegistry * object_reg
float Distance(const csVector3 &from_pos, const iSector *from_sector, csVector3 to_pos, const iSector *to_sector)
Calculate the distance between two to points either in same or different sectors. Return INFINITY_DIS...
void GetPosition(iMeshWrapper *entity, csVector3 &pos, float *yrot, iSector *§or)
Return an enties position.