Tabnine Logo
DebugDraw.getViewportTranform
Code IndexAdd Tabnine to your IDE (free)

How to use
getViewportTranform
method
in
org.jbox2d.callbacks.DebugDraw

Best Java code snippets using org.jbox2d.callbacks.DebugDraw.getViewportTranform (Showing top 13 results out of 315)

origin: libgdx/libgdx

 public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
  node.aabb.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);

  if (node.child1 != null) {
   drawTree(argDraw, node.child1, spot + 1, height);
  }
  if (node.child2 != null) {
   drawTree(argDraw, node.child2, spot + 1, height);
  }
 }
}
origin: libgdx/libgdx

 public void drawTree(DebugDraw argDraw, int node, int spot, int height) {
  AABB a = m_aabb[node];
  a.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(a.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node + "-" + (spot + 1) + "/" + height, color);

  int c1 = m_child1[node];
  int c2 = m_child2[node];
  if (c1 != NULL_NODE) {
   drawTree(argDraw, c1, spot + 1, height);
  }
  if (c2 != NULL_NODE) {
   drawTree(argDraw, c2, spot + 1, height);
  }
 }
}
origin: jbox2d/jbox2d

 public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
  node.aabb.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);

  if (node.child1 != null) {
   drawTree(argDraw, node.child1, spot + 1, height);
  }
  if (node.child2 != null) {
   drawTree(argDraw, node.child2, spot + 1, height);
  }
 }
}
origin: jbox2d/jbox2d

 public void drawTree(DebugDraw argDraw, int node, int spot, int height) {
  AABB a = m_aabb[node];
  a.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(a.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node + "-" + (spot + 1) + "/" + height, color);

  int c1 = m_child1[node];
  int c2 = m_child2[node];
  if (c1 != NULL_NODE) {
   drawTree(argDraw, c1, spot + 1, height);
  }
  if (c2 != NULL_NODE) {
   drawTree(argDraw, c2, spot + 1, height);
  }
 }
}
origin: org.jbox2d/jbox2d-testbed

public void setCamera(Vec2 argPos) {
 model.getDebugDraw().getViewportTranform().setCenter(argPos);
}
origin: org.jbox2d/jbox2d-testbed

 @Override
 public void mouseDragged(MouseEvent e) {
  if (!drag) {
   return;
  }
  TestbedTest currTest = model.getCurrTest();
  if (currTest == null) {
   return;
  }
  Vec2 diff = new Vec2(e.getX(), e.getY());
  diff.subLocal(dragginMouse);
  currTest.getDebugDraw().getViewportTranform().getScreenVectorToWorld(diff, diff);
  currTest.getDebugDraw().getViewportTranform().getCenter().subLocal(diff);
  dragginMouse.set(e.getX(), e.getY());
 }
});
origin: org.jbox2d/jbox2d-testbed

 public void mouseWheelMoved(MouseWheelEvent e) {
  DebugDraw d = draw;
  int notches = e.getWheelRotation();
  TestbedTest currTest = model.getCurrTest();
  if (currTest == null) {
   return;
  }
  OBBViewportTransform trans = (OBBViewportTransform) d.getViewportTranform();
  oldCenter.set(model.getCurrTest().getWorldMouse());
  // Change the zoom and clamp it to reasonable values - can't clamp now.
  if (notches < 0) {
   trans.mulByTransform(upScale);
   currTest.setCachedCameraScale(currTest.getCachedCameraScale() * ZOOM_IN_SCALE);
  } else if (notches > 0) {
   trans.mulByTransform(downScale);
   currTest.setCachedCameraScale(currTest.getCachedCameraScale() * ZOOM_OUT_SCALE);
  }
  d.getScreenToWorldToOut(model.getMouse(), newCenter);
  Vec2 transformedMove = oldCenter.subLocal(newCenter);
  d.getViewportTranform().setCenter(
    d.getViewportTranform().getCenter().addLocal(transformedMove));
  currTest.setCachedCameraPos(d.getViewportTranform().getCenter());
 }
});
origin: org.jbox2d/jbox2d-testbed

