コード例 #1
0
ファイル: World.cpp プロジェクト: lqefn/LuaBox2D
	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;
		}
	}
コード例 #2
0
ファイル: World.cpp プロジェクト: lqefn/LuaBox2D
	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;
		}
	}