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


Java MotionState类代码示例

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


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

示例1: mkStaticGroundPlane

import com.bulletphysics.linearmath.MotionState; //导入依赖的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

示例2: initializePhysics

import com.bulletphysics.linearmath.MotionState; //导入依赖的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

示例3: RigidBodyConstructionInfo

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public RigidBodyConstructionInfo(float mass, MotionState motionState, CollisionShape collisionShape, Vector3 localInertia) {
	this.mass = mass;
	this.motionState = motionState;
	this.collisionShape = collisionShape;
	this.localInertia.set(localInertia);
	
	startWorldTransform.setIdentity();
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:9,代码来源:RigidBodyConstructionInfo.java

示例4: RigidBodyConstructionInfo

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public RigidBodyConstructionInfo(float mass, MotionState motionState, CollisionShape collisionShape, Vector3f localInertia) {
	this.mass = mass;
	this.motionState = motionState;
	this.collisionShape = collisionShape;
	this.localInertia.set(localInertia);
	
	startWorldTransform.setIdentity();
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:9,代码来源:RigidBodyConstructionInfo.java

示例5: makeBrick

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
/**
 * This method creates one individual physical domino.
 */
public RigidBody makeBrick(int i, float mass, Vector3f inertia,
        Vector3f loc, float angle) {
    brickOrigTransform[i] = new Transform(new Matrix4f(new Quat4f(0f, 0f,
            0f, 1f), new Vector3f(loc), 1f));
    MotionState brickMotion = new DefaultMotionState(brickOrigTransform[i]);
    RigidBodyConstructionInfo brickRigidBodyCI = new RigidBodyConstructionInfo(
            mass, brickMotion, brickShape, inertia);
    brick[i] = new RigidBody(brickRigidBodyCI);
    world.addRigidBody(brick[i]);
    return brick[i];
}
 
开发者ID:android-workloads,项目名称:JACWfA,代码行数:15,代码来源:BreakingTheWall.java

示例6: RigidBody

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public RigidBody (float mass, MotionState motionState, CollisionShape collisionShape) {
	this(mass, motionState, collisionShape, new Vector3(0f, 0f, 0f));
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:4,代码来源:RigidBody.java

示例7: getMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public MotionState getMotionState () {
	return optionalMotionState;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:4,代码来源:RigidBody.java

示例8: setMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public void setMotionState (MotionState motionState) {
	this.optionalMotionState = motionState;
	if (optionalMotionState != null) {
		motionState.getWorldTransform(worldTransform);
	}
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:7,代码来源:RigidBody.java

示例9: RigidBody

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public RigidBody(float mass, MotionState motionState, CollisionShape collisionShape) {
	this(mass, motionState, collisionShape, new Vector3f(0f, 0f, 0f));
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:4,代码来源:RigidBody.java

示例10: getMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public MotionState getMotionState() {
	return optionalMotionState;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:4,代码来源:RigidBody.java

示例11: setMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public void setMotionState(MotionState motionState) {
	this.optionalMotionState = motionState;
	if (optionalMotionState != null) {
		motionState.getWorldTransform(worldTransform);
	}
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:7,代码来源:RigidBody.java

示例12: Ground

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public Ground(Screen screen) {
    float size = 100000;
    ObjLoader loader = new ObjLoader();
    //loader.load("res/snow/snow_terrain.obj");
    Model groundModel = new Model();
    groundModel.useShader(ShaderProgram.textureShader);
    Mesh groundMesh = new Mesh();
    groundMesh.setTexture(new Texture("res/snow/CanadianArctic.jpg",GL11.GL_REPEAT));
    groundMesh.create(
            new float[]{
                -size, 0, -size, // down left
                -size, 0, size, // up left
                size, 0, -size, // down right
                size, 0, -size, // down right
                size, 0, size, // up right
                -size, 0, size // up left
            },
            null, null,
            new float[]{
                0, 0,// down left
                0, size/50,// up left
                size/50, 0,// down right
                size/50, 0,// down right
                size/50, size/50,// up right
                0, size/50,// up left
            },
            null
    );
    

    groundModel.addMesh(groundMesh);
    
    MotionState state2 = new DefaultMotionState(new Transform(MatrixConverter.convert(groundModel.getModel())));
    CollisionShape shape2 = new StaticPlaneShape(new Vector3f(0, 1, 0),1f);
    RigidBodyConstructionInfo info2 = new RigidBodyConstructionInfo(0f, state2, shape2);
    RigidBody body2 = new RigidBody(info2);
    body2.setFriction(0.3f);
    
    groundModel.body = body2;
    
    screen.addEntity(groundModel);

}
 
开发者ID:StavrosSkourtis,项目名称:SuperHornet,代码行数:44,代码来源:Ground.java

示例13: setMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public void setMotionState(MotionState motionState) {
	this.optionalMotionState = motionState;
	if (optionalMotionState != null) {
                   motionState.getWorldTransform(worldTransform);
	}
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:7,代码来源:RigidBody.java

示例14: createMotionState

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public static MotionState createMotionState(Vector3f position, Quaternion rotation) {
	return new DefaultMotionState(createTransform(position,rotation));
}
 
开发者ID:Axodoss,项目名称:Wicken,代码行数:4,代码来源:PhysicsSystem.java

示例15: createDefaultRBCI

import com.bulletphysics.linearmath.MotionState; //导入依赖的package包/类
public static RigidBodyConstructionInfo createDefaultRBCI(CollisionShape shape, float mass, Vector3f position, Quaternion rotation) {
	javax.vecmath.Vector3f inertia = new javax.vecmath.Vector3f(0,0,0);
       shape.calculateLocalInertia(mass, inertia);
       MotionState motionState = createMotionState(position,rotation);
       return new RigidBodyConstructionInfo(mass, motionState, shape, inertia);
}
 
开发者ID:Axodoss,项目名称:Wicken,代码行数:7,代码来源:PhysicsSystem.java


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