#include <Pos.hpp>
Public Types | |
enum | Direction { EAST = 0, SOUTH_EAST = 32, SOUTH = 64, SOUTH_WEST = 96, WEST = 128, NORTH_WEST = 160, NORTH = 192, NORTH_EAST = 224 } |
A mapping of some common directions to Braybrookians in the xz-plane. More... | |
enum | { MAX_ANIMS = 4 } |
Animation state. More... | |
Public Member Functions | |
Pos () | |
Constructor. | |
void | setPos (const Pos &original) |
Copy all values of original into this. | |
void | setXZ (const Pos &original) |
Copy x and z coordinates from a source. | |
void | setLocalCoor (Point3 &original) |
Set local coordinate. | |
const Point3 & | worldCoor () const |
Return world coordinate. | |
Point3 & | worldCoor () |
Return world coordinate. | |
const ViewPoint & | worldViewPoint () const |
ViewPoint & | worldViewPoint () |
const Euler3 & | worldFace () const |
Euler3 & | worldFace () |
const Point3 & | localCoor () const |
Point3 & | localCoor () |
const ViewPoint & | localViewPoint () const |
ViewPoint & | localViewPoint () |
const Euler3 & | localFace () const |
Euler3 & | localFace () |
bool | localEquals (const ViewPoint &vp) const |
bool | localEquals (const Pos &p) const |
bool | worldEquals (const ViewPoint &vp) const |
bool | worldEquals (const Pos &p) const |
void | setArea (PosComponent &area, bool doKeepWorldCoor=false) |
Set new area. | |
void | setArea (PosComponent &area, const ViewPoint &vp, bool isLocalViewPoint=true) |
Set area and viewpoint. | |
void | resetArea () |
Leave any area. | |
void | setParent (PosComponent &p, bool doKeepWorldCoor=false) |
Set parent. | |
void | resetParent (bool doKeepWorldCoor=true) |
Set parent to none. | |
bool | hasParent () const |
Does the Pos have a parent? | |
bool | didParentMove () const |
Did the parent move last tick? If the parent moved, the world coordinate of this position has changed. | |
PosComponent * | parent () |
Get parent. | |
const PosComponent * | parent () const |
Get parent. | |
void | updateWorldViewPoint () |
Update the world_ viewpoint according to the parents nextPos(). | |
void | areaCoor (const PosComponent &area, Point3 &dest) const |
void | areaFace (const PosComponent &area, Euler3 &dest) const |
void | areaViewPoint (const PosComponent &area, ViewPoint &dest) const |
void | updateLocalViewPoint () |
Update the local_ viewpoint according to the world_ viewpoint and the parents nextPos(). | |
PosComponent * | area () |
The area the Pos is presently in. | |
const PosComponent * | area () const |
The area the Pos is presently in. | |
bool | hasArea () const |
Does the Pos have an area? | |
bool | hasArea (Composite &area) const |
bool | hasArea (Component &area) const |
bool | hasArea (PosComponent &area) const |
short | terrainStyle () const |
The terrain style at the present position. | |
long | touchedTerrain () const |
The terrain styles at the present position and nearby. | |
bool | isKeyFramePath (const Pos &other) const |
Used to check if the positions are in the same or in neighbouring areas. | |
short | clockwiseFaceDirection (short subdivisions) const |
Gets the face direction of the position. | |
bool | hasInFront (const Point3 &coor) const |
Check if coor is in front of the pos. | |
bray_t | xzFaceAwayAngle (const Point3 &towards) const |
Calculate the eyeing angle. | |
coor_t | radius () const |
Get the radius of the position. | |
void | setRadius (coor_t radius) |
Set the radius of the position. | |
void | setBounds (coor_t radius) |
void | setBounds (coor_t radius, coor_t height) |
void | setBounds (const BoundingBox &b) |
bool | hasInside (const Point3 &p) const |
bool | isInsideCollisionRange (const Pos &p) const |
Check if two positions are inside collition range. | |
bool | isInsideCollisionRangeLinf (const Pos &p) const |
Check if two positions are within collision range. | |
bool | isGrounded () const |
Indicates that the pos is not somehow floating in air (climbin, falling, etc.). | |
void | setGrounded (bool state) |
Set wether the character is grounded. | |
void | setIndex (short i) |
Set index of the position. | |
short | index () const |
Get the index of the Pos. | |
bool | hasIndex () const |
Does the Pos have an index? | |
void | setNoIndex () |
Set index to none (-1). | |
PosComponent * | updateArea () |
void | updateIndex () |
Anim & | anim (int index) |
Animation state. | |
const Anim & | anim (int index) const |
Animation state. | |
void | swapAnims (int a, int b) |
Swap 2 animations. | |
void | updateY () |
Update y coordinate to reflect Area height and present Pos layer. | |
void | reset () |
Public Attributes | |
PosComponent * | area_ |
The area this position is inside. | |
PosComponent * | parent_ |
The parent of this position. | |
ViewPoint | local_ |
The position in local coordinates. | |
ViewPoint | world_ |
The position in world coordinates. | |
Anim | anim_ [MAX_ANIMS] |
BoundingBox | bounds_ |
Axis aligned bounding box. | |
short | index_ |
Area's id of the layer that this position is resting on. | |
bool | isGrounded_ |
Static Public Attributes | |
const short | TS_VOID = 0 |
const long | TSM_VOID = (1 << TS_VOID) |
The Pos class maintains coordinates, volume and movement info for Thing and subclasses.
Definition at line 41 of file Pos.hpp.
|
Animation state.
|
|
A mapping of some common directions to Braybrookians in the xz-plane.
|
|
Constructor.
|
|
Animation state. const version. |
|
Animation state.
Definition at line 388 of file Pos.hpp. Referenced by se_core::DefaultTC::_pop(), se_core::CoDefault::_pop(), se_core::PhDefault::blendAnims(), and se_basic::SimpleAreaThingEncoder::encode(). |
|
The area the Pos is presently in. const version. |
|
The area the Pos is presently in.
Definition at line 213 of file Pos.hpp. Referenced by se_basic::PhTrackingCamera::calcNext(), se_basic::PhCirclingCamera::calcNext(), se_core::PhDefault::clampToGround(), se_basic::NavMeshArea::isLineOfSight(), se_basic::NavMeshArea::path(), se_core::PhDefault::revertXZ(), and se_core::SpawnComponent::spawn(). |
|
Definition at line 297 of file Pos.cpp. References Assert, se_core::ViewPoint::coor_, se_core::Euler3::isIdentity(), se_core::PosComponent::nextPos(), se_core::Tuple3::set(), se_core::Tuple3::sub(), world_, and worldFace(). |
|
Definition at line 305 of file Pos.cpp. References Assert, se_core::ViewPoint::face_, se_core::Euler3::isIdentity(), se_core::PosComponent::nextPos(), se_core::Euler3::set(), se_core::Euler3::sub(), world_, and worldFace(). |
|
Definition at line 313 of file Pos.cpp. References se_core::PosComponent::nextPos(), se_core::ViewPoint::setViewPoint(), se_core::ViewPoint::sub(), and world_. |
|
Gets the face direction of the position. 0 is north. 1 is the next subdivision in a clockwise direction. This means east with 4 subdivisions and north_east with 8. |
|
Did the parent move last tick? If the parent moved, the world coordinate of this position has changed. The engine uses this method to check wether it needs to update the world viewpoint. Definition at line 188 of file Pos.cpp. References se_core::PosComponent::didMove(). |
|
|
|
Definition at line 242 of file Pos.cpp. References se_core::Component::owner(). |
|
Definition at line 236 of file Pos.cpp. References se_core::Component::owner(). |
|
Does the Pos have an area?
Definition at line 225 of file Pos.hpp. Referenced by se_basic::PhCirclingCamera::calcNext(), isKeyFramePath(), se_basic::NavMeshArea::path(), and se_basic::EnterTo::perform(). |
|
Does the Pos have an index?
Definition at line 375 of file Pos.hpp. Referenced by se_core::PhDefault::isBlocked(). |
|
Check if coor is in front of the pos. Return true if the coor is in front of the pos, and thus visible to the pos if the the landscape otherwise allows it.
Definition at line 343 of file Pos.cpp. References LogFatal. |
|
Definition at line 315 of file Pos.hpp. References se_core::BoundingBox::hasInside(). |
|
Does the Pos have a parent?
Definition at line 174 of file Pos.hpp. Referenced by se_basic::PhCirclingCamera::calcNext(). |
|
Get the index of the Pos. The meaning of this value is at the discretion of the Area the Pos is inside. -1 does mean that the index is not in in use. Definition at line 370 of file Pos.hpp. Referenced by se_core::PhDefault::clampToGround(), se_basic::NavMeshArea::farthestLineOfSight(), se_basic::NavMesh::isInLineOfSight(), se_basic::NavMeshArea::isLineOfSight(), se_basic::NavMeshArea::path(), se_basic::NavMeshArea::slideAngle(), and se_basic::NavMeshArea::wallAngle(). |
|
Indicates that the pos is not somehow floating in air (climbin, falling, etc.).
Definition at line 344 of file Pos.hpp. Referenced by se_core::PhDefault::clampToGround(), and se_basic::SimpleAreaThingEncoder::encode(). |
|
Check if two positions are inside collition range. See if the sum of the radies are larger than the distance between the two positions.
Definition at line 329 of file Pos.cpp. References coor_double_t, radius(), and worldCoor(). |
|
Check if two positions are within collision range. Check if the two positions are within collision range of each other, but use a collision square instead of a circle.
Definition at line 336 of file Pos.cpp. References coor_t, radius(), and worldCoor(). |
|
Used to check if the positions are in the same or in neighbouring areas. If not, keframe interpolation would be meaningless. Definition at line 66 of file Pos.cpp. References area_, and hasArea(). Referenced by se_core::PhDefault::calcNext(), and se_basic::PhTrackingCamera::calcNext(). |
|
|
|
Definition at line 104 of file Pos.hpp. Referenced by se_core::PhDefault::applyForces(), se_core::PhDefault::clampToGround(), se_basic::NavMesh::isInLineOfSight(), se_basic::NavMeshArea::path(), se_core::PhDefault::revertXZ(), and setXZ(). |
|
Definition at line 122 of file Pos.hpp. References local_. |
|
|
|
|
|
Definition at line 113 of file Pos.hpp. Referenced by se_core::PhDefault::applyForces(), and se_client::PlayerParser::parse(). |
|
|
|
|
|
Get parent. const version. |
|
Get parent.
Definition at line 187 of file Pos.hpp. Referenced by se_basic::PhCirclingCamera::calcNext(). |
|
Get the radius of the position.
Definition at line 288 of file Pos.hpp. References coor_t. Referenced by se_ogre::O3dAreaComponent::compileStaticGeometry(), isInsideCollisionRange(), and isInsideCollisionRangeLinf(). |
|
Definition at line 420 of file Pos.hpp. References se_core::BoundingBox::reset(). |
|
Leave any area.
|
|
Set parent to none.
|
|
Set area and viewpoint.
|
|
Set new area.
Definition at line 204 of file Pos.cpp. Referenced by se_basic::PhTrackingCamera::calcNext(), se_basic::PhCirclingCamera::calcNext(), se_basic::LeaveToAndStopScript::perform(), se_basic::EnterTo::perform(), and se_core::PhDefault::revertXZ(). |
|
|
|
|
|
Definition at line 301 of file Pos.hpp. Referenced by se_basic::SimpleActorFactory::create(). |
|
Set wether the character is grounded. It is up to the physics object what they want to do with this state - typically they set the things y identically to the ground height. Definition at line 351 of file Pos.hpp. Referenced by se_core::PhDefault::clampToGround(). |
|
Set index of the position. The meaning of this value is at the discretion of the Area the Pos is inside. |
|
Set local coordinate.
|
|
Set index to none (-1).
|
|
Set parent.
Definition at line 194 of file Pos.cpp. References se_core::PosComponent::nextPos(), and world_. |
|
Copy all values of original into this.
Definition at line 143 of file Pos.cpp. References anim_, area_, bounds_, index_, isGrounded_, local_, parent_, and world_. |
|
Set the radius of the position.
|
|
Copy x and z coordinates from a source. Both local and world coordinates are copied. This is useful for resetting movement in the xz-plane. Definition at line 164 of file Pos.cpp. References area_, localCoor(), worldCoor(), se_core::Tuple3::x_, and se_core::Tuple3::z_. |
|
Swap 2 animations.
|
|
The terrain style at the present position. The request is passed on to the area the Pos is within. If the Pos does not have an area, TS_VOID is returned. Definition at line 49 of file Pos.cpp. Referenced by se_core::PhDefault::isBlocked(). |
|
The terrain styles at the present position and nearby. The request is passed on to the area the Pos is within. If the Pos does not have an area, TSM_VOID is returned. |
|
Definition at line 248 of file Pos.cpp. Referenced by se_core::PhDefault::calcNext(). |
|
|
|
Update the local_ viewpoint according to the world_ viewpoint and the parents nextPos().
Definition at line 319 of file Pos.cpp. References se_core::ViewPoint::setViewPoint(), and se_core::ViewPoint::sub(). Referenced by se_basic::PhCirclingCamera::calcNext(), and se_core::PhDefault::clampToGround(). |
|
Update the world_ viewpoint according to the parents nextPos(). The parents nextPos().world_ must already be updated. Definition at line 287 of file Pos.cpp. Referenced by se_core::PhDefault::applyForces(), and se_basic::PhTrackingCamera::calcNext(). |
|
Update y coordinate to reflect Area height and present Pos layer. Does nothing if the coordinate has no layer. If the Pos has a layer, updates the y coordinate to reflect the height of the area at the present layer, x and z coordinate.
|
|
Return world coordinate.
|
|
Return world coordinate.
Definition at line 85 of file Pos.hpp. Referenced by se_basic::PhCirclingCamera::calcNext(), se_core::PhDefault::clampToGround(), se_basic::NavMeshArea::farthestLineOfSight(), se_core::ThingCollide::isGuilty(), isInsideCollisionRange(), isInsideCollisionRangeLinf(), se_basic::NavMeshArea::isLineOfSight(), se_basic::NavMeshArea::path(), se_core::PhDefault::revertXZ(), setXZ(), se_basic::NavMeshArea::slideAngle(), and se_basic::NavMeshArea::wallAngle(). |
|
Definition at line 130 of file Pos.hpp. References world_. |
|
|
|
|
|
Definition at line 99 of file Pos.hpp. Referenced by areaCoor(), areaFace(), and se_basic::PhCirclingCamera::calcNext(). |
|
|
|
Definition at line 92 of file Pos.hpp. Referenced by se_basic::SimpleAreaThingEncoder::encode(). |
|
Calculate the eyeing angle. Calculetes the difference between the facing angle of this Pos and the angle towards the Point3 towards.
|
|
Definition at line 447 of file Pos.hpp. Referenced by setPos(). |
|
The area this position is inside.
Definition at line 434 of file Pos.hpp. Referenced by isKeyFramePath(), setPos(), and setXZ(). |
|
Axis aligned bounding box.
Definition at line 452 of file Pos.hpp. Referenced by se_basic::NavMeshArea::path(), setPos(), and se_core::CollisionComponent::whenDoesGeometryCollide(). |
|
Area's id of the layer that this position is resting on.
Definition at line 455 of file Pos.hpp. Referenced by se_core::PhDefault::revertXZ(), and setPos(). |
|
Definition at line 457 of file Pos.hpp. Referenced by setPos(). |
|
The position in local coordinates.
Definition at line 440 of file Pos.hpp. Referenced by se_basic::PhTrackingCamera::calcNext(), localEquals(), se_basic::EnterTo::perform(), and setPos(). |
|
The parent of this position.
Definition at line 437 of file Pos.hpp. Referenced by setPos(). |
|
|
|
|
|
The position in world coordinates.
Definition at line 443 of file Pos.hpp. Referenced by se_core::CollisionAreaComponent::_testCollisionCandidates(), se_core::CollisionAreaComponent::_testCollisionCandidates2(), areaCoor(), areaFace(), areaViewPoint(), se_basic::PhCirclingCamera::calcNext(), se_ogre::O3dAreaComponent::compileStaticGeometry(), setParent(), setPos(), se_core::SpawnComponent::spawn(), se_ogre::ThingBillboard::ThingBillboard(), and worldEquals(). |
Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:27 2007 by Doxygen version 1.3.9.1.