Closed LeeMcQueen closed 3 years ago
void onlyBallCollisionResPonse(Ball *ball){
for(int i = 0; i < nodes.size(); i++){ Vec3 distVec = getWorldPos(nodes[i]) - ball -> center; double disLen = distVec.length(); double safeDist = ball -> radius * 1.05; if(distLen < safeDist){ distVec.normalize(); setWorldPos(nodes[i], distVec * safeDist + ball -> center); nodes[i] -> velocity = node[i] -> velocity * ball -> friction; } }
}
void onlyBallCollisionResPonse(Ball *ball){
}