Example #1
0
/* Simple test of cpGearJointSetRatio().
*/
void test_cpGearJointSetRatio(void)
{
	cpConstraint *gear1 = cpGearJointNew(body1, body2, 4, 7);

	cpGearJointSetRatio(gear1, 63.25);
	cpGearJoint *gearCast = (cpGearJoint*)gear1;
	CU_ASSERT(gearCast->ratio == 63.25);

	cpGearJointSetRatio(gear1, -7.14);
	gearCast = (cpGearJoint*)gear1;
	CU_ASSERT(gearCast->ratio == -7.14);

	cpGearJointSetRatio(gear1, 92);
	gearCast = (cpGearJoint*)gear1;
	CU_ASSERT(gearCast->ratio == 92);
}
void PhysicsJointGear::setRatio(float ratio)
{
    cpGearJointSetRatio(_cpConstraints.front(), PhysicsHelper::float2cpfloat(ratio));
}
Example #3
0
void
Flatland::GearJoint::ratio( double value )
{
  cpGearJointSetRatio( _constraint, value );
}