Exemple #1
0
	int World::getJoint(State & state, b2World * object){
		Joint * interfaceJoint = state.getInterface<Joint>("LuaBox2D_Joint");
		b2Joint * joint = object->GetJointList();
		if (joint){
			interfaceJoint->push(joint, false);
			return 1;
		}else{
			return 0;
		}
	}
Exemple #2
0
	int World::createJoint(State & state, b2World * object){
		JointDef * interfaceJointDef = state.getInterface<JointDef>("LuaBox2D_JointDef");
		b2JointDef * jointDef = interfaceJointDef->get(1);
		if (jointDef != nullptr){
			Joint * interfaceJoint = state.getInterface<Joint>("LuaBox2D_Joint");
			b2Joint * joint = object->CreateJoint(jointDef);
			interfaceJoint->push(joint, true);
			return 1;
		}else{
			return 0;
		}
	}