当前位置: 首页>>代码示例>>Java>>正文


Java JointEdge类代码示例

本文整理汇总了Java中org.jbox2d.dynamics.joints.JointEdge的典型用法代码示例。如果您正苦于以下问题:Java JointEdge类的具体用法?Java JointEdge怎么用?Java JointEdge使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JointEdge类属于org.jbox2d.dynamics.joints包,在下文中一共展示了JointEdge类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldCollide

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/**
 * This is used to prevent connected bodies from colliding. It may lie, depending on the
 * collideConnected flag.
 * 
 * @param other
 * @return
 */
public boolean shouldCollide(Body other) {
  // At least one body should be dynamic.
  if (m_type != BodyType.DYNAMIC && other.m_type != BodyType.DYNAMIC) {
    return false;
  }

  // Does a joint prevent collision?
  for (JointEdge jn = m_jointList; jn != null; jn = jn.next) {
    if (jn.other == other) {
      if (jn.joint.getCollideConnected() == false) {
        return false;
      }
    }
  }

  return true;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:25,代码来源:Body.java

示例2: shouldCollide

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/**
 * This is used to prevent connected bodies from colliding.
 * It may lie, depending on the collideConnected flag.
 * 
 * @param other
 * @return
 */
public boolean shouldCollide(Body other) {
	// At least one body should be dynamic.
	if (m_type != BodyType.DYNAMIC && other.m_type != BodyType.DYNAMIC) {
		return false;
	}
	
	// Does a joint prevent collision?
	for (JointEdge jn = m_jointList; jn != null; jn = jn.next) {
		if (jn.other == other) {
			if (jn.joint.m_collideConnected == false) {
				return false;
			}
		}
	}
	
	return true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:Body.java

示例3: shouldCollide

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/**
 * This is used to prevent connected bodies from colliding. It may lie,
 * depending on the collideConnected flag.
 * 
 * @param other
 * @return
 */
public boolean shouldCollide(Body other) {
	// At least one body should be dynamic.
	if (m_type != BodyType.DYNAMIC && other.m_type != BodyType.DYNAMIC) {
		return false;
	}

	// Does a joint prevent collision?
	for (JointEdge jn = m_jointList; jn != null; jn = jn.next) {
		if (jn.other == other) {
			if (jn.joint.m_collideConnected == false) {
				return false;
			}
		}
	}

	return true;
}
 
开发者ID:col726,项目名称:game-engine-CMZ,代码行数:25,代码来源:Body.java

示例4: destroyBody

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/** Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during
 * callbacks.
 * @warning This automatically deletes all associated shapes and joints.
 * @warning This function is locked during callbacks. */
public void destroyBody (Body body) {
	JointEdge jointEdge = body.body.getJointList();
	while (jointEdge != null) {
		world.destroyJoint(jointEdge.joint);
		joints.remove(jointEdge.joint);
		jointEdge = jointEdge.next;
	}
	world.destroyBody(body.body);
	bodies.remove(body.body);
	for (Fixture fixture : body.fixtures) {
		fixtures.remove(fixture.fixture);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:18,代码来源:World.java

示例5: getJointList

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/** Get the list of all joints attached to this body. */
public final JointEdge getJointList() {
  return m_jointList;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:5,代码来源:Body.java

示例6: destroyBody

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/**
 * destroy a rigid body given a definition. No reference to the definition is retained. This
 * function is locked during callbacks.
 * 
 * @warning This automatically deletes all associated shapes and joints.
 * @warning This function is locked during callbacks.
 * @param body
 */
public void destroyBody(Body body) {
  assert (m_bodyCount > 0);
  assert (isLocked() == false);
  if (isLocked()) {
    return;
  }

  // Delete the attached joints.
  JointEdge je = body.m_jointList;
  while (je != null) {
    JointEdge je0 = je;
    je = je.next;
    if (m_destructionListener != null) {
      m_destructionListener.sayGoodbye(je0.joint);
    }

    destroyJoint(je0.joint);

    body.m_jointList = je;
  }
  body.m_jointList = null;

  // Delete the attached contacts.
  ContactEdge ce = body.m_contactList;
  while (ce != null) {
    ContactEdge ce0 = ce;
    ce = ce.next;
    m_contactManager.destroy(ce0.contact);
  }
  body.m_contactList = null;

  Fixture f = body.m_fixtureList;
  while (f != null) {
    Fixture f0 = f;
    f = f.m_next;

    if (m_destructionListener != null) {
      m_destructionListener.sayGoodbye(f0);
    }

    f0.destroyProxies(m_contactManager.m_broadPhase);
    f0.destroy();
    // TODO djm recycle fixtures (here or in that destroy method)
    body.m_fixtureList = f;
    body.m_fixtureCount -= 1;
  }
  body.m_fixtureList = null;
  body.m_fixtureCount = 0;

  // Remove world body list.
  if (body.m_prev != null) {
    body.m_prev.m_next = body.m_next;
  }

  if (body.m_next != null) {
    body.m_next.m_prev = body.m_prev;
  }

  if (body == m_bodyList) {
    m_bodyList = body.m_next;
  }

  --m_bodyCount;
  // TODO djm recycle body
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:74,代码来源:World.java

示例7: getJointList

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/** Get the list of all joints attached to this body. */
public final JointEdge getJointList() {
	return m_jointList;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:5,代码来源:Body.java

示例8: destroyBody

import org.jbox2d.dynamics.joints.JointEdge; //导入依赖的package包/类
/**
 * destroy a rigid body given a definition. No reference to the definition
 * is retained. This function is locked during callbacks.
 * 
 * @warning This automatically deletes all associated shapes and joints.
 * @warning This function is locked during callbacks.
 * @param body
 */
public void destroyBody(Body body) {
	assert (m_bodyCount > 0);
	assert (isLocked() == false);
	if (isLocked()) {
		return;
	}
	
	// Delete the attached joints.
	JointEdge je = body.m_jointList;
	while (je != null) {
		JointEdge je0 = je;
		je = je.next;
		if (m_destructionListener != null) {
			m_destructionListener.sayGoodbye(je0.joint);
		}
		
		destroyJoint(je0.joint);
	}
	body.m_jointList = null;
	
	// Delete the attached contacts.
	ContactEdge ce = body.m_contactList;
	while (ce != null) {
		ContactEdge ce0 = ce;
		ce = ce.next;
		m_contactManager.destroy(ce0.contact);
	}
	body.m_contactList = null;
	
	Fixture f = body.m_fixtureList;
	while (f != null) {
		Fixture f0 = f;
		f = f.m_next;
		
		if (m_destructionListener != null) {
			m_destructionListener.sayGoodbye(f0);
		}
		
		f0.destroyProxy(m_contactManager.m_broadPhase);
		f0.destroy();
		// TODO djm recycle fixtures (here or in that destroy method)
	}
	body.m_fixtureList = null;
	body.m_fixtureCount = 0;
	
	// Remove world body list.
	if (body.m_prev != null) {
		body.m_prev.m_next = body.m_next;
	}
	
	if (body.m_next != null) {
		body.m_next.m_prev = body.m_prev;
	}
	
	if (body == m_bodyList) {
		m_bodyList = body.m_next;
	}
	
	--m_bodyCount;
	// TODO djm recycle body
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:70,代码来源:World.java


注:本文中的org.jbox2d.dynamics.joints.JointEdge类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。