MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setSpeed

Method setSpeed

src/Savegame/MovingTarget.cpp:134–141  ·  view source on GitHub ↗

* Changes the speed of the moving target * and converts it from standard knots (nautical miles per hour) * into radians per 5 in-game seconds. * @param speed Speed in knots. */

Source from the content-addressed store, hash-verified

132 * @param speed Speed in knots.
133 */
134void MovingTarget::setSpeed(int speed)
135{
136 _speed = speed;
137 // Each nautical mile is 1/60th of a degree.
138 // Each hour contains 720 5-seconds.
139 _speedRadian = _speed * (1 / 60.0) * (M_PI / 180) / 720.0;
140 calculateSpeed();
141}
142
143/**
144 * Calculates the speed vector based on the

Callers 7

fireMethod · 0.45
spawnUfoMethod · 0.45
ufoReachedWaypointMethod · 0.45
ufoLiftingMethod · 0.45
btnOkClickMethod · 0.45
moveMethod · 0.45
ufoBreakOffMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected