AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
TransportAnimation Struct Reference

#include "TransportMgr.h"

Public Member Functions

 TransportAnimation ()
 
bool GetAnimNode (uint32 time, TransportAnimationEntry const *&curr, TransportAnimationEntry const *&next, float &percPos) const
 
void GetAnimRotation (uint32 time, G3D::Quat &curr, G3D::Quat &next, float &percRot) const
 

Public Attributes

TransportPathContainer Path
 
TransportPathRotationContainer Rotations
 
uint32 TotalTime
 

Detailed Description

Constructor & Destructor Documentation

◆ TransportAnimation()

TransportAnimation::TransportAnimation ( )
inline
89: TotalTime(0) { }
uint32 TotalTime
Definition TransportMgr.h:93

Member Function Documentation

◆ GetAnimNode()

bool TransportAnimation::GetAnimNode ( uint32  time,
TransportAnimationEntry const *&  curr,
TransportAnimationEntry const *&  next,
float &  percPos 
) const
493{
494 if (Path.empty())
495 return false;
496
497 for (TransportPathContainer::const_reverse_iterator itr = Path.rbegin(); itr != Path.rend(); ++itr)
498 if (time >= itr->first)
499 {
500 curr = itr->second;
501 ASSERT(itr != Path.rbegin());
502 --itr;
503 next = itr->second;
504 percPos = float(time - curr->TimeSeg) / float(next->TimeSeg - curr->TimeSeg);
505 return true;
506 }
507
508 return false;
509}
#define ASSERT
Definition Errors.h:68
TransportPathContainer Path
Definition TransportMgr.h:91

References ASSERT, Path, and TransportAnimationEntry::TimeSeg.

Referenced by StaticTransport::RelocateToProgress().

◆ GetAnimRotation()

void TransportAnimation::GetAnimRotation ( uint32  time,
G3D::Quat &  curr,
G3D::Quat &  next,
float &  percRot 
) const
512{
513 if (Rotations.empty())
514 {
515 curr = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
516 next = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
517 percRot = 0.0f;
518 return;
519 }
520
521 for (TransportPathRotationContainer::const_reverse_iterator itr = Rotations.rbegin(); itr != Rotations.rend(); ++itr)
522 if (time >= itr->first)
523 {
524 uint32 currSeg = itr->second->TimeSeg, nextSeg;
525 curr = G3D::Quat(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
526 if (itr != Rotations.rbegin())
527 {
528 --itr;
529 next = G3D::Quat(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
530 nextSeg = itr->second->TimeSeg;
531 }
532 else
533 {
534 next = G3D::Quat(Rotations.begin()->second->X, Rotations.begin()->second->Y, Rotations.begin()->second->Z, Rotations.begin()->second->W);
535 nextSeg = this->TotalTime;
536 }
537 percRot = float(time - currSeg) / float(nextSeg - currSeg);
538 return;
539 }
540
541 curr = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
542 next = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
543 percRot = 0.0f;
544}
std::uint32_t uint32
Definition Define.h:107
TransportPathRotationContainer Rotations
Definition TransportMgr.h:92

References Rotations, and TotalTime.

Referenced by StaticTransport::RelocateToProgress().

Member Data Documentation

◆ Path

TransportPathContainer TransportAnimation::Path

◆ Rotations

TransportPathRotationContainer TransportAnimation::Rotations

Referenced by GetAnimRotation().

◆ TotalTime


The documentation for this struct was generated from the following files: