本文整理汇总了Java中com.badlogic.gdx.physics.box2d.JointDef.JointType类的典型用法代码示例。如果您正苦于以下问题:Java JointType类的具体用法?Java JointType怎么用?Java JointType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JointType类属于com.badlogic.gdx.physics.box2d.JointDef包,在下文中一共展示了JointType类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getType
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
/** Get the type of the concrete joint. */
public JointType getType () {
org.jbox2d.dynamics.joints.JointType type2 = joint.getType();
if (type2 == org.jbox2d.dynamics.joints.JointType.DISTANCE) return JointType.DistanceJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.FRICTION) return JointType.FrictionJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.GEAR) return JointType.GearJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.MOUSE) return JointType.MouseJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.PRISMATIC) return JointType.PrismaticJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.PULLEY) return JointType.PulleyJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.REVOLUTE) return JointType.RevoluteJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.ROPE) return JointType.RopeJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.UNKNOWN) return JointType.Unknown;
if (type2 == org.jbox2d.dynamics.joints.JointType.WELD) return JointType.WeldJoint;
if (type2 == org.jbox2d.dynamics.joints.JointType.WHEEL) return JointType.WheelJoint;
return JointType.Unknown;
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:17,代码来源:Joint.java
示例2: getType
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
/**
* Get the type of the concrete joint.
*/
public JointType getType () {
int type = jniGetType(addr);
if (type > 0 && type < JointType.valueTypes.length)
return JointType.valueTypes[type];
else
return JointType.Unknown;
}
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:11,代码来源:Joint.java
示例3: drawJoint
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
private void drawJoint (Joint joint) {
Body bodyA = joint.getBodyA();
Body bodyB = joint.getBodyB();
Transform xf1 = bodyA.getTransform();
Transform xf2 = bodyB.getTransform();
Vector2 x1 = xf1.getPosition();
Vector2 x2 = xf2.getPosition();
Vector2 p1 = joint.getAnchorA();
Vector2 p2 = joint.getAnchorB();
if (joint.getType() == JointType.DistanceJoint) {
drawSegment(p1, p2, JOINT_COLOR);
} else if (joint.getType() == JointType.PulleyJoint) {
PulleyJoint pulley = (PulleyJoint)joint;
Vector2 s1 = pulley.getGroundAnchorA();
Vector2 s2 = pulley.getGroundAnchorB();
drawSegment(s1, p1, JOINT_COLOR);
drawSegment(s2, p2, JOINT_COLOR);
drawSegment(s1, s2, JOINT_COLOR);
} else if (joint.getType() == JointType.MouseJoint) {
drawSegment(joint.getAnchorA(), joint.getAnchorB(), JOINT_COLOR);
} else {
drawSegment(x1, p1, JOINT_COLOR);
drawSegment(p1, p2, JOINT_COLOR);
drawSegment(x2, p2, JOINT_COLOR);
}
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:Box2DDebugRenderer.java
示例4: getType
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
/** Get the type of the concrete joint. */
public JointType getType () {
int type = jniGetType(addr);
if (type > 0 && type < JointType.valueTypes.length)
return JointType.valueTypes[type];
else
return JointType.Unknown;
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:Joint.java
示例5: GearJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public GearJointDef()
{
this.type = JointDef.JointType.GearJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:GearJointDef.java
示例6: RopeJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public RopeJointDef()
{
this.type = JointDef.JointType.RopeJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:RopeJointDef.java
示例7: WheelJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public WheelJointDef()
{
this.type = JointDef.JointType.WheelJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:WheelJointDef.java
示例8: FrictionJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public FrictionJointDef()
{
this.type = JointDef.JointType.FrictionJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:FrictionJointDef.java
示例9: PrismaticJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public PrismaticJointDef()
{
this.type = JointDef.JointType.PrismaticJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:PrismaticJointDef.java
示例10: DistanceJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public DistanceJointDef()
{
this.type = JointDef.JointType.DistanceJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:DistanceJointDef.java
示例11: WeldJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public WeldJointDef()
{
this.type = JointDef.JointType.WeldJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:WeldJointDef.java
示例12: MouseJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public MouseJointDef()
{
this.type = JointDef.JointType.MouseJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:MouseJointDef.java
示例13: PulleyJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public PulleyJointDef()
{
this.type = JointDef.JointType.PulleyJoint;
this.collideConnected = true;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:6,代码来源:PulleyJointDef.java
示例14: RevoluteJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public RevoluteJointDef()
{
this.type = JointDef.JointType.RevoluteJoint;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:RevoluteJointDef.java
注:本文中的com.badlogic.gdx.physics.box2d.JointDef.JointType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论