Examples of MeshCollisionShape


Examples of com.jme3.bullet.collision.shapes.MeshCollisionShape

        rootNode.attachChild(island);

        // Load Island CollisionMesh
        Node islandCollision = (Node) assetManager.loadModel("Models/Islands/ogre/island_01_collision.j3o");
        Geometry geoCollision = (Geometry) islandCollision.getChild(0);
        CollisionShape colShape = new MeshCollisionShape(geoCollision.getMesh());
        colShape.setMargin(0.005f);
        RigidBodyControl rigControl = new RigidBodyControl(colShape, 0);
        island.addControl(rigControl);
        bulletAppState.getPhysicsSpace().add(rigControl);

View Full Code Here

Examples of com.jme3.bullet.collision.shapes.MeshCollisionShape

    // immovable sphere with mesh collision shape
    Sphere sphere = new Sphere(8, 8, 1);
    Geometry sphereGeometry = new Geometry("Sphere", sphere);
    sphereGeometry.setMaterial(material);
    sphereGeometry.setLocalTranslation(4, -4, 2);
    sphereGeometry.addControl(new RigidBodyControl(new MeshCollisionShape(sphere), 0));
    rootNode.attachChild(sphereGeometry);
    space.add(sphereGeometry);

  }
View Full Code Here

Examples of com.jme3.bullet.collision.shapes.MeshCollisionShape

    // immovable Box with mesh collision shape
    Box box = new Box(1, 1, 1);
    Geometry boxGeometry = new Geometry("Box", box);
    boxGeometry.setMaterial(material);
    boxGeometry.setLocalTranslation(4, 1, 2);
    boxGeometry.addControl(new RigidBodyControl(new MeshCollisionShape(box), 0));
    rootNode.attachChild(boxGeometry);
    space.add(boxGeometry);

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.