本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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
}
示例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;
}
示例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
}