public void mouseDragged(MouseEvent e) {
 pos.set(e.getX(), e.getY());
 if (e.getButton() == MouseEvent.BUTTON3) {
  posDif.set(model.getMouse());
  model.setMouse(pos);
  posDif.subLocal(pos);
  if(!model.getDebugDraw().getViewportTranform().isYFlip()){
   posDif.y *= -1;
  }
  model.getDebugDraw().getViewportTranform().getScreenVectorToWorld(posDif, posDif);
  model.getDebugDraw().getViewportTranform().getCenter().addLocal(posDif);
  if (model.getCurrTest() != null) {
   model.getCurrTest().setCachedCameraPos(
     model.getDebugDraw().getViewportTranform().getCenter());
  }
 }
 if (model.getCurrTest() != null) {
  model.setMouse(pos);
  model.getDebugDraw().getScreenToWorldToOut(pos, pos);
  model.getCurrTest().queueMouseMove(pos);
 }
}
origin: org.jbox2d/jbox2d-library

public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
 node.aabb.getVertices(drawVecs);
 color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
 argDraw.drawPolygon(drawVecs, 4, color);
 argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
 argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);
 if (node.child1 != null) {
  drawTree(argDraw, node.child1, spot + 1, height);
 }
 if (node.child2 != null) {
  drawTree(argDraw, node.child2, spot + 1, height);
 }
}

origin: com.github.almasb/fxgl-physics

  public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
    node.aabb.getVertices(drawVecs);

    Color color = Color.color(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
    argDraw.drawPolygon(drawVecs, 4, color);

    argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
    argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);

    if (node.child1 != null) {
      drawTree(argDraw, node.child1, spot + 1, height);
    }
    if (node.child2 != null) {
      drawTree(argDraw, node.child2, spot + 1, height);
    }
  }
}
origin: andmizi/MobikeTags

 public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
  node.aabb.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);

  if (node.child1 != null) {
   drawTree(argDraw, node.child1, spot + 1, height);
  }
  if (node.child2 != null) {
   drawTree(argDraw, node.child2, spot + 1, height);
  }
 }
}
origin: com.github.almasb/fxgl-physics

  public void drawTree(DebugDraw argDraw, int node, int spot, int height) {
    AABB a = m_aabb[node];
    a.getVertices(drawVecs);

    Color color = Color.color(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
    argDraw.drawPolygon(drawVecs, 4, color);

    argDraw.getViewportTranform().getWorldToScreen(a.upperBound, textVec);
    argDraw.drawString(textVec.x, textVec.y, node + "-" + (spot + 1) + "/" + height, color);

    int c1 = m_child1[node];
    int c2 = m_child2[node];
    if (c1 != NULL_NODE) {
      drawTree(argDraw, c1, spot + 1, height);
    }
    if (c2 != NULL_NODE) {
      drawTree(argDraw, c2, spot + 1, height);
    }
  }
}
origin: andmizi/MobikeTags

 public void drawTree(DebugDraw argDraw, int node, int spot, int height) {
  AABB a = m_aabb[node];
  a.getVertices(drawVecs);

  color.set(1, (height - spot) * 1f / height, (height - spot) * 1f / height);
  argDraw.drawPolygon(drawVecs, 4, color);

  argDraw.getViewportTranform().getWorldToScreen(a.upperBound, textVec);
  argDraw.drawString(textVec.x, textVec.y, node + "-" + (spot + 1) + "/" + height, color);

  int c1 = m_child1[node];
  int c2 = m_child2[node];
  if (c1 != NULL_NODE) {
   drawTree(argDraw, c1, spot + 1, height);
  }
  if (c2 != NULL_NODE) {
   drawTree(argDraw, c2, spot + 1, height);
  }
 }
}
org.jbox2d.callbacksDebugDrawgetViewportTranform

Popular methods of DebugDraw

  • drawCircle
    Draw a circle.
  • drawPolygon
    Draw a closed polygon provided in CCW order. This implementation uses #drawSegment(Vec2,Vec2,Color3f
  • drawSegment
    Draw a line segment.
  • drawString
    Draw a string.
  • drawParticles
    Draw a particle array
  • drawParticlesWireframe
    Draw a particle array
  • drawSolidCircle
    Draw a solid circle.
  • drawSolidPolygon
    Draw a solid closed polygon provided in CCW order.
  • drawTransform
    Draw a transform. Choose your own length scale
  • flush
    Called at the end of drawing a world
  • getFlags
  • setCamera
  • getFlags,
  • setCamera,
  • setViewportTransform,
  • drawPoint,
  • getScreenToWorldToOut,
  • setFlags

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now