Package com.bulletphysics.collision.shapes

Examples of com.bulletphysics.collision.shapes.CollisionShape


  @Override
  public DemoEnvironment3D1[] generateRunnables(ParCollection params) {
   
    DemoEnvironment3D1 env = new DemoEnvironment3D1 (0, params);   
   
    CollisionShape box1 = new BoxShape(new Vector3f(1f,1f,1f));
    CollisionShape box2 = new BoxShape(new Vector3f (50f, 50f, 50f));
   
    env.getCollisionShapes().add(box1);
    env.getCollisionShapes().add(box2);
   
   
View Full Code Here


 
  @Override
    public DemoEnvironment3Dv3[] generateRunnables(ParCollection params) {
    DemoEnvironment3Dv3 env = new DemoEnvironment3Dv3(0, params);
   
    CollisionShape ground = new BoxShape(new Vector3f (100f, 1f, 100f));
    CollisionShape sphere = new SphereShape(1f);
    CollisionShape bigSphere = new SphereShape(5f);
   
    env.getCollisionShapes().add(ground);
    env.getCollisionShapes().add(sphere);
    env.getCollisionShapes().add(bigSphere);
   
View Full Code Here

    @Override
    public Env3D[] generateRunnables(ParCollection params) {

        Env3D env = new Env3D(0, params);

        CollisionShape box2 = new BoxShape(new Vector3f(100f, 10f, 100f));
        env.getCollisionShapes().add(box2);
        CollisionShape box3 = new BoxShape(new Vector3f(30f, 30f, 5f));
        env.getCollisionShapes().add(box2);
        CollisionShape box4 = new BoxShape(new Vector3f(30f, 30f, 5f));
        env.getCollisionShapes().add(box2);
        CollisionShape box5 = new BoxShape(new Vector3f(5f, 30f, 30f));
        env.getCollisionShapes().add(box2);
        CollisionShape box6 = new BoxShape(new Vector3f(5f, 30f, 30f));
        env.getCollisionShapes().add(box2);
        env.addAgent(new Agent3D(0, env, box2, new Vector3f(0f, -51f, 0f), 0f));
        env.addAgent(new Agent3D(1, env, box3, new Vector3f(0f, 0f, 45f), 0f));
        env.addAgent(new Agent3D(2, env, box4, new Vector3f(0f, 0f, -45f), 0f));
        env.addAgent(new Agent3D(3, env, box5, new Vector3f(45f, 0f, 0f), 0f));
View Full Code Here

        super.runDuringSimulation(env, simZyk, params);
       
        // Add dynamic agents (mass != 0).
        if (rand.nextDouble() < 1 && i < 1000) {
            float kantenLaenge = 1 + ((float) (i)) / 50 + (float) rand.nextGaussian();
            CollisionShape box1;
            if (rand.nextDouble() < 0.9) {
                box1 = new BoxShape(new Vector3f(kantenLaenge, kantenLaenge, kantenLaenge));
            } else {
                box1 = new SphereShape(kantenLaenge);
            }
View Full Code Here

    }

    public void addFloor(Box floor) {
        float mass = 0f; // make it static
        // create the CollisionShape
        CollisionShape groundShape = new BoxShape(new Vector3f((float) floor.getXExtent(), (float) floor.getYExtent(), (float) floor.getZExtent()));
        // set initial transform based on floor
        Transform groundTransform = new Transform();
        groundTransform.setIdentity();
        groundTransform.origin.set(new Vector3f(floor.getTranslation().getXf(), floor.getTranslation().getYf(), floor.getTranslation().getZf()));
        Vector3f localInertia = new Vector3f(0, 0, 0);
View Full Code Here

    int i = pairset.size();
    while ((i--) != 0) {
      Pair pair = pairset.get(i);
      triface0 = pair.index1;
      triface1 = pair.index2;
      CollisionShape colshape0 = retriever0.getChildShape(triface0);
      CollisionShape colshape1 = retriever1.getChildShape(triface1);

      if (child_has_transform0) {
        tmpTrans.mul(orgtrans0, shape0.getChildTransform(triface0));
        body0.setWorldTransform(tmpTrans);
      }
View Full Code Here

        triface1 = child_index;
      }
      else {
        triface0 = child_index;
      }
      CollisionShape colshape0 = retriever0.getChildShape(child_index);

      if (child_has_transform0) {
        tmpTrans.mul(orgtrans0, shape0.getChildTransform(child_index));
        body0.setWorldTransform(tmpTrans);
      }
View Full Code Here

    Transform childtrans1 = Stack.alloc(Transform.class);
    Transform tmpTrans = Stack.alloc(Transform.class);

    int i = shape1.getNumChildShapes();
    while ((i--) != 0) {
      CollisionShape colshape1 = shape1.getChildShape(i);
      childtrans1.mul(orgtrans1, shape1.getChildTransform(i, tmpTrans));

      body1.setWorldTransform(childtrans1);

      // collide child shape
View Full Code Here

    shape0.unlockChildShapes();
    shape1.unlockChildShapes();
  }

  protected void shape_vs_shape_collision(CollisionObject body0, CollisionObject body1, CollisionShape shape0, CollisionShape shape1) {
    CollisionShape tmpShape0 = body0.getCollisionShape();
    CollisionShape tmpShape1 = body1.getCollisionShape();

    body0.internalSetTemporaryCollisionShape(shape0);
    body1.internalSetTemporaryCollisionShape(shape1);

    {
View Full Code Here

    body0.internalSetTemporaryCollisionShape(tmpShape0);
    body1.internalSetTemporaryCollisionShape(tmpShape1);
  }
 
  protected void convex_vs_convex_collision(CollisionObject body0, CollisionObject body1, CollisionShape shape0, CollisionShape shape1) {
    CollisionShape tmpShape0 = body0.getCollisionShape();
    CollisionShape tmpShape1 = body1.getCollisionShape();

    body0.internalSetTemporaryCollisionShape(shape0);
    body1.internalSetTemporaryCollisionShape(shape1);

    resultOut.setShapeIdentifiers(part0, triface0, part1, triface1);
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.shapes.CollisionShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.