static int cpDampedSpring_new (lua_State *L) { cpBody *b1 = check_cpBody(L, 1); cpBody *b2 = check_cpBody(L, 2); cpVect a1 = check_cpVect(L, 3); cpVect a2 = check_cpVect(L, 5); cpFloat restLength = luaL_checknumber(L, 7); cpFloat stiffness = luaL_checknumber(L, 8); cpFloat damping = luaL_checknumber(L, 9); cpDampedSpring *ds = push_cpDampedSpring(L); cpDampedSpringInit(ds, b1, b2, a1, a2, restLength, stiffness, damping); cpConstraint_store_refs(L); return 1; }
cpConstraint * cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping) { return (cpConstraint *)cpDampedSpringInit(cpDampedSpringAlloc(), a, b, anchr1, anchr2, restLength, stiffness, damping); }
void wrDampedSpringInit(cpFloat restLength, cpFloat stiffness, cpFloat damping, cpVect *anchr1, cpVect *anchr2, cpDampedSpring *joint, cpBody *a, cpBody *b) { cpDampedSpringInit(joint, a, b, *anchr1, *anchr2, restLength, stiffness, damping); }