Package com.jme.bounding

Examples of com.jme.bounding.BoundingSphere


    public OrbCellMO(Vector3f center, float size, String username,
      String callID, boolean simulateCalls, VirtualPlayer vp,
      String[] bystanders) {

  super(new BoundingSphere(size, center), new CellTransform(null, center));

  this.username = username;
        this.callID = callID;
        this.simulateCalls = simulateCalls;
  this.vp = vp;
View Full Code Here


    }

    private void attachInnerOrb(Entity entity) {
        innerOrbNode = new Node("Inner orb node");
        innerOrb = new Sphere("Inner Orb", 8, 8, INNER_RADIUS);
        innerOrb.setModelBound(new BoundingSphere());
        innerOrb.updateModelBound();
        innerOrb.setRenderState(DEFAULT_MATERIALSTATE);
        innerOrb.setRenderState(DEFAULT_SHADESTATE);

        innerOrbNode.attachChild(innerOrb);
View Full Code Here

        orbNode.attachChild(innerOrbNode);
    }

    private void attachOuterOrb(Entity entity) {
        final Sphere outerOrb = new Sphere("Outer Orb", 16, 16, OUTER_RADIUS);
        outerOrb.setModelBound(new BoundingSphere());
        outerOrb.updateModelBound();
        ColorRGBA orbColour = new ColorRGBA(0f, 0f, 1f, 0.2f);
        MaterialState matState = (MaterialState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Material);
        matState.setDiffuse(orbColour);
        outerOrb.setRenderState(matState);
View Full Code Here

    public PlayerSphere(String name, ColorRGBA color, Vector3f pos) {
      super(name, 15, 15, 1); //the 15s tell us how many triangles to use and the 1 is the radius
      this.color = color; //save the color for use later
     
      setLocalTranslation(pos); //move the sphere to the location provided.
      setModelBound(new BoundingSphere()); //create a bounding sphere for the sphere
      updateModelBound(); //automatically resize the bounding sphere
     
      MaterialState material = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState(); //use a factory method to generate a new material
      material.setDiffuse(color); //set it's diffuse color (when light hits it) to red
      //material.setEmissive(color); //set it's emmissive color (light it gives off) to red
View Full Code Here

                clodNode.attachChild(getClodNodeFromParent((Node)child));
            }
            else if ( child instanceof TriMesh ) {
                // Create an AreaClodMesh for that mesh.  Let it compute records automatically
                AreaClodMesh acm = new AreaClodMesh("part"+i,(TriMesh)child, null);
                acm.setModelBound(new BoundingSphere());
                acm.updateModelBound();

                // Allow 1/2 of a triangle in every pixel on the screen in the bounds.
                acm.setTrisPerPixel(.5f);
View Full Code Here

            shader.apply();

            sphere.setRenderState(shader);
        }

        sphere.setModelBound(new BoundingSphere());
        sphere.updateModelBound();
        sphere.updateRenderState();

        rootNode.attachChild(sphere);
    }
View Full Code Here

    private CellTransform generateGoToPosition(CellID cellID) {

        CellTransform viewTransform = model.getCellTransformForCellID(cellID);
       
        ServerSessionManager manager = LoginManager.getPrimary();
        BoundingVolume boundsHint = new BoundingSphere(1.0f, Vector3f.ZERO);
            CellTransform generated = CellPlacementUtils.getCellTransform(manager, boundsHint,
                    viewTransform);
        LOGGER.fine("ORIGINAL:\n" + logTransform(viewTransform) + "\n"
                + "GENERATED:\n" + logTransform(generated));
View Full Code Here

        // Attach the name tag to the new avatar and add the avatar entity to
        // the cell renderer root entity and turn on input.
        Node externalRoot = avatarCharacter.getJScene().getExternalKidsRoot();
        if (nameTagNode!=null) {
            externalRoot.attachChild(nameTagNode);
            externalRoot.setModelBound(new BoundingSphere());
            externalRoot.updateModelBound();
            externalRoot.updateGeometricState(0, true);
        }
        rootEntity.addEntity(avatarCharacter);

        // Turn on input handle for the renderer, if we wish. Check for AvatarCell
        // to allow NPC's to work
        if (cell instanceof AvatarCell) {
            selectForInput(((AvatarCell) cell).isSelectedForInput());
        }

        // Notify listeners that the avatar has changed.
        for (WeakReference<AvatarChangedListener> listenerRef : avatarChangedListeners) {
            AvatarChangedListener listener = listenerRef.get();
            if (listener != null) {
                listener.avatarChanged(avatarCharacter);
            }
            else {
                avatarChangedListeners.remove(listenerRef);
            }
        }

        // update the bounds if necessary
        if (avatarCharacter.getJScene() != null) {
            avatarCharacter.getPScene().submitTransformsAndGeometry(true);
            avatarCharacter.getJScene().setModelBound(new BoundingSphere());
            avatarCharacter.getJScene().updateModelBound();
            avatarCharacter.getJScene().updateWorldBound();
        }

        // Update pick geometry
View Full Code Here

                boundingVolume[0] = new BoundingBox(new Vector3f(), bounds.getX(),
        bounds.getY(), bounds.getZ());
    logger.warning("COS Using specified BOX:  " + boundingVolume[0]);
    System.out.println("COS Using specified BOX:  " + boundingVolume[0]);
      } else {
                boundingVolume[0] = new BoundingSphere(bounds.getX(), new Vector3f());
    logger.warning("COS Using specified radius:  " + boundingVolume[0]);
    System.out.println("COS Using specified radius:  " + boundingVolume[0]);
      }

            ConeOfSilenceProximityListener proximityListener =
View Full Code Here

  boundsViewerEntity = new BoundsViewerEntity(editor.getCell());

  if (useCellBoundsRadioButton.isSelected()) {
      boundsViewerEntity.showBounds(editor.getCell().getLocalBounds());
  } else if (specifyRadiusRadioButton.isSelected()) {
      boundsViewerEntity.showBounds(new BoundingSphere(
    (Float) fullVolumeRadiusModel.getValue(), new Vector3f()));
  } else {
      boundsViewerEntity.showBounds(new BoundingBox(new Vector3f(),
    (Float) xExtentModel.getValue(),
    (Float) yExtentModel.getValue(),
View Full Code Here

TOP

Related Classes of com.jme.bounding.BoundingSphere

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.