Delta V motion not applied properly
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
New Real Time Battle | Status tracked in Alpha | |||||
Alpha |
Fix Released
|
Critical
|
Rick Stovall |
Bug Description
In cpp/sim_
velocity = oldV + (accel*Time);
applyV = oldV + ((accel*Time)/2);
location += applyV * time
rotation should be handled in similar manner. Following is the method where the fault lies:
bool base_object:
{
// move acording to forces
float tmass = mass + mass_mod;
triplet a = force / tmass;
triplet ra = torque / (tmass * 0.5); // not accurate!!
velocity += (a + accel_mod) * quanta;
rotation += (ra + torque_mod) * quanta;
location += velocity * quanta;
attitude += rotation * quanta;
// apply post-effectors
bool killme (false);
for (auto e : post_attribs)
if (e.second-
killme = true;
return killme;
};
Related branches
- Rick Stovall: Approve (code)
-
Diff: 121 lines (+57/-9)3 files modifiedcpp/sim_engine/base_object/base_object.cpp (+7/-6)
cpp/sim_engine/base_object/base_object.h (+4/-1)
cpp/sim_engine/base_object/base_object_test.cpp (+46/-2)
- Rick Stovall: Approve (code)
-
Diff: 134 lines (+66/-13)3 files modifiedcpp/sim_engine/base_object/base_object.cpp (+14/-8)
cpp/sim_engine/base_object/base_object.h (+4/-1)
cpp/sim_engine/base_object/base_object_test.cpp (+48/-4)
Changed in nrtb: | |
importance: | Undecided → Critical |
assignee: | nobody → Rick Stovall (fpstovall) |
milestone: | none → sprint-005a |