Examples of RigidBodyControl


Examples of com.jme3.bullet.control.RigidBodyControl

        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry g = new Geometry("b", b);
        BoxCollisionShape boxCollisionShape = new BoxCollisionShape(new Vector3f(1, 1, 1));
        g.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md" ));
        g.addControl(new RigidBodyControl(boxCollisionShape, 1));
        g.getControl(RigidBodyControl.class).setKinematic(true);
        bulletAppState.getPhysicsSpace().add(g);
        rootNode.attachChild(g);

        Geometry g1 = g.clone(false);
        g1.addControl(new RigidBodyControl(boxCollisionShape, 1));
        g1.getControl(RigidBodyControl.class).setKinematic(true);
        bulletAppState.getPhysicsSpace().add(g1);
        rootNode.attachChild(g1);

        bulletAppState.getPhysicsSpace().enableDebug(assetManager);
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

            collisionShapeMap.put(monkeyCollisionShape, monkeyCollisionShape.createCollisionShape());
        }
    }

    public PhysicsControl getPhysicsControl(MonkeyCollisionShape monkeyCollisionShape) {
        RigidBodyControl rigidBodyControl = new RigidBodyControl(collisionShapeMap.get(monkeyCollisionShape), 1);
        rigidBodyControl.setKinematic(true);
        return rigidBodyControl;
    }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    }

    @Override
    public void addPhysicsControl() {

        rigidBodyControl = new RigidBodyControl(0);
        spatial.addControl(rigidBodyControl);
        bulletAppState.getPhysicsSpace().add(spatial);
    }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

        // 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);


        // Load trees
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

        return createNewBoxCollisionShape();
    }

    @Override
    public void addPhysicsControl() {
        rigidBodyControl = new RigidBodyControl(getCollisionShape(), 0f);
        spatial.addControl(rigidBodyControl);
        bulletAppState.getPhysicsSpace().add(rigidBodyControl);
    }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    public AnimComponent getAnimComponent() {
        return animComponent;
    }

    protected void addPhysicsControl() {
        RigidBodyControl rigidBodyControl = new RigidBodyControl(getCollisionShape(), 1);
        rigidBodyControl.setKinematic(true);
        spatial.addControl(rigidBodyControl);
        bulletAppState.getPhysicsSpace().add(rigidBodyControl);
    }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    }

    @Override
    public void addPhysicsControl() {
        stopColliding = false;
        rigidBodyControl = new RigidBodyControl(1);
        rigidBodyControl.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_04);
        rigidBodyControl.setCollideWithGroups(PhysicsCollisionObject.COLLISION_GROUP_01 | PhysicsCollisionObject.COLLISION_GROUP_03);
        spatial.addControl(rigidBodyControl);
        bulletAppState.getPhysicsSpace().add(spatial);
    }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    float dimension = SECTION_LENGTH * numJoints * 2.3f;
    Box floorBox = new Box(dimension, .5f, dimension);
    Geometry floorGeometry = new Geometry("Floor", floorBox);
    floorGeometry.setMaterial(material);
    floorGeometry.setLocalTranslation(0, -1.0f * HEAD_RADIUS - .5f, 0);
    floorGeometry.addControl(new RigidBodyControl(0));
    localRootNode.attachChild(floorGeometry);

    pivots = new Node[numJoints];
    sections = new Geometry[numJoints];
    joints = new Geometry[numJoints];
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    Geometry floor_geo = new Geometry("Floor", floor);
    floor_geo.setMaterial(floor_mat);
    floor_geo.setLocalTranslation(0, -0.1f, 0);
    this.rootNode.attachChild(floor_geo);
    /* Make the floor physical with mass 0.0f! */
    floor_phy = new RigidBodyControl(0.0f);
    floor_geo.addControl(floor_phy);
    bulletAppState.getPhysicsSpace().add(floor_phy);
  }
View Full Code Here

Examples of com.jme3.bullet.control.RigidBodyControl

    brick_geo.setMaterial(wall_mat);
    rootNode.attachChild(brick_geo);
    /** Position the brick geometry */
    brick_geo.setLocalTranslation(loc);
    /** Make brick physical with a mass > 0.0f. */
    brick_phy = new RigidBodyControl(2f);
    /** Add physical brick to physics space. */
    brick_geo.addControl(brick_phy);
    bulletAppState.getPhysicsSpace().add(brick_phy);
  }
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.