当前位置: 首页>>代码示例>>Java>>正文


Java GearJointDef类代码示例

本文整理汇总了Java中com.badlogic.gdx.physics.box2d.joints.GearJointDef的典型用法代码示例。如果您正苦于以下问题:Java GearJointDef类的具体用法?Java GearJointDef怎么用?Java GearJointDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GearJointDef类属于com.badlogic.gdx.physics.box2d.joints包,在下文中一共展示了GearJointDef类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JointSerializer

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
public JointSerializer(RubeScene scene,Json _json)
{
	this.scene = scene;
	_json.setSerializer(RevoluteJointDef.class, 	new RevoluteJointDefSerializer());
	_json.setSerializer(PrismaticJointDef.class, 	new PrismaticJointDefSerializer());
	_json.setSerializer(PulleyJointDef.class, 		new PulleyJointDefSerializer());
	_json.setSerializer(WeldJointDef.class, 		new WeldJointDefSerializer());
	_json.setSerializer(FrictionJointDef.class, 	new FrictionJointDefSerializer());
	_json.setSerializer(WheelJointDef.class, 		new WheelJointDefSerializer());
	_json.setSerializer(RopeJointDef.class, 		new RopeJointDefSerializer());
	_json.setSerializer(DistanceJointDef.class, 	new DistanceJointDefSerializer());
	_json.setSerializer(GearJointDef.class, 		new GearJointDefSerializer());
	
	mouseJointDefSerializer = new MouseJointDefSerializer();
	
	_json.setSerializer(MouseJointDef.class, 		mouseJointDefSerializer);
}
 
开发者ID:tescott,项目名称:RubeLoader,代码行数:18,代码来源:JointSerializer.java

示例2: setJoint1

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
/**
 * Set the first joint. It must be either a revolute or prismatic joint.
 * @param joint1	The joint that will be connected to this joint.
 * @return	This joint. Handy for chaining stuff together.
 */
public B2FlxGearJoint setJoint1(Joint joint1)
{
	if(!FlxU.getClassName(joint1, false).equals("com.badlogic.gdx.physics.box2d.joints.RevoluteJoint") 
	&& !FlxU.getClassName(joint1, false).equals("com.badlogic.gdx.physics.box2d.joints.PrismaticJoint"))
		throw new Error("The joint must be either a revolute or prismatic joint!");
	((GearJointDef)jointDef).joint1 = joint1;
	return this;
}
 
开发者ID:flixel-gdx,项目名称:flixel-gdx-box2d,代码行数:14,代码来源:B2FlxGearJoint.java

示例3: setJoint2

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
/**
 * Set the second joint. It must be either a revolute or prismatic joint.
 * @param joint2	The joint that will be connected to this joint.
 * @return	This joint. Handy for chaining stuff together.
 */
public B2FlxGearJoint setJoint2(Joint joint2)
{
	if(!FlxU.getClassName(joint2, false).equals("com.badlogic.gdx.physics.box2d.joints.RevoluteJoint") 
	&& !FlxU.getClassName(joint2, false).equals("com.badlogic.gdx.physics.box2d.joints.PrismaticJoint"))
		throw new Error("The joint must be either a revolute or prismatic joint!");
	((GearJointDef)jointDef).joint2 = joint2;
	return this;
}
 
开发者ID:flixel-gdx,项目名称:flixel-gdx-box2d,代码行数:14,代码来源:B2FlxGearJoint.java

示例4: reset

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
@Override
public void reset() {
    jointDef = new GearJointDef();

}
 
开发者ID:Rubentxu,项目名称:GDX-Logic-Bricks,代码行数:6,代码来源:GearJointBuilder.java

示例5: setRatio

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
/**
 * Set the ratio.
 * @param ratio
 * @return	This joint. Handy for chaining stuff together.
 */
public B2FlxGearJoint setRatio(float ratio)
{
	((GearJointDef)jointDef).ratio = ratio;
	return this;
}
 
开发者ID:flixel-gdx,项目名称:flixel-gdx-box2d,代码行数:11,代码来源:B2FlxGearJoint.java

示例6: createProperJoint

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
private long createProperJoint(JointDef paramJointDef)
{
  if (paramJointDef.type == JointDef.JointType.DistanceJoint)
  {
    DistanceJointDef localDistanceJointDef = (DistanceJointDef)paramJointDef;
    return jniCreateDistanceJoint(this.addr, localDistanceJointDef.bodyA.addr, localDistanceJointDef.bodyB.addr, localDistanceJointDef.collideConnected, localDistanceJointDef.localAnchorA.x, localDistanceJointDef.localAnchorA.y, localDistanceJointDef.localAnchorB.x, localDistanceJointDef.localAnchorB.y, localDistanceJointDef.length, localDistanceJointDef.frequencyHz, localDistanceJointDef.dampingRatio);
  }
  if (paramJointDef.type == JointDef.JointType.FrictionJoint)
  {
    FrictionJointDef localFrictionJointDef = (FrictionJointDef)paramJointDef;
    return jniCreateFrictionJoint(this.addr, localFrictionJointDef.bodyA.addr, localFrictionJointDef.bodyB.addr, localFrictionJointDef.collideConnected, localFrictionJointDef.localAnchorA.x, localFrictionJointDef.localAnchorA.y, localFrictionJointDef.localAnchorB.x, localFrictionJointDef.localAnchorB.y, localFrictionJointDef.maxForce, localFrictionJointDef.maxTorque);
  }
  if (paramJointDef.type == JointDef.JointType.GearJoint)
  {
    GearJointDef localGearJointDef = (GearJointDef)paramJointDef;
    return jniCreateGearJoint(this.addr, localGearJointDef.bodyA.addr, localGearJointDef.bodyB.addr, localGearJointDef.collideConnected, localGearJointDef.joint1.addr, localGearJointDef.joint2.addr, localGearJointDef.ratio);
  }
  if (paramJointDef.type == JointDef.JointType.MouseJoint)
  {
    MouseJointDef localMouseJointDef = (MouseJointDef)paramJointDef;
    return jniCreateMouseJoint(this.addr, localMouseJointDef.bodyA.addr, localMouseJointDef.bodyB.addr, localMouseJointDef.collideConnected, localMouseJointDef.target.x, localMouseJointDef.target.y, localMouseJointDef.maxForce, localMouseJointDef.frequencyHz, localMouseJointDef.dampingRatio);
  }
  if (paramJointDef.type == JointDef.JointType.PrismaticJoint)
  {
    PrismaticJointDef localPrismaticJointDef = (PrismaticJointDef)paramJointDef;
    return jniCreatePrismaticJoint(this.addr, localPrismaticJointDef.bodyA.addr, localPrismaticJointDef.bodyB.addr, localPrismaticJointDef.collideConnected, localPrismaticJointDef.localAnchorA.x, localPrismaticJointDef.localAnchorA.y, localPrismaticJointDef.localAnchorB.x, localPrismaticJointDef.localAnchorB.y, localPrismaticJointDef.localAxisA.x, localPrismaticJointDef.localAxisA.y, localPrismaticJointDef.referenceAngle, localPrismaticJointDef.enableLimit, localPrismaticJointDef.lowerTranslation, localPrismaticJointDef.upperTranslation, localPrismaticJointDef.enableMotor, localPrismaticJointDef.maxMotorForce, localPrismaticJointDef.motorSpeed);
  }
  if (paramJointDef.type == JointDef.JointType.PulleyJoint)
  {
    PulleyJointDef localPulleyJointDef = (PulleyJointDef)paramJointDef;
    return jniCreatePulleyJoint(this.addr, localPulleyJointDef.bodyA.addr, localPulleyJointDef.bodyB.addr, localPulleyJointDef.collideConnected, localPulleyJointDef.groundAnchorA.x, localPulleyJointDef.groundAnchorA.y, localPulleyJointDef.groundAnchorB.x, localPulleyJointDef.groundAnchorB.y, localPulleyJointDef.localAnchorA.x, localPulleyJointDef.localAnchorA.y, localPulleyJointDef.localAnchorB.x, localPulleyJointDef.localAnchorB.y, localPulleyJointDef.lengthA, localPulleyJointDef.lengthB, localPulleyJointDef.ratio);
  }
  if (paramJointDef.type == JointDef.JointType.RevoluteJoint)
  {
    RevoluteJointDef localRevoluteJointDef = (RevoluteJointDef)paramJointDef;
    return jniCreateRevoluteJoint(this.addr, localRevoluteJointDef.bodyA.addr, localRevoluteJointDef.bodyB.addr, localRevoluteJointDef.collideConnected, localRevoluteJointDef.localAnchorA.x, localRevoluteJointDef.localAnchorA.y, localRevoluteJointDef.localAnchorB.x, localRevoluteJointDef.localAnchorB.y, localRevoluteJointDef.referenceAngle, localRevoluteJointDef.enableLimit, localRevoluteJointDef.lowerAngle, localRevoluteJointDef.upperAngle, localRevoluteJointDef.enableMotor, localRevoluteJointDef.motorSpeed, localRevoluteJointDef.maxMotorTorque);
  }
  if (paramJointDef.type == JointDef.JointType.WeldJoint)
  {
    WeldJointDef localWeldJointDef = (WeldJointDef)paramJointDef;
    return jniCreateWeldJoint(this.addr, localWeldJointDef.bodyA.addr, localWeldJointDef.bodyB.addr, localWeldJointDef.collideConnected, localWeldJointDef.localAnchorA.x, localWeldJointDef.localAnchorA.y, localWeldJointDef.localAnchorB.x, localWeldJointDef.localAnchorB.y, localWeldJointDef.referenceAngle);
  }
  if (paramJointDef.type == JointDef.JointType.RopeJoint)
  {
    RopeJointDef localRopeJointDef = (RopeJointDef)paramJointDef;
    return jniCreateRopeJoint(this.addr, localRopeJointDef.bodyA.addr, localRopeJointDef.bodyB.addr, localRopeJointDef.collideConnected, localRopeJointDef.localAnchorA.x, localRopeJointDef.localAnchorA.y, localRopeJointDef.localAnchorB.x, localRopeJointDef.localAnchorB.y, localRopeJointDef.maxLength);
  }
  if (paramJointDef.type == JointDef.JointType.WheelJoint)
  {
    WheelJointDef localWheelJointDef = (WheelJointDef)paramJointDef;
    return jniCreateWheelJoint(this.addr, localWheelJointDef.bodyA.addr, localWheelJointDef.bodyB.addr, localWheelJointDef.collideConnected, localWheelJointDef.localAnchorA.x, localWheelJointDef.localAnchorA.y, localWheelJointDef.localAnchorB.x, localWheelJointDef.localAnchorB.y, localWheelJointDef.localAxisA.x, localWheelJointDef.localAxisA.y, localWheelJointDef.enableMotor, localWheelJointDef.maxMotorTorque, localWheelJointDef.motorSpeed, localWheelJointDef.frequencyHz, localWheelJointDef.dampingRatio);
  }
  return 0L;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:55,代码来源:World.java

示例7: B2FlxGearJoint

import com.badlogic.gdx.physics.box2d.joints.GearJointDef; //导入依赖的package包/类
/**
 * Creates a gear joint.
 * @param spriteA	The first body.
 * @param spriteB	The second body.
 * @param jointDef	The joint definition.
 */
public B2FlxGearJoint(B2FlxShape spriteA, B2FlxShape spriteB, GearJointDef jointDef)
{
	super(spriteA, spriteB, jointDef);
	
}
 
开发者ID:flixel-gdx,项目名称:flixel-gdx-box2d,代码行数:12,代码来源:B2FlxGearJoint.java


注:本文中的com.badlogic.gdx.physics.box2d.joints.GearJointDef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。