Package com.jme.math

Examples of com.jme.math.Vector3f


                    return Vector3f.class;
    }

    @Override
    public Vector3f interpolate(Vector3f from, Vector3f to, float timelinePosition) {
                    return new Vector3f(from.x + (timelinePosition * (to.x - from.x)),
                            from.y + (timelinePosition * (to.y - from.y)),
                            from.z + (timelinePosition * (to.z - from.z)));
    }
View Full Code Here


    }

    private void processClient3DRequest(Client3DRequest request) {
        switch (request.getAction()) {
            case WALK:
                userSim.walkLoop(request.getDesiredLocations(), new Vector3f(1f, 0f, 0f), request.getSpeed(), request.getLoopCount());
                break;
            default:
                Logger.getAnonymousLogger().severe("Unsupported Client3DRequest " + request.getAction());
        }
    }
View Full Code Here

        private PJoint attachJoint;

        public PickBox(String jointName, float x, float y, float z,
                       float xSize, float ySize, float zSize)
        {
            super ("Pick Box", new Vector3f(x, y, z), xSize, ySize, zSize);

            this.jointName = jointName;

            setModelBound(new BoundingBox(new Vector3f(x, y, z),
                                          xSize, ySize, zSize));
            setCullHint(CullHint.Always);
        }
View Full Code Here

            locationIndex = 0;
            desiredLocations = locations;
            desiredLoopCount = loopCount;
            currentLoopCount = 0;

            step = new Vector3f(desiredLocations[0]);
            step.subtractLocal(currentLocation);
            step.multLocal(speed / (1000f / sleepTime));

            walking = true;
            semaphore.release();
View Full Code Here

  }

        // Fetch the destination location from the server state. If the value
        // is null, then set the original values and text fields to empty
        // strings.
        Vector3f origin = state.getLocation();
        if (origin != null) {
            origX = origin.x;
            origY = origin.y;
            origZ = origin.z;
        } else {
            origX = 0;
            origY = 0;
            origZ = 0;
        }

        backgroundColor = state.getBackgroundColor();
        textColor = state.getTextColor();
        imageURL = state.getImageURL();
        message = state.getMessage();
       
        // Fetc the destination look direction from the server state. If the
        // value is null, then set the original value and text field to an
        // empty string.
        Quaternion lookAt = state.getLook();
        if (lookAt != null) {
            float lookDirection = (float) Math.toDegrees(lookAt.toAngleAxis(new Vector3f()));
            origLookDirection = lookDirection;
        } else {
            origLookDirection = 0;
        }
View Full Code Here

        // converted to null to set in the server state.

        state.setServerURL(origServerURL);

        // Set the location on the server state
        state.setLocation(new Vector3f(origX, origY, origZ));

        // Set the destination look direction from the text field. If the text
        // field is empty, then set the server state as a zero rotation.
        Quaternion look = new Quaternion();
        Vector3f axis = new Vector3f(0.0f, 1.0f, 0.0f);
        float angle = (float) Math.toRadians(origLookDirection);
  look.fromAngleAxis((float) angle, axis);
        state.setLook(look);

  state.setAudioSourceType(origAudioSourceType);
View Full Code Here

         */
        //Vector3f axis = new Vector3f((float) 1, (float) 0, (float) 0);
        //cellServerState.setRotation(new Rotation(axis, (float) Math.PI / 4));

  BoundingBox box = new BoundingBox(
      new Vector3f(0, 0, 0), 0.27053905F, 0.060000006F, 0.27053908F);

  BoundingVolumeHint hint = new BoundingVolumeHint(true, box);
  cellServerState.setBoundingVolumeHint(hint);
 
        Logger.getLogger(PhoneCellFactory.class.getName()).warning(
View Full Code Here

        // TODO add Float editors to the spinners

        userMotionListener = new TransformChangeListener() {

            private Vector3f look = new Vector3f();
            private Vector3f pos = new Vector3f();

            public void transformChanged(Cell cell, ChangeSource source) {
                CellTransform t = cell.getWorldTransform();
                t.getLookAt(pos, look);

                look.mult(3);
                pos.addLocal(look);

                currentTranslation.set(pos);
                ((SpinnerNumberModel) translationXTF.getModel()).setValue(
                        new Float(pos.x));
                ((SpinnerNumberModel) translationYTF.getModel()).setValue(
View Full Code Here

     * Set the spinners to the rotation, translation and scale local coords of
     * this node
     * @param node
     */
    private void setSpinners(Node modelBG, Node rootBG) {
        Vector3f translation = rootBG.getLocalTranslation();
        Quaternion quat = modelBG.getLocalRotation();
        float[] angles = quat.toAngles(new float[3]);
        Vector3f scale = modelBG.getLocalScale();

        translationXTF.setValue(translation.x);
        translationYTF.setValue(translation.y);
        translationZTF.setValue(translation.z);

        rotationXTF.setValue((float) Math.toDegrees(angles[0]));
        rotationYTF.setValue((float) Math.toDegrees(angles[1]));
        rotationZTF.setValue((float) Math.toDegrees(angles[2]));

        scaleTF.setValue(scale.x);

        importedModel.setTranslation(translation);
        importedModel.setOrientation(new Vector3f(
                (float) Math.toDegrees(angles[0]),
                (float) Math.toDegrees(angles[1]),
                (float) Math.toDegrees(angles[2])));
        importedModel.setScale(new Vector3f(scale.x, scale.x, scale.x));
    }
View Full Code Here

            ViewManager viewManager = ViewManager.getViewManager();
            ViewCell viewCell = viewManager.getPrimaryViewCell();
            viewCell.removeTransformChangeListener(userMotionListener);
        }
        setVisible(false);
        Vector3f translation = new Vector3f((Float) translationXTF.getValue(),
                (Float) translationYTF.getValue(),
                (Float) translationZTF.getValue());
        Vector3f orientation = new Vector3f((Float) rotationXTF.getValue(),
                (Float) rotationYTF.getValue(),
                (Float) rotationZTF.getValue());

        importedModel.setWonderlandName(modelNameTF.getText());
//        importedModel.setTexturePrefix(texturePrefixTF.getText());
View Full Code Here

TOP

Related Classes of com.jme.math.Vector3f

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.