void addDamping() { XMVECTOR dampPoint1 = XMVectorScale(point1->curr_v, -g_fDamping); XMVECTOR dampPoint2 = XMVectorScale(point2->curr_v, -g_fDamping); point1->addIntF(dampPoint1); point2->addIntF(dampPoint2); }
// same with vtmp void addDampingTMP() { XMVECTOR dampPoint1 = XMVectorScale(point1->vtmp, -g_fDamping); XMVECTOR dampPoint2 = XMVectorScale(point2->vtmp, -g_fDamping); point1->addIntF(dampPoint1); point2->addIntF(dampPoint2); }
// same only with xtmp void computeSpringForcesTMP() { float curr_length = getDistance(&point1->xtmp, &point2->xtmp); float springForce = (-1 * stiffness) * (curr_length - org_length); forces = XMVectorSubtract(point1->xtmp, point2->xtmp); forces = XMVectorScale(forces, 1.f / curr_length); forces = XMVectorScale(forces, springForce); point1->addIntF(forces); point2->addIntF(XMVectorScale(forces, -1.f)); }