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