double yvel = yvelocity; // this creates a variable that remembers the value of yvelocity at this point
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000,1.000000, 0.0, 0.0);
// this call to PhysicalResponse will set yvelocity and xvelocity to 0
// note though that yvel is not set equal to 0, as it still holds the value it had at the first line
yvelocity = yvel; // this now sets yvelocity back to what it was before the collision
Users browsing this forum: No registered users and 1 guest