OverSim
|
#include <Vector2D.h>
Public Member Functions | |
Vector2D () | |
Vector2D (double x, double y) | |
void | normalize () |
double | distanceSqr (const Vector2D v) const |
double | xyMaxDistance (const Vector2D v) const |
double | cosAngle (const Vector2D &v) const |
int | getQuadrant (const Vector2D &v) const |
Determine the Quarant a point is contained in. | |
Vector2D & | operator= (const Vector2D &v) |
Vector2D & | operator+= (const Vector2D &v) |
Vector2D & | operator-= (const Vector2D &v) |
Vector2D & | operator*= (const double s) |
Vector2D & | operator/= (const double s) |
Vector2D | operator+ (const Vector2D &v) const |
Vector2D | operator- (const Vector2D &v) const |
Vector2D | operator* (const double s) const |
Vector2D | operator/ (const double s) const |
bool | operator== (const Vector2D &v) const |
bool | operator!= (const Vector2D &v) const |
void | netPack (cCommBuffer *b) |
void | netUnpack (cCommBuffer *b) |
Public Attributes | |
double | x |
double | y |
Friends | |
bool | operator< (const Vector2D &a, const Vector2D &b) |
std::ostream & | operator<< (std::ostream &Stream, const Vector2D &v) |
Definition at line 31 of file Vector2D.h.
Vector2D::Vector2D | ( | ) |
Definition at line 27 of file Vector2D.cc.
Vector2D::Vector2D | ( | double | x, |
double | y | ||
) |
double Vector2D::cosAngle | ( | const Vector2D & | v | ) | const |
double Vector2D::distanceSqr | ( | const Vector2D | v | ) | const |
Definition at line 49 of file Vector2D.cc.
Referenced by Quon::classifySites(), QuonAOI::collide(), MovementGenerator::flock(), hotspotRoaming::getDistanceFromHotspot(), LoginCache::getLoginNode(), Quon::handleJoinRequest(), Vast::handleJoinRequest(), ConnectivityProbeApp::handleMessage(), ConnectivityProbe::handleMessage(), SimpleGameClient::handleTimerEvent(), groupRoaming::move(), traverseRoaming::move(), randomRoaming::move(), and hotspotRoaming::move().
int Vector2D::getQuadrant | ( | const Vector2D & | v | ) | const |
Determine the Quarant a point is contained in.
Return the quadrant of this point that containes point v. Upper right quadrant is 0, lower right is 1, lower left is 2 and upper left is 3
v | the target point |
Definition at line 78 of file Vector2D.cc.
Referenced by Quon::classifySites(), and NTreeNode::getChildForPos().
void Vector2D::netPack | ( | cCommBuffer * | b | ) |
Definition at line 184 of file Vector2D.cc.
Referenced by doPacking().
void Vector2D::netUnpack | ( | cCommBuffer * | b | ) |
Definition at line 191 of file Vector2D.cc.
Referenced by doUnpacking().
void Vector2D::normalize | ( | ) |
Definition at line 39 of file Vector2D.cc.
Referenced by MovementGenerator::flock(), MovementGenerator::MovementGenerator(), traverseRoaming::traverseRoaming(), and SimpleGameClient::updateNeighbors().
bool Vector2D::operator!= | ( | const Vector2D & | v | ) | const |
Vector2D Vector2D::operator* | ( | const double | s | ) | const |
Vector2D & Vector2D::operator*= | ( | const double | s | ) |
Definition at line 109 of file Vector2D.cc.
Vector2D Vector2D::operator/ | ( | const double | s | ) | const |
Vector2D & Vector2D::operator/= | ( | const double | s | ) |
Definition at line 116 of file Vector2D.cc.
bool Vector2D::operator== | ( | const Vector2D & | v | ) | const |
double Vector2D::xyMaxDistance | ( | const Vector2D | v | ) | const |
Definition at line 57 of file Vector2D.cc.
Referenced by Quon::classifySites(), QuonAOI::collide(), and NTreeScope::contains().
|
friend |
Definition at line 179 of file Vector2D.cc.
double Vector2D::x |
Definition at line 37 of file Vector2D.h.
Referenced by Geometry::bisect(), BoundingBox2D::BoundingBox2D(), Vast::buildVoronoi(), BoundingBox2D::collide(), cosAngle(), Geometry::dist(), distanceSqr(), EdgeList::ELleftbnd(), getQuadrant(), NTreeScope::getSubScope(), greatGathering::greatGathering(), groupRoaming::groupRoaming(), PubSubLobby::handleJoin(), SimpleGameClient::handleLowerMessage(), ConnectivityProbeQuon::handleMessage(), ConnectivityProbe::handleMessage(), PubSubMMOG::handleMove(), SimMud::handleMove(), SimpleGameClient::handleRealworldPacket(), PubSubLobby::handleRespCall(), PubSubMMOG::handleTakeOver(), PubSubLobby::handleTakeOverResponse(), PubSubLobby::handleTakeOverTimeout(), hotspotRoaming::hotspotRoaming(), Geometry::initialize(), Geometry::intersect(), Geometry::intersectCircleLine(), Geometry::intersectCircleSite(), BoundingBox2D::left(), groupRoaming::move(), randomRoaming::move(), hotspotRoaming::move(), MovementGenerator::MovementGenerator(), netPack(), netUnpack(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator=(), operator==(), HeapPQ::PQ_min(), HeapPQ::PQinsert(), Geometry::processEdge(), randomRoaming::randomRoaming(), BoundingBox2D::right(), EdgeList::right_of(), MovementGenerator::testBounds(), traverseRoaming::traverseRoaming(), SimpleGameClient::updateNeighbors(), Vector2D(), and xyMaxDistance().
double Vector2D::y |
Definition at line 37 of file Vector2D.h.
Referenced by Geometry::bisect(), BoundingBox2D::bottom(), BoundingBox2D::BoundingBox2D(), Vast::buildVoronoi(), BoundingBox2D::collide(), cosAngle(), Geometry::dist(), distanceSqr(), getQuadrant(), NTreeScope::getSubScope(), greatGathering::greatGathering(), groupRoaming::groupRoaming(), PubSubLobby::handleJoin(), SimpleGameClient::handleLowerMessage(), ConnectivityProbeQuon::handleMessage(), ConnectivityProbe::handleMessage(), PubSubMMOG::handleMove(), SimMud::handleMove(), SimpleGameClient::handleRealworldPacket(), PubSubLobby::handleRespCall(), PubSubMMOG::handleTakeOver(), PubSubLobby::handleTakeOverResponse(), PubSubLobby::handleTakeOverTimeout(), hotspotRoaming::hotspotRoaming(), Geometry::initialize(), Geometry::intersect(), Geometry::intersectCircleLine(), Geometry::intersectCircleSite(), groupRoaming::move(), randomRoaming::move(), hotspotRoaming::move(), MovementGenerator::MovementGenerator(), netPack(), netUnpack(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator=(), operator==(), HeapPQ::PQ_min(), HeapPQ::PQinsert(), Geometry::processEdge(), randomRoaming::randomRoaming(), EdgeList::right_of(), MovementGenerator::testBounds(), BoundingBox2D::top(), traverseRoaming::traverseRoaming(), SimpleGameClient::updateNeighbors(), Vector2D(), and xyMaxDistance().