MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / direction

Method direction

ogsr_engine/xrGame/detail_path_manager.cpp:57–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55bool CDetailPathManager::valid(const Fvector& position) const { return (!!_valid(position)); }
56
57Fvector CDetailPathManager::direction() const
58{
59 if ((m_path.size() < 2) || (m_path.size() <= m_current_travel_point + 1))
60 return (Fvector().set(0, 0, 1));
61
62 Fvector direction;
63 direction.sub(m_path[m_current_travel_point + 1].position, m_path[m_current_travel_point].position);
64
65 if (direction.square_magnitude() < EPS_L)
66 direction.set(0.f, 0.f, 1.f);
67 else
68 direction.normalize();
69
70 return (direction);
71}
72
73bool CDetailPathManager::try_get_direction(Fvector& direction) const
74{

Callers 15

dirMethod · 0.80
DestroyMethod · 0.80
NotificatePartMethod · 0.80
UpdateCLMethod · 0.80
DieMethod · 0.80
SetTurnAnimationMethod · 0.80
SelectVelocitiesMethod · 0.80
activateMethod · 0.80
update_scheduleMethod · 0.80
activateMethod · 0.80

Calls 5

sizeMethod · 0.45
setMethod · 0.45
subMethod · 0.45
square_magnitudeMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected