Java 类com.badlogic.gdx.physics.box2d.JointDef.JointType 实例源码

项目:libgdxcn    文件:Joint.java   
/** 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;
}
项目:tilt-game-android    文件:Joint.java   
/**
 * 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;
}
项目:libgdxcn    文件:Box2DDebugRenderer.java   
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);
    }
}
项目:libgdxcn    文件:Box2DDebugRenderer.java   
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);
    }
}
项目:libgdxcn    文件:Joint.java   
/** 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;
}
项目:NationSoccer    文件:Joint.java   
/**
 * 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;
}
项目:ingress-indonesia-dev    文件:GearJointDef.java   
public GearJointDef()
{
  this.type = JointDef.JointType.GearJoint;
}
项目:ingress-indonesia-dev    文件:RopeJointDef.java   
public RopeJointDef()
{
  this.type = JointDef.JointType.RopeJoint;
}
项目:ingress-indonesia-dev    文件:WheelJointDef.java   
public WheelJointDef()
{
  this.type = JointDef.JointType.WheelJoint;
}
项目:ingress-indonesia-dev    文件:FrictionJointDef.java   
public FrictionJointDef()
{
  this.type = JointDef.JointType.FrictionJoint;
}
项目:ingress-indonesia-dev    文件:PrismaticJointDef.java   
public PrismaticJointDef()
{
  this.type = JointDef.JointType.PrismaticJoint;
}
项目:ingress-indonesia-dev    文件:DistanceJointDef.java   
public DistanceJointDef()
{
  this.type = JointDef.JointType.DistanceJoint;
}
项目:ingress-indonesia-dev    文件:WeldJointDef.java   
public WeldJointDef()
{
  this.type = JointDef.JointType.WeldJoint;
}
项目:ingress-indonesia-dev    文件:MouseJointDef.java   
public MouseJointDef()
{
  this.type = JointDef.JointType.MouseJoint;
}
项目:ingress-indonesia-dev    文件:PulleyJointDef.java   
public PulleyJointDef()
{
  this.type = JointDef.JointType.PulleyJoint;
  this.collideConnected = true;
}
项目:ingress-indonesia-dev    文件:RevoluteJointDef.java   
public RevoluteJointDef()
{
  this.type = JointDef.JointType.RevoluteJoint;
}