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

Method GetJumpDir

ogsr_engine/xrGame/ElevatorState.cpp:347–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void CElevatorState::GetJumpDir(const Fvector& accel, Fvector& dir)
348{
349 VERIFY(m_ladder && m_character);
350 Fvector norm, side;
351 m_ladder->DDNorm(norm);
352 m_ladder->DDSide(side);
353 Fvector ac;
354 ac.set(accel).normalize_safe();
355 float side_component = ac.dotproduct(side);
356 dir.set(norm);
357 if (_abs(side_component) > M_SQRT1_2)
358 {
359 if (side_component < 0.f)
360 side.invert();
361 dir.add(side);
362 dir.normalize_safe();
363 }
364}
365
366void CElevatorState::Deactivate()
367{

Callers 1

JumpMethod · 0.80

Calls 8

DDNormMethod · 0.80
DDSideMethod · 0.80
_absFunction · 0.50
normalize_safeMethod · 0.45
setMethod · 0.45
dotproductMethod · 0.45
invertMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected