當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldPool類代碼示例

本文整理匯總了Java中org.jbox2d.pooling.WorldPool的典型用法代碼示例。如果您正苦於以下問題:Java WorldPool類的具體用法?Java WorldPool怎麽用?Java WorldPool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WorldPool類屬於org.jbox2d.pooling包,在下文中一共展示了WorldPool類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PrismaticJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public PrismaticJoint(WorldPool argWorld, PrismaticJointDef def) {
	super(argWorld, def);
	m_localAnchor1 = new Vec2(def.localAnchorA);
	m_localAnchor2 = new Vec2(def.localAnchorB);
	m_localXAxis1 = new Vec2(def.localAxis1);
	m_localYAxis1 = new Vec2();
	Vec2.crossToOut(1f, m_localXAxis1, m_localYAxis1);
	m_refAngle = def.referenceAngle;
	
	m_impulse = new Vec3();
	m_motorMass = 0.0f;
	m_motorImpulse = 0.0f;
	
	m_lowerTranslation = def.lowerTranslation;
	m_upperTranslation = def.upperTranslation;
	m_maxMotorForce = def.maxMotorForce;
	m_motorSpeed = def.motorSpeed;
	m_enableLimit = def.enableLimit;
	m_enableMotor = def.enableMotor;
	m_limitState = LimitState.INACTIVE;
	
	m_K = new Mat33();
	m_axis = new Vec2();
	m_perp = new Vec2();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:26,代碼來源:PrismaticJoint.java

示例2: MouseJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
protected MouseJoint(WorldPool argWorld, MouseJointDef def) {
	super(argWorld, def);
	assert(def.target.isValid());
	assert(def.maxForce >= 0);
	assert(def.frequencyHz >= 0);
	assert(def.dampingRatio >= 0);
	
	m_target.set(def.target);
	Transform.mulTransToOut(m_bodyB.getTransform(), m_target, m_localAnchor);
	
	m_maxForce = def.maxForce;
	m_impulse.setZero();
	
	m_frequencyHz = def.frequencyHz;
	m_dampingRatio = def.dampingRatio;
	
	m_beta = 0;
	m_gamma = 0;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:20,代碼來源:MouseJoint.java

示例3: LineJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public LineJoint(WorldPool argPool, LineJointDef def) {
	super(argPool, def);
	m_localAnchor1.set(def.localAnchorA);
	m_localAnchor2.set(def.localAnchorB);
	m_localXAxis1.set(def.localAxisA);
	Vec2.crossToOut(1.0f, m_localXAxis1, m_localYAxis1);
	
	m_impulse.setZero();
	m_motorMass = 0.0f;
	m_motorImpulse = 0.0f;
	
	m_lowerTranslation = def.lowerTranslation;
	m_upperTranslation = def.upperTranslation;
	m_maxMotorForce = def.maxMotorForce;
	m_motorSpeed = def.motorSpeed;
	m_enableLimit = def.enableLimit;
	m_enableMotor = def.enableMotor;
	m_limitState = LimitState.INACTIVE;
	
	m_axis.setZero();
	m_perp.setZero();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:23,代碼來源:LineJoint.java

示例4: PulleyJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
/**
 * @param argWorldPool
 * @param def
 */
public PulleyJoint(WorldPool argWorldPool, PulleyJointDef def) {
	super(argWorldPool, def);
	m_groundAnchor1.set(def.groundAnchorA);
	m_groundAnchor2.set(def.groundAnchorB);
	m_localAnchor1.set(def.localAnchorA);
	m_localAnchor2.set(def.localAnchorB);
	
	assert (def.ratio != 0.0f);
	m_ratio = def.ratio;
	
	m_constant = def.lengthA + m_ratio * def.lengthB;
	
	m_maxLength1 = MathUtils.min(def.maxLengthA, m_constant - m_ratio * MIN_PULLEY_LENGTH);
	m_maxLength2 = MathUtils.min(def.maxLengthB, (m_constant - MIN_PULLEY_LENGTH) / m_ratio);
	
	m_impulse = 0.0f;
	m_limitImpulse1 = 0.0f;
	m_limitImpulse2 = 0.0f;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:24,代碼來源:PulleyJoint.java

示例5: World

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
/**
 * Construct a world object.
 * 
 * @param gravity
 *            the world gravity vector.
 * @param doSleep
 *            improve performance by not simulating inactive bodies.
 */
public World(Vec2 gravity, boolean doSleep) {
	pool = new WorldPool(WORLD_POOL_SIZE);
	m_destructionListener = null;
	m_debugDraw = null;
	
	m_bodyList = null;
	m_jointList = null;
	
	m_bodyCount = 0;
	m_jointCount = 0;
	
	m_warmStarting = true;
	m_continuousPhysics = true;
	
	m_allowSleep = doSleep;
	m_gravity.set(gravity);
	
	m_flags = CLEAR_FORCES;
	
	m_inv_dt0 = 0f;
	
	m_contactManager = new ContactManager(this);
	
	initializeRegisters();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:34,代碼來源:World.java

示例6: Collision

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public Collision(WorldPool argPool) {
	incidentEdge[0] = new ClipVertex();
	incidentEdge[1] = new ClipVertex();
	clipPoints1[0] = new ClipVertex();
	clipPoints1[1] = new ClipVertex();
	clipPoints2[0] = new ClipVertex();
	clipPoints2[1] = new ClipVertex();
	pool = argPool;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:10,代碼來源:Collision.java

示例7: Contact

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
protected Contact(WorldPool argPool) {
	m_fixtureA = null;
	m_fixtureB = null;
	m_nodeA = new ContactEdge();
	m_nodeB = new ContactEdge();
	m_manifold = new Manifold();
	pool = argPool;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:9,代碼來源:Contact.java

示例8: DistanceJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public DistanceJoint(WorldPool argWorld, final DistanceJointDef def) {
	super(argWorld, def);
	m_localAnchor1 = def.localAnchorA.clone();
	m_localAnchor2 = def.localAnchorB.clone();
	m_length = def.length;
	m_impulse = 0.0f;
	m_u = new Vec2();
	m_frequencyHz = def.frequencyHz;
	m_dampingRatio = def.dampingRatio;
	m_gamma = 0.0f;
	m_bias = 0.0f;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:13,代碼來源:DistanceJoint.java

示例9: RevoluteJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public RevoluteJoint(WorldPool argWorld, RevoluteJointDef def) {
	super(argWorld, def);
	m_localAnchor1.set(def.localAnchorA);
	m_localAnchor2.set(def.localAnchorB);
	m_referenceAngle = def.referenceAngle;
	
	m_motorImpulse = 0;
	
	m_lowerAngle = def.lowerAngle;
	m_upperAngle = def.upperAngle;
	m_maxMotorTorque = def.maxMotorTorque;
	m_motorSpeed = def.motorSpeed;
	m_enableLimit = def.enableLimit;
	m_enableMotor = def.enableMotor;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:16,代碼來源:RevoluteJoint.java

示例10: Joint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
protected Joint(WorldPool argWorldPool, JointDef def) {
	assert (def.bodyA != def.bodyB);
	
	pool = argWorldPool;
	m_type = def.type;
	m_prev = null;
	m_next = null;
	m_bodyA = def.bodyA;
	m_bodyB = def.bodyB;
	m_collideConnected = def.collideConnected;
	m_islandFlag = false;
	m_userData = def.userData;
	
	m_edgeA = new JointEdge();
	m_edgeA.joint = null;
	m_edgeA.other = null;
	m_edgeA.prev = null;
	m_edgeA.next = null;
	
	m_edgeB = new JointEdge();
	m_edgeB.joint = null;
	m_edgeB.other = null;
	m_edgeB.prev = null;
	m_edgeB.next = null;
	
	m_localCenterA = new Vec2();
	m_localCenterB = new Vec2();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:29,代碼來源:Joint.java

示例11: WeldJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
/**
 * @param argWorld
 * @param def
 */
protected WeldJoint(WorldPool argWorld, WeldJointDef def) {
	super(argWorld, def);
	m_localAnchorA = new Vec2(def.localAnchorA);
	m_localAnchorB = new Vec2(def.localAnchorB);
	m_referenceAngle = def.referenceAngle;

	m_impulse = new Vec3();
	m_impulse.setZero();
	
	m_mass = new Mat33();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:16,代碼來源:WeldJoint.java

示例12: FrictionJoint

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
/**
 * @param argWorldPool
 * @param def
 */
public FrictionJoint(WorldPool argWorldPool, FrictionJointDef def) {
	super(argWorldPool, def);
	m_localAnchorA = new Vec2(def.localAnchorA);
	m_localAnchorB = new Vec2(def.localAnchorB);
	
	m_linearImpulse = new Vec2();
	m_angularImpulse = 0.0f;
	
	m_maxForce = def.maxForce;
	m_maxTorque = def.maxTorque;
	
	m_linearMass = new Mat22();
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:18,代碼來源:FrictionJoint.java

示例13: World

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public World(Vec2 gravity, boolean doSleep){
	this(gravity, doSleep,
			new WorldPool(WORLD_POOL_SIZE, WORLD_POOL_CONTAINER_SIZE));
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:5,代碼來源:World.java

示例14: raycast

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public final boolean raycast(final RayCastOutput output, final RayCastInput input) {
	return raycast(output, input, new WorldPool(4));
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:4,代碼來源:AABB.java

示例15: TimeOfImpact

import org.jbox2d.pooling.WorldPool; //導入依賴的package包/類
public TimeOfImpact(WorldPool argPool){
	pool = argPool;
}
 
開發者ID:fredsa,項目名稱:forplay,代碼行數:4,代碼來源:TimeOfImpact.java


注:本文中的org.jbox2d.pooling.WorldPool類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。