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


Java DynamicsWorld类代码示例

本文整理汇总了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);

    }
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:20,代码来源:FloorModel.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:17,代码来源:FloorModel.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:18,代码来源:CollisionModel.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:21,代码来源:Wall.java

示例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);
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:8,代码来源:DebugDrawerActor.java

示例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;

    }
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:34,代码来源:FloorModel.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:15,代码来源:BasketBall.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:14,代码来源:CannonBall.java

示例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);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:14,代码来源:Box.java

示例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);

}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:12,代码来源:Skeleton.java

示例11: DefaultVehicleRaycaster

import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public DefaultVehicleRaycaster(DynamicsWorld world) {
	this.dynamicsWorld = world;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:4,代码来源:DefaultVehicleRaycaster.java

示例12: RagDoll

import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public RagDoll(DynamicsWorld ownerWorld, Vector3f positionOffset) {
	this(ownerWorld, positionOffset, 1.0f);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:4,代码来源:RagDoll.java

示例13: getDynamicsWorld

import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public DynamicsWorld getDynamicsWorld() {
	return dynamicsWorld;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:4,代码来源:DemoApplication.java

示例14: getWorld

import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
public static DynamicsWorld getWorld() {
	return world;
}
 
开发者ID:Axodoss,项目名称:Wicken,代码行数:4,代码来源:PhysicsSystem.java

示例15: ConcaveCollisionModel

import com.bulletphysics.dynamics.DynamicsWorld; //导入依赖的package包/类
ConcaveCollisionModel(Point3d p, DynamicsWorld world, ObjectArrayList<Vector3f> points, int callist) {
    super(p, world, points, callist);
}
 
开发者ID:seemywingz,项目名称:Kengine,代码行数:4,代码来源:ConcaveCollisionModel.java


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