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

Function ApplyConstantForce

Descent3/AImain.cpp:2768–2776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2766}
2767
2768static inline void ApplyConstantForce(object *objp, vector *new_pos, vector *force, float delta_time) {
2769 const vector velocity = objp->mtype.phys_info.velocity;
2770 const float drag = objp->mtype.phys_info.drag;
2771 const float mass = objp->mtype.phys_info.mass;
2772
2773 // Standard motion with a linear air drag (drag is proportional to velocity)
2774 *new_pos = objp->pos + (*force / drag) * (delta_time) +
2775 (mass / drag) * (velocity - (*force / drag)) * (1 - exp(-(drag / mass) * delta_time));
2776}
2777
2778bool AIDetermineAimPoint(object *robot, object *target, vector *aim_pt, float weapon_speed) {
2779 if (DIFF_LEVEL == DIFFICULTY_TRAINEE && ((robot->ai_info->flags & AIF_TEAM_MASK) != AIF_TEAM_REBEL)) {

Callers 1

AIDetermineAimPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected