MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SetPendulumVelocity

Function SetPendulumVelocity

TombEngine/Objects/Generic/Object/rope.cpp:445–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443 }
444
445 void SetPendulumVelocity(int x, int y, int z)
446 {
447 int node = 2 * (CurrentPendulum.node >> 1);
448 if (node < ROPE_SEGMENTS)
449 {
450 int val = 4096 / (ROPE_SEGMENTS - node) * 256;
451
452 x = (int64_t)val * x >> FP_SHIFT;
453 y = (int64_t)val * y >> FP_SHIFT;
454 z = (int64_t)val * z >> FP_SHIFT;
455 }
456
457 CurrentPendulum.velocity.x += x;
458 CurrentPendulum.velocity.y += y;
459 CurrentPendulum.velocity.z += z;
460 }
461
462 void SetPendulumPoint(ROPE_STRUCT* rope, int node)
463 {

Callers 1

ApplyVelocityToRopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected