#include <netAspect.h>
Public Member Functions | |
NetAspect (Entity *ent, UnitAspectType at) | |
void | init () |
void | tick (double dt) |
void | lerpPos () |
void | lerpRot () |
void | updateEcslent (double dt) |
void | createEntity (EntityType entType, Ogre::Vector3 pos) |
void | squalch () |
void | setEntityBeingBuilt (int entID) |
NetAspect (Entity *ent, UnitAspectType at) | |
void | init () |
void | tick (double dt) |
void | lerpPos () |
void | lerpRot () |
void | updateEcslent (double dt) |
void | squalch () |
NetAspect (Entity *ent, UnitAspectType at) | |
void | init () |
void | tick (double dt) |
void | lerpPos () |
void | lerpRot () |
void | updateEcslent (double dt) |
void | squalch () |
Public Attributes | |
float | ds |
float | dh |
float | SPEED_TOLERANCE |
float | HEADING_TOLERANCE |
std::deque< State * > | updateQueue |
std::deque< State * > | updateQueue |
std::deque< State * > | updateQueue |
Private Member Functions | |
void | initNetworking () |
void | updateServer (float newDS, float newDH) |
bool | withinSpeedTolerance (float a, float b) |
bool | withinHeadingTolerance (float a, float b) |
void | squalchOtherClients () |
bool | isValid (State *state) |
void | clearQueue (std::deque< State * > *queue, int size) |
void | setEntityBeingBuilt (Entity *ent) |
bool | checkPendingEntityId () |
void | requestMineralPatchID () |
void | initNetworking () |
void | updateServer (float newDS, float newDH) |
bool | withinSpeedTolerance (float a, float b) |
bool | withinHeadingTolerance (float a, float b) |
void | squalchOtherClients () |
bool | isValid (State *state) |
void | clearQueue (std::deque< State * > *queue, int size) |
void | initNetworking () |
void | updateServer (float newDS, float newDH) |
bool | withinSpeedTolerance (float a, float b) |
bool | withinHeadingTolerance (float a, float b) |
void | squalchOtherClients () |
bool | isValid (State *state) |
void | clearQueue (std::deque< State * > *queue, int size) |
Private Attributes | |
int | id |
Ogre::Vector3 | remoteVel |
Ogre::Vector3 | remotePos |
Ogre::Vector3 | nextRemotePos |
Ogre::Vector3 | nextPos |
Ogre::Vector3 | diffPos |
Ogre::Vector3 | diffPosFrac |
Ogre::Quaternion | remoteQuat |
Ogre::Quaternion | destOrie |
Ogre::Quaternion | srcOrie |
Ogre::Quaternion | finalDestOrie |
float | rotFactor |
float | rotProgress |
int | oldTime |
float | latency |
float | nSteps |
Ogre::Quaternion | qDelta |
float | deltaYaw |
bool | firstTick |
State | statusData |
int | pendingEntityId |
Definition at line 18 of file netAspect.h.
FastEcslent::NetAspect::NetAspect | ( | Entity * | ent, | |
UnitAspectType | at | |||
) | [inline] |
Definition at line 62 of file netAspect.h.
FastEcslent::NetAspect::NetAspect | ( | Entity * | ent, | |
UnitAspectType | at | |||
) | [inline] |
Definition at line 57 of file netAspect.h.
FastEcslent::NetAspect::NetAspect | ( | Entity * | ent, | |
UnitAspectType | at | |||
) | [inline] |
Definition at line 57 of file netAspect.h.
void FastEcslent::NetAspect::initNetworking | ( | ) | [private] |
Definition at line 18 of file netAspect.cpp.
References clearQueue(), FastEcslent::Entity::desiredHeading, FastEcslent::Entity::desiredSpeed, dh, ds, FastEcslent::UnitAspect::entity, FastEcslent::Entity::entityType, latency, FastEcslent::Minerals::mineralPatchId, FastEcslent::MINERALS, nSteps, oldTime, FastEcslent::Entity::pos, remotePos, remoteVel, requestMineralPatchID(), rotFactor, rotProgress, FastEcslent::Entity::speed, statusData, updateQueue, and FastEcslent::Entity::yaw.
Referenced by tick().
void FastEcslent::NetAspect::updateServer | ( | float | newDS, | |
float | newDH | |||
) | [private] |
Definition at line 151 of file netAspect.cpp.
References FastEcslent::NetThread::addCommand(), FastEcslent::NetThread::addSquelch(), dh, ds, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::NetThread::getNetId(), FastEcslent::Engine::net, pi, withinHeadingTolerance(), and withinSpeedTolerance().
Referenced by tick().
bool FastEcslent::NetAspect::withinSpeedTolerance | ( | float | a, | |
float | b | |||
) | [private] |
Definition at line 143 of file netAspect.cpp.
References SPEED_TOLERANCE.
Referenced by updateServer().
bool FastEcslent::NetAspect::withinHeadingTolerance | ( | float | a, | |
float | b | |||
) | [private] |
Definition at line 147 of file netAspect.cpp.
References HEADING_TOLERANCE.
Referenced by updateServer().
void FastEcslent::NetAspect::squalchOtherClients | ( | ) | [private] |
Definition at line 185 of file netAspect.cpp.
References FastEcslent::Entity::ai, FastEcslent::UnitAspect::entity, FastEcslent::NETSLAVE, and FastEcslent::UnitAI::state.
bool FastEcslent::NetAspect::isValid | ( | State * | state | ) | [private] |
Definition at line 170 of file netAspect.cpp.
void FastEcslent::NetAspect::clearQueue | ( | std::deque< State * > * | queue, | |
int | size | |||
) | [private] |
void FastEcslent::NetAspect::setEntityBeingBuilt | ( | Entity * | ent | ) | [private] |
Definition at line 211 of file netAspect.cpp.
References FastEcslent::Entity::builder, FastEcslent::UnitAspect::entity, FastEcslent::Builder::entityBeingBuilt, pendingEntityId, and FastEcslent::Builder::waitNetworkResponse.
Referenced by FastEcslent::NetThread::createEntFromClientRes(), and tick().
bool FastEcslent::NetAspect::checkPendingEntityId | ( | ) | [private] |
void FastEcslent::NetAspect::requestMineralPatchID | ( | ) | [private] |
Definition at line 52 of file netAspect.cpp.
References FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, FastEcslent::NetThread::getNetId(), FastEcslent::Engine::net, and FastEcslent::NetThread::requestMineralPatchID().
Referenced by initNetworking().
void FastEcslent::NetAspect::init | ( | void | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
Definition at line 10 of file netAspect.cpp.
References firstTick, HEADING_TOLERANCE, pendingEntityId, and SPEED_TOLERANCE.
Referenced by FastEcslent::Entity::init().
void FastEcslent::NetAspect::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
Definition at line 56 of file netAspect.cpp.
References FastEcslent::Entity::ai, FastEcslent::Entity::desiredHeading, FastEcslent::Entity::desiredSpeed, FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, firstTick, FastEcslent::NetThread::getEntityFromNetId(), initNetworking(), Options::isServer, FastEcslent::MANUAL, FastEcslent::Engine::net, FastEcslent::NETSLAVE, FastEcslent::Engine::options, pendingEntityId, setEntityBeingBuilt(), FastEcslent::UnitAI::state, updateEcslent(), and updateServer().
void FastEcslent::NetAspect::lerpPos | ( | ) |
Definition at line 120 of file netAspect.cpp.
References diffPos, diffPosFrac, FastEcslent::UnitAspect::entity, latency, nextPos, nextRemotePos, nSteps, FastEcslent::Entity::pos, remotePos, remoteVel, statusData, and FastEcslent::Entity::vel.
Referenced by updateEcslent().
void FastEcslent::NetAspect::lerpRot | ( | ) |
Definition at line 129 of file netAspect.cpp.
References destOrie, FastEcslent::UnitAspect::entity, finalDestOrie, HEADING_TOLERANCE, latency, nSteps, pitchYawRoll(), remoteQuat, rotFactor, rotProgress, srcOrie, statusData, toDegrees(), and FastEcslent::Entity::yaw.
Referenced by updateEcslent().
void FastEcslent::NetAspect::updateEcslent | ( | double | dt | ) |
Definition at line 74 of file netAspect.cpp.
References clearQueue(), deltaYaw, FastEcslent::Entity::desiredHeading, FastEcslent::Entity::desiredSpeed, destOrie, diffPosFrac, FastEcslent::UnitAspect::entity, FastEcslent::Entity::hitpoints, latency, lerpPos(), lerpRot(), nSteps, oldTime, FastEcslent::Entity::pos, qDelta, rotFactor, rotProgress, srcOrie, statusData, FastEcslent::Entity::timeLeftToBirth, updateQueue, and FastEcslent::Entity::yaw.
Referenced by tick().
void FastEcslent::NetAspect::createEntity | ( | EntityType | entType, | |
Ogre::Vector3 | pos | |||
) |
Definition at line 116 of file netAspect.cpp.
References FastEcslent::NetThread::createEntFromClientReq(), FastEcslent::Entity::engine, FastEcslent::UnitAspect::entity, and FastEcslent::Engine::net.
void FastEcslent::NetAspect::squalch | ( | ) |
Definition at line 179 of file netAspect.cpp.
References FastEcslent::Entity::ai, FastEcslent::UnitAspect::entity, FastEcslent::NETSLAVE, and FastEcslent::UnitAI::state.
void FastEcslent::NetAspect::setEntityBeingBuilt | ( | int | entID | ) |
void FastEcslent::NetAspect::initNetworking | ( | ) | [private] |
void FastEcslent::NetAspect::updateServer | ( | float | newDS, | |
float | newDH | |||
) | [private] |
bool FastEcslent::NetAspect::withinSpeedTolerance | ( | float | a, | |
float | b | |||
) | [private] |
bool FastEcslent::NetAspect::withinHeadingTolerance | ( | float | a, | |
float | b | |||
) | [private] |
void FastEcslent::NetAspect::squalchOtherClients | ( | ) | [private] |
bool FastEcslent::NetAspect::isValid | ( | State * | state | ) | [private] |
void FastEcslent::NetAspect::clearQueue | ( | std::deque< State * > * | queue, | |
int | size | |||
) | [private] |
void FastEcslent::NetAspect::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
void FastEcslent::NetAspect::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
void FastEcslent::NetAspect::lerpPos | ( | ) |
void FastEcslent::NetAspect::lerpRot | ( | ) |
void FastEcslent::NetAspect::updateEcslent | ( | double | dt | ) |
void FastEcslent::NetAspect::squalch | ( | ) |
void FastEcslent::NetAspect::initNetworking | ( | ) | [private] |
void FastEcslent::NetAspect::updateServer | ( | float | newDS, | |
float | newDH | |||
) | [private] |
bool FastEcslent::NetAspect::withinSpeedTolerance | ( | float | a, | |
float | b | |||
) | [private] |
bool FastEcslent::NetAspect::withinHeadingTolerance | ( | float | a, | |
float | b | |||
) | [private] |
void FastEcslent::NetAspect::squalchOtherClients | ( | ) | [private] |
bool FastEcslent::NetAspect::isValid | ( | State * | state | ) | [private] |
void FastEcslent::NetAspect::clearQueue | ( | std::deque< State * > * | queue, | |
int | size | |||
) | [private] |
void FastEcslent::NetAspect::init | ( | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
void FastEcslent::NetAspect::tick | ( | double | dt | ) | [virtual] |
Reimplemented from FastEcslent::UnitAspect.
void FastEcslent::NetAspect::lerpPos | ( | ) |
void FastEcslent::NetAspect::lerpRot | ( | ) |
void FastEcslent::NetAspect::updateEcslent | ( | double | dt | ) |
void FastEcslent::NetAspect::squalch | ( | ) |
int FastEcslent::NetAspect::id [private] |
Definition at line 20 of file netAspect.h.
Ogre::Vector3 FastEcslent::NetAspect::remoteVel [private] |
Ogre::Vector3 FastEcslent::NetAspect::remotePos [private] |
Ogre::Vector3 FastEcslent::NetAspect::nextRemotePos [private] |
Ogre::Vector3 FastEcslent::NetAspect::nextPos [private] |
Ogre::Vector3 FastEcslent::NetAspect::diffPos [private] |
Ogre::Vector3 FastEcslent::NetAspect::diffPosFrac [private] |
Ogre::Quaternion FastEcslent::NetAspect::remoteQuat [private] |
Ogre::Quaternion FastEcslent::NetAspect::destOrie [private] |
Ogre::Quaternion FastEcslent::NetAspect::srcOrie [private] |
Ogre::Quaternion FastEcslent::NetAspect::finalDestOrie [private] |
float FastEcslent::NetAspect::rotFactor [private] |
Definition at line 33 of file netAspect.h.
Referenced by initNetworking(), lerpRot(), and updateEcslent().
float FastEcslent::NetAspect::rotProgress [private] |
Definition at line 34 of file netAspect.h.
Referenced by initNetworking(), lerpRot(), and updateEcslent().
int FastEcslent::NetAspect::oldTime [private] |
float FastEcslent::NetAspect::latency [private] |
Definition at line 37 of file netAspect.h.
Referenced by initNetworking(), lerpPos(), lerpRot(), and updateEcslent().
float FastEcslent::NetAspect::nSteps [private] |
Definition at line 38 of file netAspect.h.
Referenced by initNetworking(), lerpPos(), lerpRot(), and updateEcslent().
Ogre::Quaternion FastEcslent::NetAspect::qDelta [private] |
float FastEcslent::NetAspect::deltaYaw [private] |
bool FastEcslent::NetAspect::firstTick [private] |
State FastEcslent::NetAspect::statusData [private] |
Definition at line 45 of file netAspect.h.
Referenced by initNetworking(), lerpPos(), lerpRot(), and updateEcslent().
int FastEcslent::NetAspect::pendingEntityId [private] |
Definition at line 47 of file netAspect.h.
Referenced by checkPendingEntityId(), init(), setEntityBeingBuilt(), and tick().
Definition at line 78 of file netAspect.h.
Referenced by init(), lerpRot(), and withinHeadingTolerance().
std::deque<State *> FastEcslent::NetAspect::updateQueue |
Definition at line 80 of file netAspect.h.
Referenced by initNetworking(), updateEcslent(), and FastEcslent::NetThread::updateState().
std::deque<State *> FastEcslent::NetAspect::updateQueue |
Definition at line 72 of file netAspect.h.
std::deque<State *> FastEcslent::NetAspect::updateQueue |
Definition at line 72 of file netAspect.h.