当前位置: 首页>>代码示例>>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;未经允许,请勿转载。