Examples of BoxCollisionShape


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

        bulletAppState = new BulletAppState();
        stateManager.attach(bulletAppState);

        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);
View Full Code Here

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

    public Spatial getSpatial() {
        return spatial;
    }

    protected CollisionShape createNewBoxCollisionShape() {
        return new BoxCollisionShape(getExtents());
    }
View Full Code Here

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

            Mesh mesh = geom.getMesh();
            if (mesh instanceof Sphere) {
                collisionShape = new SphereCollisionShape(((Sphere) mesh).getRadius());
                return;
            } else if (mesh instanceof Box) {
                collisionShape = new BoxCollisionShape(new Vector3f(((Box) mesh).getXExtent(), ((Box) mesh).getYExtent(), ((Box) mesh).getZExtent()));
                return;
            }
        }
        if (mass > 0) {
            collisionShape = CollisionShapeFactory.createDynamicMeshShape(spatial);
View Full Code Here

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

    /**
     * contruct a KinematicRagdollControl
     */
    public KinematicRagdollControl() {
        baseRigidBody = new PhysicsRigidBody(new BoxCollisionShape(Vector3f.UNIT_XYZ.mult(0.1f)), 1);
        baseRigidBody.setKinematic(mode == Mode.Kinematic);
    }
View Full Code Here

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

    public void write(JmeExporter ex) throws IOException {
        OutputCapsule capsule = ex.getCapsule(this);
        capsule.write(location, "location", new Vector3f());
        capsule.write(rotation, "rotation", new Matrix3f());
        capsule.write(shape, "shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
    }
View Full Code Here

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

    public void read(JmeImporter im) throws IOException {
        InputCapsule capsule = im.getCapsule(this);
        location = (Vector3f) capsule.readSavable("location", new Vector3f());
        rotation = (Matrix3f) capsule.readSavable("rotation", new Matrix3f());
        shape = (CollisionShape) capsule.readSavable("shape", new BoxCollisionShape(new Vector3f(1, 1, 1)));
    }
View Full Code Here

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

    inputManager.addListener(this, "Left", "Right", "Swing");
  }

  public void setupJoint() {

    Node holderNode = PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f(.1f, .1f, .1f)), 0);
    holderNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f, 0, 0f));
    rootNode.attachChild(holderNode);
    getPhysicsSpace().add(holderNode);

    // Node hammerNode = PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f(.3f, .3f, .3f)), 1);
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.