Codota Logo
MouseJointDef.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.jbox2d.dynamics.joints.MouseJointDef
constructor

Best Java code snippets using org.jbox2d.dynamics.joints.MouseJointDef.<init> (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: libgdx/libgdx

  @Override
  public org.jbox2d.dynamics.joints.JointDef toJBox2d () {
    org.jbox2d.dynamics.joints.MouseJointDef jd = new org.jbox2d.dynamics.joints.MouseJointDef();
    jd.bodyA = bodyA.body;
    jd.bodyB = bodyB.body;
    jd.collideConnected = collideConnected;
    jd.dampingRatio = dampingRatio;
    jd.frequencyHz = frequencyHz;
    jd.maxForce = maxForce;
    jd.target.set(target.x, target.y);
    jd.type = org.jbox2d.dynamics.joints.JointType.MOUSE;
    return jd;
  }
}
origin: stackoverflow.com

 MouseJoint wheelJoint;
MouseJointDef mouseJointDef = new MouseJointDef();
mouseJointDef.bodyA = <something>;
mouseJointDef.bodyB = wheelBody;
mouseJointDef.target.set(0 + chosenWheelPositionOffsetX, 0 + chosenWheelPositionOffsetY);
mouseJointDef.target.addLocal(wheelCenterX, wheelCenterY);
mouseJointDef.dampingRatio = <chosen_value>;
mouseJointDef.frequencyHz = <chosen_value>;
mouseJointDef.maxForce = <chosen_value>;
wheelJoint = (MouseJoint) mWorld.createJoint(mouseJointDef);
origin: jbox2d/jbox2d

private void spawnMouseJoint(Vec2 p) {
 if (mouseJoint != null) {
  return;
 }
 queryAABB.lowerBound.set(p.x - .001f, p.y - .001f);
 queryAABB.upperBound.set(p.x + .001f, p.y + .001f);
 callback.point.set(p);
 callback.fixture = null;
 m_world.queryAABB(callback, queryAABB);
 if (callback.fixture != null) {
  Body body = callback.fixture.getBody();
  MouseJointDef def = new MouseJointDef();
  def.bodyA = groundBody;
  def.bodyB = body;
  def.collideConnected = true;
  def.target.set(p);
  def.maxForce = 1000f * body.getMass();
  mouseJoint = (MouseJoint) m_world.createJoint(def);
  body.setAwake(true);
 }
}
origin: stackoverflow.com

MouseJointDef def = new MouseJointDef();
def.bodyA = groundBody;
def.bodyB = hitBody[pointer];
origin: stackoverflow.com

 public MouseJoint createMouseJoint(AnimatedSprite box , float x, float y)
{
  final Body boxBody =
  this.mPhysicsWorld.getPhysicsConnectorManager().findBodyByShape(box);

  Vector2 v = boxBody.getWorldPoint(
          new Vector2(x/pixelToMeteRatio, y/pixelToMeteRatio)
          );

  MouseJointDef mjd = new MouseJointDef();
  mjd.bodyA               = groundBody;
  mjd.bodyB               = boxBody;
  mjd.dampingRatio        = 0.2f;
  mjd.frequencyHz         = 30;
  mjd.maxForce            = (float) (200.0f * boxBody.getMass());
  mjd.collideConnected    = true;
  mjd.target.set(v);
  return (MouseJoint) this.mPhysicsWorld.createJoint(mjd);
}
origin: jbox2d/jbox2d

MouseJointDef def = new MouseJointDef();
jd = def;
def.dampingRatio = joint.getDampingRatio();
origin: org.jbox2d/jbox2d-testbed

/**
 * Called for mouse-down
 * 
 * @param p
 */
public void mouseDown(Vec2 p) {
 mouseWorld.set(p);
 if (mouseJoint != null) {
  return;
 }
 queryAABB.lowerBound.set(p.x - .001f, p.y - .001f);
 queryAABB.upperBound.set(p.x + .001f, p.y + .001f);
 callback.point.set(p);
 callback.fixture = null;
 m_world.queryAABB(callback, queryAABB);
 if (callback.fixture != null) {
  Body body = callback.fixture.getBody();
  MouseJointDef def = new MouseJointDef();
  def.bodyA = groundBody;
  def.bodyB = body;
  def.target.set(p);
  def.maxForce = 1000f * body.getMass();
  mouseJoint = (MouseJoint) m_world.createJoint(def);
  body.setAwake(true);
 }
}
origin: stackoverflow.com

MouseJointDef def = new MouseJointDef();
def.bodyA = groundBody;
def.bodyB = hitBody[pointer];
org.jbox2d.dynamics.jointsMouseJointDef<init>

Popular methods of MouseJointDef

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • getExternalFilesDir (Context)
    • scheduleAtFixedRate (ScheduledExecutorService)
      Creates and executes a periodic action that becomes enabled first after the given initial delay, and
    • DecimalFormat (java.text)
      DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
    • AtomicInteger (java.util.concurrent.atomic)
      An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
    • Notification (javax.management)
    • JButton (javax.swing)
    • Logger (org.slf4j)
      The main user interface to logging. It is expected that logging takes place through concrete impleme
    • SAXParseException (org.xml.sax)
      Encapsulate an XML parse error or warning.This exception may include information for locating the er
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now