Package com.jme3.math

Examples of com.jme3.math.Matrix4f.multLocal()


                }
                break;
            case LIMITDIST_ONSURFACE:
                if (currentDistance > dist) {
                    v.normalizeLocal();
                    v.multLocal(dist + (currentDistance - dist) * (1.0f - influence));
                    ownerTransform.getTranslation().set(v.addLocal(targetTransform.getTranslation()));
                } else if (currentDistance < dist) {
                    v.normalizeLocal().multLocal(dist * influence);
                    ownerTransform.getTranslation().set(targetTransform.getTranslation().add(v));
                }
View Full Code Here


            center.divideLocal(8f);

            Vector3f cDir = new Vector3f();
            for (int i = 0; i < 8; i++) {
                cDir.set(points[i]).subtractLocal(center);
                cDir.multLocal(scale - 1.0f);
                points[i].addLocal(cDir);
            }
        }
    }
View Full Code Here

        int vertexCount = input.capacity() / 3;
        for (int i = 0; i < vertexCount; i++){
            BufferUtils.populateFromBuffer(temp, input, i);

            // offset and scale vector into -128 ... 127
            temp.multLocal(127).addLocal(0.5f, 0.5f, 0.5f);

            // quantize
            byte v1 = (byte) temp.getX();
            byte v2 = (byte) temp.getY();
            byte v3 = (byte) temp.getZ();
View Full Code Here

        if (output.capacity() < input.capacity())
            throw new RuntimeException("Output must be at least as large as input!");

        Vector3f offset = bbox.getCenter().negate();
        Vector3f size = new Vector3f(bbox.getXExtent(), bbox.getYExtent(), bbox.getZExtent());
        size.multLocal(2);

        ShortBuffer sb = null;
        ByteBuffer bb = null;
        float dataTypeSize;
        float dataTypeOffset;
View Full Code Here

        for (int i = 0; i < vertexCount; i++){
            BufferUtils.populateFromBuffer(temp, input, i);

            // offset and scale vector into -32768 ... 32767
            // or into -128 ... 127 if using bytes
            temp.multLocal(scale);
            temp.addLocal(offset);

            // quantize and store
            if (sb != null){
                short v1 = (short) temp.getX();
View Full Code Here

            int index = i * 2;
           
            setInBuffer(origin, lineVertex, index);
            setInBuffer(originColor, lineColor, index);
           
            point.multLocal(scale);
            point.addLocal(origin);
            setInBuffer(point, lineVertex, index + 1);
            setInBuffer(normalColor, lineColor, index + 1);
        }
       
View Full Code Here

    cam.setFrustumBottom(-h);
    cam.setFrustumLeft(-w);
    cam.setFrustumRight(w);
   
    Vector3f pos = cam.getLocation().clone();
    pos.multLocal(0f, zoomed ? 0.1f : -0.1f, 0f);
    cam.setLocation(pos);
    zoomed = !zoomed;
  }

  public void showElement(String element) {
View Full Code Here

        if(i.jump) {
            main.playerc.jump();
            i.jump=false;
        }
        main.player.getChild("body").rotateUpTo(new Vector3f(0, 0, camDir.z));
        walkDirection=walkDirection.multLocal(3);
        main.playerc.setWalkDirection(walkDirection);
        main.player.getChild("body").setLocalTranslation(main.playerc.getPhysicsLocation());
        main.player.getChild("body").setLocalRotation(this.getCamera().getRotation());
        this.getCamera().setLocation(main.playerc.getPhysicsLocation());
    }
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.