congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BroadPhase
Code IndexAdd Tabnine to your IDE (free)

How to use
BroadPhase
in
org.jbox2d.collision.broadphase

Best Java code snippets using org.jbox2d.collision.broadphase.BroadPhase (Showing top 20 results out of 315)

origin: libgdx/libgdx

public void createProxies(BroadPhase broadPhase, final Transform xf) {
 assert (m_proxyCount == 0);
 // Create proxies in the broad-phase.
 m_proxyCount = m_shape.getChildCount();
 for (int i = 0; i < m_proxyCount; ++i) {
  FixtureProxy proxy = m_proxies[i];
  m_shape.computeAABB(proxy.aabb, xf, i);
  proxy.proxyId = broadPhase.createProxy(proxy.aabb, proxy);
  proxy.fixture = this;
  proxy.childIndex = i;
 }
}
origin: libgdx/libgdx

/**
 * Internal method
 * 
 * @param broadPhase
 */
public void destroyProxies(BroadPhase broadPhase) {
 // Destroy proxies in the broad-phase.
 for (int i = 0; i < m_proxyCount; ++i) {
  FixtureProxy proxy = m_proxies[i];
  broadPhase.destroyProxy(proxy.proxyId);
  proxy.proxyId = BroadPhase.NULL_PROXY;
 }
 m_proxyCount = 0;
}
origin: libgdx/libgdx

/**
 * Get the number of broad-phase proxies.
 * 
 * @return
 */
public int getProxyCount() {
 return m_contactManager.m_broadPhase.getProxyCount();
}
origin: libgdx/libgdx

  for (int i = 0; i < f.m_proxyCount; ++i) {
   FixtureProxy proxy = f.m_proxies[i];
   AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId);
   if (aabb != null) {
    Vec2[] vs = avs.get(4);
m_contactManager.m_broadPhase.drawTree(m_debugDraw);
origin: libgdx/libgdx

public boolean treeCallback(int nodeId) {
 FixtureProxy proxy = (FixtureProxy) broadPhase.getUserData(nodeId);
 return callback.reportFixture(proxy.fixture);
}
origin: libgdx/libgdx

/**
 * Gets the height of the dynamic tree
 * 
 * @return
 */
public int getTreeHeight() {
 return m_contactManager.m_broadPhase.getTreeHeight();
}
origin: libgdx/libgdx

/**
 * Gets the balance of the dynamic tree
 * 
 * @return
 */
public int getTreeBalance() {
 return m_contactManager.m_broadPhase.getTreeBalance();
}
origin: libgdx/libgdx

/**
 * Gets the quality of the dynamic tree
 * 
 * @return
 */
public float getTreeQuality() {
 return m_contactManager.m_broadPhase.getTreeQuality();
}
origin: libgdx/libgdx

displacement.y = transform2.p.y - transform1.p.y;
broadPhase.moveProxy(proxy.proxyId, proxy.aabb, displacement);
origin: jbox2d/jbox2d

  for (int i = 0; i < f.m_proxyCount; ++i) {
   FixtureProxy proxy = f.m_proxies[i];
   AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId);
   if (aabb != null) {
    Vec2[] vs = avs.get(4);
m_contactManager.m_broadPhase.drawTree(m_debugDraw);
origin: libgdx/libgdx

public float raycastCallback(RayCastInput input, int nodeId) {
 Object userData = broadPhase.getUserData(nodeId);
 FixtureProxy proxy = (FixtureProxy) userData;
 Fixture fixture = proxy.fixture;
 int index = proxy.childIndex;
 boolean hit = fixture.raycast(output, input, index);
 if (hit) {
  float fraction = output.fraction;
  // Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2;
  temp.set(input.p2).mulLocal(fraction);
  point.set(input.p1).mulLocal(1 - fraction).addLocal(temp);
  return callback.reportFixture(fixture, point, output.normal, fraction);
 }
 return input.maxFraction;
}
origin: jbox2d/jbox2d

/**
 * Gets the height of the dynamic tree
 * 
 * @return
 */
public int getTreeHeight() {
 return m_contactManager.m_broadPhase.getTreeHeight();
}
origin: jbox2d/jbox2d

/**
 * Gets the balance of the dynamic tree
 * 
 * @return
 */
public int getTreeBalance() {
 return m_contactManager.m_broadPhase.getTreeBalance();
}
origin: jbox2d/jbox2d

/**
 * Gets the quality of the dynamic tree
 * 
 * @return
 */
public float getTreeQuality() {
 return m_contactManager.m_broadPhase.getTreeQuality();
}
origin: jbox2d/jbox2d

displacement.y = transform2.p.y - transform1.p.y;
broadPhase.moveProxy(proxy.proxyId, proxy.aabb, displacement);
origin: org.jbox2d/jbox2d-library

  for (int i = 0; i < f.m_proxyCount; ++i) {
   FixtureProxy proxy = f.m_proxies[i];
   AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId);
   Vec2[] vs = avs.get(4);
   vs[0].set(aabb.lowerBound.x, aabb.lowerBound.y);
m_contactManager.m_broadPhase.drawTree(m_debugDraw);
origin: jbox2d/jbox2d

public boolean treeCallback(int nodeId) {
 FixtureProxy proxy = (FixtureProxy) broadPhase.getUserData(nodeId);
 return callback.reportFixture(proxy.fixture);
}
origin: org.jbox2d/jbox2d-library

/**
 * Gets the height of the dynamic tree
 * 
 * @return
 */
public int getTreeHeight() {
 return m_contactManager.m_broadPhase.getTreeHeight();
}
origin: org.jbox2d/jbox2d-library

/**
 * Gets the balance of the dynamic tree
 * 
 * @return
 */
public int getTreeBalance() {
 return m_contactManager.m_broadPhase.getTreeBalance();
}
origin: jbox2d/jbox2d

public void createProxies(BroadPhase broadPhase, final Transform xf) {
 assert (m_proxyCount == 0);
 // Create proxies in the broad-phase.
 m_proxyCount = m_shape.getChildCount();
 for (int i = 0; i < m_proxyCount; ++i) {
  FixtureProxy proxy = m_proxies[i];
  m_shape.computeAABB(proxy.aabb, xf, i);
  proxy.proxyId = broadPhase.createProxy(proxy.aabb, proxy);
  proxy.fixture = this;
  proxy.childIndex = i;
 }
}
org.jbox2d.collision.broadphaseBroadPhase

Javadoc

The broad-phase is used for computing pairs and performing volume queries and ray casts. This broad-phase does not persist pairs. Instead, this reports potentially new pairs. It is up to the client to consume the new pairs and to track subsequent overlap.

Most used methods

  • createProxy
    Create a proxy with an initial AABB. Pairs are not reported until updatePairs is called.
  • destroyProxy
    Destroy a proxy. It is up to the client to remove any pairs.
  • drawTree
  • getFatAABB
  • getProxyCount
    Get the number of proxies.
  • getTreeBalance
  • getTreeHeight
    Get the height of the embedded tree.
  • getTreeQuality
  • getUserData
  • moveProxy
    Call MoveProxy as many times as you like, then when you are done call UpdatePairs to finalized the p
  • query
    Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the
  • raycast
    Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in
  • query,
  • raycast,
  • testOverlap,
  • touchProxy,
  • updatePairs,
  • <init>,
  • bufferMove,
  • unbufferMove

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Github Copilot alternatives
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