本文整理汇总了Java中org.jbox2d.common.Vec3类的典型用法代码示例。如果您正苦于以下问题:Java Vec3类的具体用法?Java Vec3怎么用?Java Vec3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Vec3类属于org.jbox2d.common包,在下文中一共展示了Vec3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PrismaticJoint
import org.jbox2d.common.Vec3; //导入依赖的package包/类
protected PrismaticJoint(IWorldPool argWorld, PrismaticJointDef def) {
super(argWorld, def);
m_localAnchorA = new Vec2(def.localAnchorA);
m_localAnchorB = new Vec2(def.localAnchorB);
m_localXAxisA = new Vec2(def.localAxisA);
m_localXAxisA.normalize();
m_localYAxisA = new Vec2();
Vec2.crossToOutUnsafe(1f, m_localXAxisA, m_localYAxisA);
m_referenceAngle = 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();
}
示例2: DefaultWorldPool
import org.jbox2d.common.Vec3; //导入依赖的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);
}
示例3: PrismaticJoint
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public PrismaticJoint(IWorldPool 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();
}
示例4: PrismaticJoint
import org.jbox2d.common.Vec3; //导入依赖的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();
}
示例5: WeldJoint
import org.jbox2d.common.Vec3; //导入依赖的package包/类
protected WeldJoint(IWorldPool argWorld, WeldJointDef def) {
super(argWorld, def);
m_localAnchorA = new Vec2(def.localAnchorA);
m_localAnchorB = new Vec2(def.localAnchorB);
m_referenceAngle = def.referenceAngle;
m_frequencyHz = def.frequencyHz;
m_dampingRatio = def.dampingRatio;
m_impulse = new Vec3();
m_impulse.setZero();
}
示例6: WeldJoint
import org.jbox2d.common.Vec3; //导入依赖的package包/类
/**
* @param argWorld
* @param def
*/
protected WeldJoint(IWorldPool 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();
}
示例7: WorldPool
import org.jbox2d.common.Vec3; //导入依赖的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);
}
示例8: WeldJoint
import org.jbox2d.common.Vec3; //导入依赖的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();
}
示例9: PoolingStackVec3
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public PoolingStackVec3(int size) {
this.size = size;
this.pool = new Vec3[size];
this.index = 0;
this.container = new PoolContainer<Vec3>();
for (int i = 0; i < size; i++) {
pool[i] = new Vec3();
}
}
示例10: pop
import org.jbox2d.common.Vec3; //导入依赖的package包/类
@Override @SuppressWarnings("fallthrough")
public org.jbox2d.pooling.PoolingStack.PoolContainer<Vec3> pop(int argNum) {
assert(index + argNum < size) : "End of stack reached, there is probably a leak somewhere";
switch (argNum) {
case 9:
container.p8 = pool[index++];
case 8:
container.p7 = pool[index++];
case 7:
container.p6 = pool[index++];
case 6:
container.p5 = pool[index++];
case 5:
container.p4 = pool[index++];
case 4:
container.p3 = pool[index++];
case 3:
container.p2 = pool[index++];
case 2:
container.p1 = pool[index++];
case 1:
container.p0 = pool[index++];
break;
default:
assert(false);
}
return container;
}
示例11: popVec3
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public final PoolContainer<Vec3> popVec3(int argNum){
if(!Settings.POOLING){
PoolContainer<Vec3> pc = new PoolContainer<Vec3>();
Vec3[] ray = new Vec3[PoolContainer.MAX_MEMBERS];
for(int i=0; i<argNum; i++){
ray[i] = new Vec3();
}
pc.populate(ray);
return pc;
}
return vec3s.pop(argNum);
}
示例12: testMat33
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public void testMat33() {
Mat33 mat = new Mat33();
mat.ex.set(3, 19, -5);
mat.ey.set(-1, 1, 4);
mat.ez.set(-10, 4, 4);
Vec3 b = new Vec3(4, 1, 2);
assertEquals(new Vec3(0.096f, 1.1013334f, -.48133332f), mat.solve33(b));
Vec2 b2 = new Vec2(4, 1);
assertEquals(new Vec2(0.22727273f, -3.318182f), mat.solve22(b2));
}
示例13: draw
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public void draw(GL10 gl) {
if(!visible) { return; }
// Update local data from physics engine, if applicable
if(body != null) {
position = Renderer.worldToScreen(body.getPosition());
if (!fixedRotation) {
rotation = body.getAngle() * 57.2957795786f;
}
}
//start defining things to draw
//save current state
gl.glPushMatrix();
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
//move to object position
gl.glTranslatef(position.x,position.y,1.0f);
// set angle and rotation
gl.glRotatef(0.0f,1.0f,0.0f,0.0f);
gl.glRotatef(0.0f,0.0f,1.0f,0.0f);
gl.glRotatef(rotation,0.0f,0.0f,1.0f);
//get color convert to 0.0 - 1.0 range
Vec3 renderCol = color.toFloat();
gl.glColor4f(renderCol.x,renderCol.y,renderCol.z,1.0f);
gl.glVertexPointer(3,GL10.GL_FLOAT,0,vertBuffer);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
gl.glPopMatrix();
}
示例14: popVec3
import org.jbox2d.common.Vec3; //导入依赖的package包/类
public Vec3 popVec3()
{
if (!Settings.POOLING)
{
return new Vec3();
}
return vec3s.pop();
}
示例15: DefaultWorldPool
import org.jbox2d.common.Vec3; //导入依赖的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);
}