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

Method UpdatePatrolPath

ogsr_engine/xrGame/HelicopterMovementManager.cpp:101–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99float SHeliMovementState::GetDistanceToDestPosition() { return desiredPoint.distance_to(currP); }
100
101void SHeliMovementState::UpdatePatrolPath()
102{
103 if (AlreadyOnPoint())
104 {
105 float dist = GetDistanceToDestPosition();
106 parent->callback(GameObject::eHelicopterOnPoint)(dist, currP, currPatrolVertex ? currPatrolVertex->vertex_id() : -1);
107 CPatrolPath::const_iterator b, e;
108 currPatrolPath->begin(currPatrolVertex, b, e);
109 if (b != e)
110 {
111 if (need_to_del_path && currPatrolVertex->data().flags()) // fake flags that signals entrypoint for round path
112 SetPointFlags(currPatrolVertex->vertex_id(), 0);
113
114 currPatrolVertex = currPatrolPath->vertex((*b).vertex_id());
115
116 Fvector p = currPatrolVertex->data().position();
117 desiredPoint = p;
118 }
119 else
120 {
121 type = eMovNone;
122 // curLinearSpeed = 0.0f;
123 // curLinearAcc = 0.0f;
124 }
125 }
126}
127
128void SHeliMovementState::UpdateMovToPoint()
129{

Callers

nothing calls this directly

Calls 7

flagsMethod · 0.80
callbackMethod · 0.45
vertex_idMethod · 0.45
beginMethod · 0.45
dataMethod · 0.45
vertexMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected