本文整理汇总了Java中com.bulletphysics.dynamics.DynamicsWorld类的典型用法代码示例。如果您正苦于以下问题:Java DynamicsWorld类的具体用法?Java DynamicsWorld怎么用?Java DynamicsWorld使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DynamicsWorld类属于com.bulletphysics.dynamics包,在下文中一共展示了DynamicsWorld类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FloorModel
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
FloorModel(Texture t, Point3d p, DynamicsWorld world) {
super(p,1);
mkStaticGroundPlane(world);
if(floorInt == 0){
this.gl = gl;
this.t = t;
TextureCoords textureCoords = t.getImageTexCoords();
textureTop = textureCoords.top();
textureBottom = textureCoords.bottom();
textureLeft = textureCoords.left();
textureRight = textureCoords.right();
floorInt = genCibeList(world);
}
}
示例2: mkStaticGroundPlane
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
protected void mkStaticGroundPlane(DynamicsWorld world) {
// floor
float mass = 0;
CollisionShape shape = new BoxShape(new Vector3f(L, 10, W));
Transform t = new Transform();
t.setIdentity();
t.origin.set(new Vector3f(p.x,p.y-10,p.z));
MotionState motionState = new DefaultMotionState(t);
RigidBodyConstructionInfo info = new RigidBodyConstructionInfo(mass, motionState, shape);
RigidBody body = new RigidBody(info);
body.setFriction(1f);
body.setRestitution(.5f);
world.addRigidBody(body);
}
示例3: initializePhysics
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
protected void initializePhysics(DynamicsWorld world){
t = new Transform();
t.setIdentity();
t.origin.set(new Vector3f(p.x,p.y,p.z));
Vector3f inertia = new Vector3f(0,0,0);
shape.calculateLocalInertia(p.mass,inertia);
shape.setLocalScaling(new Vector3f(p.size, p.size, p.size));
MotionState motionState = new DefaultMotionState(t);
RigidBodyConstructionInfo info = new RigidBodyConstructionInfo(p.mass,motionState,shape,inertia);
body = new RigidBody(info);
body.setFriction(friction);
body.setDamping(linDamping, angDamping);
body.setAngularFactor(angularFactor);
body.setRestitution(restitution);
Scene.world.addRigidBody(body);
}
示例4: Wall
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
Wall(Point3d p, DynamicsWorld world) {
super(p, 1);
if(obj == 0){
try {
texture = Textures.wall;
TextureCoords textureCoords = texture.getImageTexCoords();
textureTop = textureCoords.top();
textureBottom = textureCoords.bottom();
textureLeft = textureCoords.left();
textureRight = textureCoords.right();
}catch (Exception e){
e.printStackTrace();
System.out.println("Error loading wall texture");
}
obj = genCube();
}
initializePhysics(world);
}
示例5: DebugDrawerActor
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public DebugDrawerActor (DynamicsWorld dynamicsWorld) {
this.dynamicsWorld = dynamicsWorld;
dynamicsWorld.setDebugDrawer(new DebugDrawer());
dynamicsWorld.getDebugDrawer().setDebugMode(DebugDrawModes.DRAW_WIREFRAME | DebugDrawModes.DRAW_AABB);
dynamicsWorld.getDebugDrawer().setDebugMode(DebugDrawModes.DRAW_WIREFRAME);
setTouchable(Touchable.disabled);
}
示例6: genCibeList
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
protected int genCibeList(DynamicsWorld world){
int wsz = 5;
for(int z=-W;z<W;z+=wsz*2){
wall.add(new Wall(new Point3d(L,wsz,z,wsz,0),world));
wall.add(new Wall(new Point3d(-L,wsz,z,wsz,0),world));
}
for(int x=-L;x<L;x+=wsz*2){
wall.add(new Wall(new Point3d(x,wsz,W,wsz,0),world));
wall.add(new Wall(new Point3d(x,wsz,-W,wsz,0),world));
}
floorInt = gl.glGenLists(1);
gl.glNewList(floorInt, gl.GL_COMPILE);
gl.glDisable(gl.GL_CULL_FACE);
gl.glBegin(gl.GL_QUADS);
t.enable(gl);
t.bind(gl);
gl.glNormal3d(0, 1, 0);
for(int x =-L;x<L;x+=fSec)
for(int z=-W;z<W;z+=fSec){
gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3f(x, y, z);
gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3f(x + fSec, y, z);
gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3f(x + fSec, y, z + fSec);
gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3f(x, y, z + fSec);
}
gl.glEnd();
gl.glEnable(gl.GL_CULL_FACE);
gl.glEndList();
return floorInt;
}
示例7: BasketBall
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
BasketBall(Point3d p, DynamicsWorld world) {
super(p,Textures.basketBall);
p.size=0.127f;
p.mass=0.62369f;
//scale = false;
friction=1;
linDamping=.1f;
angDamping=.1f;
angularFactor=1;
restitution=1.2f;
initializePhysics(world);
}
示例8: CannonBall
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
CannonBall( Point3d p, DynamicsWorld world) {
super(p,Textures.cannonBall);
p.size=0.166624f;
p.mass=19.0509f;
friction=1;
linDamping=.1f;
angDamping=.1f;
angularFactor=1;
restitution=.5f;
initializePhysics(world);
}
示例9: Box
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
Box(Point3d p, DynamicsWorld world, Texture texture) {
super(p,1);
this.texture =texture;
angDamping=.1f;
linDamping=.1f;
friction=1f;
restitution=.25f;
shape = new BoxShape(new Vector3f(1,1,1));
callist = genCube();
initializePhysics(world);
}
示例10: Skeleton
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
Skeleton(Point3d p,DynamicsWorld world,Vector<Integer> frames){
super(p, frames, 0);
//scaleGL=false;
radius=.25f;
angularFactor=0;
shape = new CapsuleShape(radius,p.size);
initializePhysics(world);
}
示例11: DefaultVehicleRaycaster
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public DefaultVehicleRaycaster(DynamicsWorld world) {
this.dynamicsWorld = world;
}
示例12: RagDoll
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public RagDoll(DynamicsWorld ownerWorld, Vector3f positionOffset) {
this(ownerWorld, positionOffset, 1.0f);
}
示例13: getDynamicsWorld
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public DynamicsWorld getDynamicsWorld() {
return dynamicsWorld;
}
示例14: getWorld
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public static DynamicsWorld getWorld() {
return world;
}
示例15: ConcaveCollisionModel
import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
ConcaveCollisionModel(Point3d p, DynamicsWorld world, ObjectArrayList<Vector3f> points, int callist) {
super(p, world, points, callist);
}