int main() { int iteration = 0; double t = 0; float dxa, dxb, dya, dyb; CVector col_pts; Act_A.Center.xv = 0; Act_A.Center.yv = 0; Act_A.ActorCurrentXYSpeed.xv = 1; Act_A.ActorCurrentXYSpeed.yv = 0; Act_A.ActorMass = 1; Act_A.ActorCollisionRestitutionCoefficient = 0.8; Act_B.Center.xv = 2; Act_B.Center.yv = 0; Act_B.ActorCurrentXYSpeed.xv = 0; Act_B.ActorCurrentXYSpeed.yv = 0; Act_B.ActorMass = 1; Act_B.ActorCollisionRestitutionCoefficient = 0.8; while (1) { //Rotation(sPlayerOBB[0], sPlayerOBB[1], (0 * 3.14 / 180)); //Translation(0.05, 0.01*cos(t*3.14)); //for (iteration = 0; iteration < 10;iteration++){ // std::cout << sPlayerOBB[iteration] << "/"; //} dxa = Act_A.ActorCurrentXYSpeed.xv *0.016; dya = Act_A.ActorCurrentXYSpeed.yv *0.016; dxb = Act_B.ActorCurrentXYSpeed.xv *0.016; dyb = Act_B.ActorCurrentXYSpeed.yv *0.016; Act_A.Translate(dxa, dya); Act_B.Translate(dxb, dyb); std::cout << "XA : "<< Act_A.Center.xv ; std::cout << " // YA : " << Act_A.Center.yv << std::endl; std::cout << "XB : " << Act_B.Center.xv; std::cout << " // YB : " << Act_B.Center.yv << std::endl; if ((Act_B.Center.xv - Act_A.Center.xv <0.01)&& (Act_A.Center.yv - Act_B.Center.yv < 0.01)) { std::cout << "Collision" << std::endl; col_pts.xv = Act_A.Center.xv; col_pts.yv = Act_B.Center.yv; Act_A.DynamicDynamicCollisionResponce(Act_B, col_pts); } Sleep(DWORD(500)); //t += 0.01; } return 0; }