Delta V motion not applied properly

Bug #1276332 reported by Rick Stovall
6
This bug affects 1 person
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_engine/base_object/base_object.cpp we are not applying motion properly, only half the deltaV should applied to motion, rather than the entire deltaV. In other words:

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::apply(int time, float quanta)
{
  // 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->tick(*this, time))
      killme = true;
  return killme;
};

Related branches

Rick Stovall (fpstovall)
Changed in nrtb:
importance: Undecided → Critical
assignee: nobody → Rick Stovall (fpstovall)
milestone: none → sprint-005a
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.