/** 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; }
/** * 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; }
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); } }
/** 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; }
public GearJointDef() { this.type = JointDef.JointType.GearJoint; }
public RopeJointDef() { this.type = JointDef.JointType.RopeJoint; }
public WheelJointDef() { this.type = JointDef.JointType.WheelJoint; }
public FrictionJointDef() { this.type = JointDef.JointType.FrictionJoint; }
public PrismaticJointDef() { this.type = JointDef.JointType.PrismaticJoint; }
public DistanceJointDef() { this.type = JointDef.JointType.DistanceJoint; }
public WeldJointDef() { this.type = JointDef.JointType.WeldJoint; }
public MouseJointDef() { this.type = JointDef.JointType.MouseJoint; }
public PulleyJointDef() { this.type = JointDef.JointType.PulleyJoint; this.collideConnected = true; }
public RevoluteJointDef() { this.type = JointDef.JointType.RevoluteJoint; }