Package com.jme3.bullet.collision.shapes

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


        animComponent = new AnimComponent(spatial);
    }

    @Override
    public CollisionShape getCollisionShape() {
        return new SphereCollisionShape(getExtents().z);
    }
View Full Code Here


    protected CollisionShape createNewMeshCollisionShape() {
        return CollisionShapeFactory.createMeshShape(spatial);
    }

    protected CollisionShape createNewSphereCollisionShape() {
        return new SphereCollisionShape(getExtents().x);
    }
View Full Code Here

    @Override
    public void setSpatial(Spatial spatial) {
        super.setSpatial(spatial);

        if (spatial != null) {
            losGhost = new GhostControl(new SphereCollisionShape(losRadius));
            attackGhost = new GhostControl(new SphereCollisionShape(fightRadius));
            addGhost(losGhost);
            addGhost(attackGhost);
            fireInit();
        }
    }
View Full Code Here

        }
        if (spatial instanceof Geometry) {
            Geometry geom = (Geometry) spatial;
            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;
            }
View Full Code Here

    // Create a appropriate physical shape for it
    // spheres both calculate collision MUCH faster, and also much more intelligently.
    // The capsule clipping problem is going to be intrinsic to any object model which isn't using forces to adjust it's position smoothly.

    SphereCollisionShape sphereShape = new SphereCollisionShape(PLAYER_RADIUS);
    CharacterControl player = new CharacterControl(sphereShape, 2f);
    // Attach physical properties to model and PhysicsSpace
    playerNode.addControl(player);
    physicsSpace.add(player);
View Full Code Here

    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);
    Node hammerNode = PhysicsTestHelper.createPhysicsTestNode(assetManager, new SphereCollisionShape(.3f), 1);
    hammerNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f, -1, 0f));
    rootNode.attachChild(hammerNode);
    getPhysicsSpace().add(hammerNode);

    joint = new HingeJoint(holderNode.getControl(RigidBodyControl.class), hammerNode.getControl(RigidBodyControl.class), Vector3f.ZERO, new Vector3f(0f, -1, 0f), Vector3f.UNIT_Z, Vector3f.UNIT_Z);
View Full Code Here

    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    bulletAppState.getPhysicsSpace().enableDebug(assetManager);
    bullet = new Sphere(32, 32, 0.4f, true, false);
    bullet.setTextureMode(TextureMode.Projected);
    bulletCollisionShape = new SphereCollisionShape(0.4f);

    PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace());
    PhysicsTestHelper.createBallShooter(this, rootNode, bulletAppState.getPhysicsSpace());

    // add ourselves as collision listener
View Full Code Here

    entities.add(entity);
    mapNode.attachChild(entity);
  }
 
  public CollisionResults getCollisions(Ray ray) {
    CollisionResults results = new CollisionResults();
    mapNode.collideWith(ray, results);
    return results;
  }
View Full Code Here

        flame.setSelectRandomImage(true);
        flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, 1f));
        flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
        flame.setStartSize(1.3f);
        flame.setEndSize(2f);
        flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
        flame.setParticlesPerSec(0);
        flame.setGravity(-5f);
        flame.setLowLife(1f);
        flame.setHighLife(1f);
        flame.setInitialVelocity(new Vector3f(0, 7, 0));
View Full Code Here

  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    tuioInput = TuioInput.get();
    tuioInput.addListener(this);
    BitmapFont guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
   
    BitmapText tuioStatsLabel = new BitmapText(guiFont, false);
        tuioStatsLabel.setLocalTranslation(0, tuioStatsLabel.getLineHeight()*3, 0);
        tuioStatsLabel.setText("Tuio Input:");
        tuioStatsNode.attachChild(tuioStatsLabel);
View Full Code Here

TOP

Related Classes of com.jme3.bullet.collision.shapes.SphereCollisionShape

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.