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


Java Distance类代码示例

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


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

示例1: DefaultWorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public DefaultWorldPool(int argSize, int argContainerSize) {
  vecs = new OrderedStack<Vec2>(argSize, argContainerSize) {
    protected Vec2 newInstance() { return new Vec2(); }
  };
  vec3s = new OrderedStack<Vec3>(argSize, argContainerSize) {
    protected Vec3 newInstance() { return new Vec3(); }
  };
  mats = new OrderedStack<Mat22>(argSize, argContainerSize) {
    protected Mat22 newInstance() { return new Mat22(); }
  };
  aabbs = new OrderedStack<AABB>(argSize, argContainerSize) {
    protected AABB newInstance() { return new AABB(); }
  };
  rots = new OrderedStack<Rot>(argSize, argContainerSize) {
    protected Rot newInstance() { return new Rot(); }
  };
  mat33s = new OrderedStack<Mat33>(argSize, argContainerSize) {
    protected Mat33 newInstance() { return new Mat33(); }
  };

  dist = new Distance();
  collision = new Collision(this);
  toi = new TimeOfImpact(this);
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:25,代码来源:DefaultWorldPool.java

示例2: DefaultWorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public DefaultWorldPool(int argSize, int argContainerSize) {
  vecs = new OrderedStack<Vector2>(argSize, argContainerSize) {
    protected Vector2 newInstance() { return new Vector2(); }
  };
  vec3s = new OrderedStack<Vector3>(argSize, argContainerSize) {
    protected Vector3 newInstance() { return new Vector3(); }
  };
  mats = new OrderedStack<Mat22>(argSize, argContainerSize) {
    protected Mat22 newInstance() { return new Mat22(); }
  };
  aabbs = new OrderedStack<AABB>(argSize, argContainerSize) {
    protected AABB newInstance() { return new AABB(); }
  };
  rots = new OrderedStack<Rot>(argSize, argContainerSize) {
    protected Rot newInstance() { return new Rot(); }
  };
  mat33s = new OrderedStack<Mat33>(argSize, argContainerSize) {
    protected Mat33 newInstance() { return new Mat33(); }
  };

  dist = new Distance();
  collision = new Collision(this);
  toi = new TimeOfImpact(this);
}
 
开发者ID:pianoman373,项目名称:Point-Engine,代码行数:25,代码来源:DefaultWorldPool.java

示例3: launch

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public void launch() {
  m_body.setTransform(new Vec2(0.0f, 4.0f), 0.0f);
  m_body.setLinearVelocity(new Vec2());
  m_body.setAngularVelocity(0.0f);

  m_x = MathUtils.randomFloat(-1.0f, 1.0f);
  m_bullet.setTransform(new Vec2(m_x, 10.0f), 0.0f);
  m_bullet.setLinearVelocity(new Vec2(0.0f, -50.0f));
  m_bullet.setAngularVelocity(0.0f);

  Distance.GJK_CALLS = 0;
  Distance.GJK_ITERS = 0;
  Distance.GJK_MAX_ITERS = 0;

  TimeOfImpact.toiCalls = 0;
  TimeOfImpact.toiIters = 0;
  TimeOfImpact.toiMaxIters = 0;
  TimeOfImpact.toiRootIters = 0;
  TimeOfImpact.toiMaxRootIters = 0;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:21,代码来源:BulletTest.java

示例4: step

import org.jbox2d.collision.Distance; //导入依赖的package包/类
@Override
public void step(TestbedSettings settings) {
  super.step(settings);


  if (Distance.GJK_CALLS > 0) {
    addTextLine(String.format("gjk calls = %d, ave gjk iters = %3.1f, max gjk iters = %d",
        Distance.GJK_CALLS, Distance.GJK_ITERS * 1.0 / (Distance.GJK_CALLS),
        Distance.GJK_MAX_ITERS));
  }

  if (TimeOfImpact.toiCalls > 0) {
    addTextLine(String.format("toi calls = %d, ave toi iters = %3.1f, max toi iters = %d",
        TimeOfImpact.toiCalls, TimeOfImpact.toiIters * 1f / (TimeOfImpact.toiCalls),
        TimeOfImpact.toiMaxRootIters));

    addTextLine(String.format("ave toi root iters = %3.1f, max toi root iters = %d",
        TimeOfImpact.toiRootIters * 1f / (TimeOfImpact.toiCalls), TimeOfImpact.toiMaxRootIters));
  }

  if (getStepCount() % 60 == 0) {
    launch();
  }
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:25,代码来源:BulletTest.java

示例5: WorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public WorldPool(int argSize, int argContainerSize){
	vecs = new OrderedStack<Vec2>(Vec2.class, argSize, argContainerSize);
	vec3s = new OrderedStack<Vec3>(Vec3.class, argSize, argContainerSize);
	mats = new OrderedStack<Mat22>(Mat22.class, argSize, argContainerSize);
	aabbs = new OrderedStack<AABB>(AABB.class, argSize, argContainerSize);
	
	dist = new Distance();
	collision = new Collision(this);
	toi = new TimeOfImpact(this);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:WorldPool.java

示例6: WorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public WorldPool(int argSize){
  vecs = new PoolingStackVec2(argSize);
  vec3s = new PoolingStackVec3(argSize);
  mats = new PoolingStackMat22(argSize);
  aabbs = new PoolingStackAABB(argSize);
	
	dist = new Distance();
	collision = new Collision(this);
	toi = new TimeOfImpact(this);
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:11,代码来源:WorldPool.java

示例7: WorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public WorldPool(int argSize)
{
	vecs= new PoolingStackVec2(argSize);
	vec3s= new PoolingStackVec3(argSize);
	mats= new PoolingStackMat22(argSize);
	aabbs= new PoolingStackAABB(argSize);

	dist= new Distance();
	collision= new Collision(this);
	toi= new TimeOfImpact(this);
}
 
开发者ID:dragome,项目名称:dragome-examples,代码行数:12,代码来源:WorldPool.java

示例8: DefaultWorldPool

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public DefaultWorldPool(int argSize, int argContainerSize) {
  vecs = new OrderedStack<Vec2>(Vec2.class, argSize, argContainerSize);
  vec3s = new OrderedStack<Vec3>(Vec3.class, argSize, argContainerSize);
  mats = new OrderedStack<Mat22>(Mat22.class, argSize, argContainerSize);
  aabbs = new OrderedStack<AABB>(AABB.class, argSize, argContainerSize);

  dist = new Distance();
  collision = new Collision(this);
  toi = new TimeOfImpact(this);
}
 
开发者ID:col726,项目名称:game-engine-CMZ,代码行数:11,代码来源:DefaultWorldPool.java

示例9: getDistance

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public final Distance getDistance() {
  return dist;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:4,代码来源:DefaultWorldPool.java

示例10: testDistance

import org.jbox2d.collision.Distance; //导入依赖的package包/类
@Test
public void testDistance() {
    Distance theDistance = new Distance();
}
 
开发者ID:mirkosertic,项目名称:Bytecoder,代码行数:5,代码来源:JBox2DTest.java

示例11: getDistance

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public final Distance getDistance(){
	return dist;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:4,代码来源:WorldPool.java

示例12: getDistance

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public Distance getDistance()
{
	return dist;
}
 
开发者ID:dragome,项目名称:dragome-examples,代码行数:5,代码来源:WorldPool.java

示例13: getDistance

import org.jbox2d.collision.Distance; //导入依赖的package包/类
public Distance getDistance(); 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:2,代码来源:IWorldPool.java


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