本文整理匯總了Java中org.jbox2d.common.Vec2.subLocal方法的典型用法代碼示例。如果您正苦於以下問題:Java Vec2.subLocal方法的具體用法?Java Vec2.subLocal怎麽用?Java Vec2.subLocal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jbox2d.common.Vec2
的用法示例。
在下文中一共展示了Vec2.subLocal方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJointTranslation
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
public float getJointTranslation() {
Body b1 = m_bodyA;
Body b2 = m_bodyB;
Vec2 p1 = pool.popVec2();
Vec2 p2 = pool.popVec2();
Vec2 axis = pool.popVec2();
b1.getWorldPointToOut(m_localAnchorA, p1);
b2.getWorldPointToOut(m_localAnchorA, p2);
p2.subLocal(p1);
b1.getWorldVectorToOut(m_localXAxisA, axis);
float translation = Vec2.dot(p2, axis);
pool.pushVec2(3);
return translation;
}
示例2: getExtents
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
/**
* Get the extents of the AABB (half-widths).
*
* @return
*/
public final Vec2 getExtents() {
final Vec2 center = new Vec2(upperBound);
center.subLocal(lowerBound);
center.mulLocal(.5f);
return center;
}
示例3: getCurrentLengthA
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
public float getCurrentLengthA() {
final Vec2 p = pool.popVec2();
m_bodyA.getWorldPointToOut(m_localAnchorA, p);
p.subLocal(m_groundAnchorA);
float length = p.length();
pool.pushVec2(1);
return length;
}
示例4: getCurrentLengthB
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
public float getCurrentLengthB() {
final Vec2 p = pool.popVec2();
m_bodyB.getWorldPointToOut(m_localAnchorB, p);
p.subLocal(m_groundAnchorB);
float length = p.length();
pool.pushVec2(1);
return length;
}
示例5: getLength1
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
public float getLength1() {
final Vec2 p = pool.popVec2();
m_bodyA.getWorldPointToOut(m_localAnchorA, p);
p.subLocal(m_groundAnchorA);
float len = p.length();
pool.pushVec2(1);
return len;
}
示例6: getLength2
import org.jbox2d.common.Vec2; //導入方法依賴的package包/類
public float getLength2() {
final Vec2 p = pool.popVec2();
m_bodyB.getWorldPointToOut(m_localAnchorB, p);
p.subLocal(m_groundAnchorB);
float len = p.length();
pool.pushVec2(1);
return len;
}