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
510{
511 if (Path.empty())
512 return false;
513
514 for (TransportPathContainer::const_reverse_iterator itr = Path.rbegin(); itr != Path.rend(); ++itr)
515 if (time >= itr->first)
516 {
517 curr = itr->second;
518 ASSERT(itr != Path.rbegin());
519 --itr;
520 next = itr->second;
521 percPos = float(time - curr->TimeSeg) / float(next->TimeSeg - curr->TimeSeg);
522 return true;
523 }
524
525 return false;
526}
#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
529{
530 if (Rotations.empty())
531 {
532 curr = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
533 next = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
534 percRot = 0.0f;
535 return;
536 }
537
538 for (TransportPathRotationContainer::const_reverse_iterator itr = Rotations.rbegin(); itr != Rotations.rend(); ++itr)
539 if (time >= itr->first)
540 {
541 uint32 currSeg = itr->second->TimeSeg, nextSeg;
542 curr = G3D::Quat(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
543 if (itr != Rotations.rbegin())
544 {
545 --itr;
546 next = G3D::Quat(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
547 nextSeg = itr->second->TimeSeg;
548 }
549 else
550 {
551 next = G3D::Quat(Rotations.begin()->second->X, Rotations.begin()->second->Y, Rotations.begin()->second->Z, Rotations.begin()->second->W);
552 nextSeg = this->TotalTime;
553 }
554 percRot = float(time - currSeg) / float(nextSeg - currSeg);
555 return;
556 }
557
558 curr = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
559 next = G3D::Quat(0.0f, 0.0f, 0.0f, 1.0f);
560 percRot = 0.0f;
561}
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: