OregonCore  revision be9e804-git
Your Favourite TBC server
MovementInfo Struct Reference

#include <Object.h>

Public Member Functions

 MovementInfo ()
 
void Read (ByteBuffer &data)
 
void Write (ByteBuffer &data) const
 
void AddMovementFlag (MovementFlags f)
 
void RemoveMovementFlag (MovementFlags f)
 
bool HasMovementFlag (MovementFlags f) const
 
MovementFlags GetMovementFlags () const
 
void SetMovementFlags (MovementFlags f)
 
Position const * GetPos () const
 
void SetTransportData (uint64 guid, float x, float y, float z, float o, uint32 time)
 
void ClearTransportData ()
 
uint64 const & GetTransportGuid () const
 
Position const * GetTransportPos () const
 
uint32 GetTransportTime () const
 
uint32 GetFallTime () const
 
void ChangePosition (float x, float y, float z, float o)
 
void UpdateTime (uint32 _time)
 

Public Attributes

uint32 moveFlags
 
uint8 moveFlags2
 
uint32 time
 
Position pos
 
uint64 t_guid
 
Position t_pos
 
uint32 t_time
 
float s_pitch
 
uint32 fallTime
 
float j_velocity
 
float j_sinAngle
 
float j_cosAngle
 
float j_xyspeed
 
float u_unk1
 

Detailed Description

Definition at line 429 of file Object.h.

Constructor & Destructor Documentation

MovementInfo::MovementInfo ( )
inline

Definition at line 447 of file Object.h.

References Position::Relocate().

448  t_time(0), s_pitch(0.0f), fallTime(0), j_velocity(0.0f), j_sinAngle(0.0f),
449  j_cosAngle(0.0f), j_xyspeed(0.0f), u_unk1(0.0f)
450  {
451  t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
452  }
float s_pitch
Definition: Object.h:440
float j_cosAngle
Definition: Object.h:444
float u_unk1
Definition: Object.h:446
uint32 time
Definition: Object.h:433
float j_sinAngle
Definition: Object.h:444
void Relocate(float x, float y)
Definition: Position.h:65
uint8 moveFlags2
Definition: Object.h:432
uint32 moveFlags
Definition: Object.h:431
uint64 t_guid
Definition: Object.h:436
uint32 t_time
Definition: Object.h:438
float j_velocity
Definition: Object.h:444
Position t_pos
Definition: Object.h:437
float j_xyspeed
Definition: Object.h:444
uint32 fallTime
Definition: Object.h:442

Member Function Documentation

void MovementInfo::AddMovementFlag ( MovementFlags  f)
inline

Definition at line 459 of file Object.h.

460  {
461  moveFlags |= f;
462  }
uint32 moveFlags
Definition: Object.h:431
void MovementInfo::ChangePosition ( float  x,
float  y,
float  z,
float  o 
)
inline

Definition at line 519 of file Object.h.

References Position::m_positionX, Position::m_positionY, Position::m_positionZ, and Position::SetOrientation().

Referenced by Player::BuildTeleportAckMsg().

520  {
521  pos.m_positionX = x;
522  pos.m_positionY = y;
523  pos.m_positionZ = z;
524  pos.SetOrientation(o);
525  }
float m_positionY
Definition: Position.h:51
void SetOrientation(float orientation)
Definition: Position.h:92
float m_positionX
Definition: Position.h:50
Position pos
Definition: Object.h:434
float m_positionZ
Definition: Position.h:52
void MovementInfo::ClearTransportData ( )
inline

Definition at line 494 of file Object.h.

References Position::m_positionX, Position::m_positionY, Position::m_positionZ, and Position::SetOrientation().

Referenced by Player::TeleportTo().

495  {
496  t_guid = 0;
497  t_pos.m_positionX = 0.0f;
498  t_pos.m_positionY = 0.0f;
499  t_pos.m_positionZ = 0.0f;
500  t_pos.SetOrientation(0.0f);
501  t_time = 0;
502  }
float m_positionY
Definition: Position.h:51
void SetOrientation(float orientation)
Definition: Position.h:92
float m_positionX
Definition: Position.h:50
float m_positionZ
Definition: Position.h:52
uint64 t_guid
Definition: Object.h:436
uint32 t_time
Definition: Object.h:438
Position t_pos
Definition: Object.h:437
uint32 MovementInfo::GetFallTime ( ) const
inline

Definition at line 515 of file Object.h.

Referenced by Object::_BuildMovementUpdate(), and Player::HandleFallDamage().

516  {
517  return fallTime;
518  }
uint32 fallTime
Definition: Object.h:442
MovementFlags MovementInfo::GetMovementFlags ( ) const
inline

Definition at line 471 of file Object.h.

Referenced by Movement::MoveSplineInit::Launch().

472  {
473  return MovementFlags(moveFlags);
474  }
MovementFlags
Definition: Object.h:67
uint32 moveFlags
Definition: Object.h:431
Position const* MovementInfo::GetPos ( ) const
inline

Definition at line 481 of file Object.h.

Referenced by Player::HandleFallDamage().

482  {
483  return &pos;
484  }
Position pos
Definition: Object.h:434
uint64 const& MovementInfo::GetTransportGuid ( ) const
inline

Definition at line 503 of file Object.h.

504  {
505  return t_guid;
506  }
uint64 t_guid
Definition: Object.h:436
Position const* MovementInfo::GetTransportPos ( ) const
inline

Definition at line 507 of file Object.h.

Referenced by Player::LoadFromDB(), Player::SaveToDB(), and Player::TeleportTo().

508  {
509  return &t_pos;
510  }
Position t_pos
Definition: Object.h:437
uint32 MovementInfo::GetTransportTime ( ) const
inline

Definition at line 511 of file Object.h.

512  {
513  return t_time;
514  }
uint32 t_time
Definition: Object.h:438
bool MovementInfo::HasMovementFlag ( MovementFlags  f) const
inline

Definition at line 467 of file Object.h.

Referenced by Movement::MoveSplineInit::MoveSplineInit(), Read(), and Write().

468  {
469  return moveFlags & f;
470  }
uint32 moveFlags
Definition: Object.h:431
void MovementInfo::Read ( ByteBuffer data)

Definition at line 292 of file Unit.cpp.

References fallTime, HasMovementFlag(), j_cosAngle, j_sinAngle, j_velocity, j_xyspeed, Position::m_positionX, Position::m_positionY, Position::m_positionZ, moveFlags, moveFlags2, MOVEMENTFLAG_FALLING, MOVEMENTFLAG_FLYING2, MOVEMENTFLAG_ONTRANSPORT, MOVEMENTFLAG_SPLINE_ELEVATION, MOVEMENTFLAG_SWIMMING, pos, ByteBuffer::read(), s_pitch, Position::SetOrientation(), t_guid, t_pos, t_time, time, and u_unk1.

Referenced by operator>>().

293 {
294  data >> moveFlags;
295  data >> moveFlags2;
296  data >> time;
297  data >> pos.m_positionX;
298  data >> pos.m_positionY;
299  data >> pos.m_positionZ;
300  pos.SetOrientation(data.read<float>());
301 
303  {
304  data >> t_guid;
305  data >> t_pos.m_positionX;
306  data >> t_pos.m_positionY;
307  data >> t_pos.m_positionZ;
308  t_pos.SetOrientation(data.read<float>());
309  data >> t_time;
310  }
312  data >> s_pitch;
313 
314  data >> fallTime;
315 
317  {
318  data >> j_velocity;
319  data >> j_sinAngle;
320  data >> j_cosAngle;
321  data >> j_xyspeed;
322  }
323 
325  data >> u_unk1;
326 }
float s_pitch
Definition: Object.h:440
float m_positionY
Definition: Position.h:51
void SetOrientation(float orientation)
Definition: Position.h:92
float j_cosAngle
Definition: Object.h:444
float m_positionX
Definition: Position.h:50
Position pos
Definition: Object.h:434
float u_unk1
Definition: Object.h:446
uint32 time
Definition: Object.h:433
MovementFlags
Definition: Object.h:67
float j_sinAngle
Definition: Object.h:444
bool HasMovementFlag(MovementFlags f) const
Definition: Object.h:467
uint8 moveFlags2
Definition: Object.h:432
uint32 moveFlags
Definition: Object.h:431
float m_positionZ
Definition: Position.h:52
uint64 t_guid
Definition: Object.h:436
uint32 t_time
Definition: Object.h:438
float j_velocity
Definition: Object.h:444
Position t_pos
Definition: Object.h:437
float j_xyspeed
Definition: Object.h:444
uint32 fallTime
Definition: Object.h:442
void MovementInfo::RemoveMovementFlag ( MovementFlags  f)
inline

Definition at line 463 of file Object.h.

Referenced by Movement::MoveSplineInit::Stop().

464  {
465  moveFlags &= ~f;
466  }
uint32 moveFlags
Definition: Object.h:431
void MovementInfo::SetMovementFlags ( MovementFlags  f)
inline

Definition at line 475 of file Object.h.

Referenced by Movement::MoveSplineInit::Launch().

476  {
477  moveFlags = f;
478  }
uint32 moveFlags
Definition: Object.h:431
void MovementInfo::SetTransportData ( uint64  guid,
float  x,
float  y,
float  z,
float  o,
uint32  time 
)
inline

Definition at line 485 of file Object.h.

References Position::m_positionX, Position::m_positionY, Position::m_positionZ, and Position::SetOrientation().

Referenced by Player::LoadFromDB().

486  {
487  t_guid = guid;
488  t_pos.m_positionX = x;
489  t_pos.m_positionY = y;
490  t_pos.m_positionZ = z;
492  t_time = time;
493  }
float m_positionY
Definition: Position.h:51
void SetOrientation(float orientation)
Definition: Position.h:92
float m_positionX
Definition: Position.h:50
uint32 time
Definition: Object.h:433
float m_positionZ
Definition: Position.h:52
uint64 t_guid
Definition: Object.h:436
uint32 t_time
Definition: Object.h:438
Position t_pos
Definition: Object.h:437
void MovementInfo::UpdateTime ( uint32  _time)
inline

Definition at line 526 of file Object.h.

527  {
528  time = _time;
529  }
uint32 time
Definition: Object.h:433
void MovementInfo::Write ( ByteBuffer data) const

Definition at line 328 of file Unit.cpp.

References fallTime, Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), HasMovementFlag(), j_cosAngle, j_sinAngle, j_velocity, j_xyspeed, moveFlags, moveFlags2, MOVEMENTFLAG_FALLING, MOVEMENTFLAG_FLYING2, MOVEMENTFLAG_ONTRANSPORT, MOVEMENTFLAG_SPLINE_ELEVATION, MOVEMENTFLAG_SWIMMING, pos, s_pitch, t_guid, t_pos, t_time, time, and u_unk1.

Referenced by operator<<(), Player::SetCanFly(), Player::SetFeatherFall(), Player::SetHover(), and Player::SetWaterWalking().

329 {
330  data << moveFlags;
331  data << moveFlags2;
332  data << time;
333  data << pos.GetPositionX();
334  data << pos.GetPositionY();
335  data << pos.GetPositionZ();
336  data << pos.GetOrientation();
337 
339  {
340  data << t_guid;
341  data << t_pos.GetPositionX();
342  data << t_pos.GetPositionY();
343  data << t_pos.GetPositionZ();
344  data << t_pos.GetOrientation();
345  data << t_time;
346  }
348  data << s_pitch;
349 
350  data << fallTime;
351 
353  {
354  data << j_velocity;
355  data << j_sinAngle;
356  data << j_cosAngle;
357  data << j_xyspeed;
358  }
359 
361  data << u_unk1;
362 }
float s_pitch
Definition: Object.h:440
float j_cosAngle
Definition: Object.h:444
Position pos
Definition: Object.h:434
float u_unk1
Definition: Object.h:446
uint32 time
Definition: Object.h:433
MovementFlags
Definition: Object.h:67
float j_sinAngle
Definition: Object.h:444
float GetOrientation() const
Definition: Position.h:100
bool HasMovementFlag(MovementFlags f) const
Definition: Object.h:467
uint8 moveFlags2
Definition: Object.h:432
float GetPositionY() const
Definition: Position.h:98
float GetPositionZ() const
Definition: Position.h:99
uint32 moveFlags
Definition: Object.h:431
uint64 t_guid
Definition: Object.h:436
uint32 t_time
Definition: Object.h:438
float j_velocity
Definition: Object.h:444
Position t_pos
Definition: Object.h:437
float GetPositionX() const
Definition: Position.h:97
float j_xyspeed
Definition: Object.h:444
uint32 fallTime
Definition: Object.h:442

Member Data Documentation

uint32 MovementInfo::fallTime

Definition at line 442 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::j_cosAngle

Definition at line 444 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::j_sinAngle

Definition at line 444 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::j_velocity

Definition at line 444 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::j_xyspeed

Definition at line 444 of file Object.h.

Referenced by Read(), and Write().

uint32 MovementInfo::moveFlags

Definition at line 431 of file Object.h.

Referenced by Read(), and Write().

uint8 MovementInfo::moveFlags2

Definition at line 432 of file Object.h.

Referenced by Read(), and Write().

Position MovementInfo::pos

Definition at line 434 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::s_pitch

Definition at line 440 of file Object.h.

Referenced by Object::_BuildMovementUpdate(), Read(), and Write().

uint64 MovementInfo::t_guid

Definition at line 436 of file Object.h.

Referenced by Read(), and Write().

Position MovementInfo::t_pos

Definition at line 437 of file Object.h.

Referenced by Read(), and Write().

uint32 MovementInfo::t_time

Definition at line 438 of file Object.h.

Referenced by Read(), and Write().

uint32 MovementInfo::time

Definition at line 433 of file Object.h.

Referenced by Read(), and Write().

float MovementInfo::u_unk1

Definition at line 446 of file Object.h.

Referenced by Read(), and Write().


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