TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TransportBase Class Referenceabstract

#include <VehicleDefines.h>

Public Member Functions

virtual void CalculatePassengerPosition (float &x, float &y, float &z, float *o=NULL) const =0
 This method transforms supplied transport offsets into global coordinates. More...
 
virtual void CalculatePassengerOffset (float &x, float &y, float &z, float *o=NULL) const =0
 This method transforms supplied global coordinates into local offsets. More...
 

Static Public Member Functions

static void CalculatePassengerPosition (float &x, float &y, float &z, float *o, float transX, float transY, float transZ, float transO)
 
static void CalculatePassengerOffset (float &x, float &y, float &z, float *o, float transX, float transY, float transZ, float transO)
 

Protected Member Functions

 TransportBase ()
 
virtual ~TransportBase ()
 

Constructor & Destructor Documentation

TransportBase::TransportBase ( )
inlineprotected
122 { }
virtual TransportBase::~TransportBase ( )
inlineprotectedvirtual
123 { }

Member Function Documentation

virtual void TransportBase::CalculatePassengerOffset ( float &  x,
float &  y,
float &  z,
float *  o = NULL 
) const
pure virtual

This method transforms supplied global coordinates into local offsets.

Implemented in Vehicle, and Transport.

+ Here is the caller graph for this function:

static void TransportBase::CalculatePassengerOffset ( float &  x,
float &  y,
float &  z,
float *  o,
float  transX,
float  transY,
float  transZ,
float  transO 
)
inlinestatic
144  {
145  if (o)
146  *o = Position::NormalizeOrientation(*o - transO);
147 
148  z -= transZ;
149  y -= transY; // y = searchedY * std::cos(o) + searchedX * std::sin(o)
150  x -= transX; // x = searchedX * std::cos(o) + searchedY * std::sin(o + pi)
151  float inx = x, iny = y;
152  y = (iny - inx * std::tan(transO)) / (std::cos(transO) + std::sin(transO) * std::tan(transO));
153  x = (inx + iny * std::tan(transO)) / (std::cos(transO) + std::sin(transO) * std::tan(transO));
154  }
static float NormalizeOrientation(float o)
Definition: Position.h:211
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

virtual void TransportBase::CalculatePassengerPosition ( float &  x,
float &  y,
float &  z,
float *  o = NULL 
) const
pure virtual

This method transforms supplied transport offsets into global coordinates.

Implemented in Vehicle, and Transport.

+ Here is the caller graph for this function:

static void TransportBase::CalculatePassengerPosition ( float &  x,
float &  y,
float &  z,
float *  o,
float  transX,
float  transY,
float  transZ,
float  transO 
)
inlinestatic
133  {
134  float inx = x, iny = y, inz = z;
135  if (o)
136  *o = Position::NormalizeOrientation(transO + *o);
137 
138  x = transX + inx * std::cos(transO) - iny * std::sin(transO);
139  y = transY + iny * std::cos(transO) + inx * std::sin(transO);
140  z = transZ + inz;
141  }
static float NormalizeOrientation(float o)
Definition: Position.h:211
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:


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