MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoForceForWall

Function DoForceForWall

Descent3/D3ForceFeedback.cpp:453–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453void DoForceForWall(object *playerobj, float hitspeed, int hitseg, int hitwall, vector *wall_normal) {
454 vector local_norm;
455 float scale = 1.00f;
456
457 if (hitspeed < 20)
458 return;
459
460 scale = hitspeed / 80.0f;
461 if (scale < 0.0f)
462 scale = 0.0f;
463 if (scale > 1.0f)
464 scale = 1.0f;
465
466 vm_MatrixMulVector(&local_norm, wall_normal, &playerobj->orient);
467 local_norm *= -1.0f;
468
469 ForceEffectsPlay(FORCE_WALLHIT, &scale, &local_norm);
470}
471
472void DoForceForRecoil(object *playerobj, object *weap) {
473 weapon *w_ptr = &Weapons[weap->id];

Callers 1

collide_player_and_wallFunction · 0.85

Calls 2

ForceEffectsPlayFunction · 0.85
vm_MatrixMulVectorFunction · 0.50

Tested by

no test coverage detected