本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例5: GearJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public GearJointDef()
{
this.type = JointDef.JointType.GearJoint;
}
示例6: RopeJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public RopeJointDef()
{
this.type = JointDef.JointType.RopeJoint;
}
示例7: WheelJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public WheelJointDef()
{
this.type = JointDef.JointType.WheelJoint;
}
示例8: FrictionJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public FrictionJointDef()
{
this.type = JointDef.JointType.FrictionJoint;
}
示例9: PrismaticJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public PrismaticJointDef()
{
this.type = JointDef.JointType.PrismaticJoint;
}
示例10: DistanceJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public DistanceJointDef()
{
this.type = JointDef.JointType.DistanceJoint;
}
示例11: WeldJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public WeldJointDef()
{
this.type = JointDef.JointType.WeldJoint;
}
示例12: MouseJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public MouseJointDef()
{
this.type = JointDef.JointType.MouseJoint;
}
示例13: PulleyJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public PulleyJointDef()
{
this.type = JointDef.JointType.PulleyJoint;
this.collideConnected = true;
}
示例14: RevoluteJointDef
import com.badlogic.gdx.physics.box2d.JointDef.JointType; //导入依赖的package包/类
public RevoluteJointDef()
{
this.type = JointDef.JointType.RevoluteJoint;
}