Package com.jme3.math

Examples of com.jme3.math.Matrix3f


    @Override
    public void read(JmeImporter im) throws IOException {
        super.read(im);
        InputCapsule capsule = im.getCapsule(this);
        this.rotA = (Matrix3f) capsule.readSavable("rotA", new Matrix3f());
        this.rotB = (Matrix3f) capsule.readSavable("rotB", new Matrix3f());

        this.angularOnly = capsule.readBoolean("angularOnly", false);
        this.swingSpan1 = capsule.readFloat("swingSpan1", 1e30f);
        this.swingSpan2 = capsule.readFloat("swingSpan2", 1e30f);
        this.twistSpan = capsule.readFloat("twistSpan", 1e30f);
View Full Code Here


            // send attenuation params
            this.getMaterial().setFloat("Quadratic", C);
        }

        Matrix3f inverseRotation = Matrix3f.IDENTITY;
        TempVars vars = null;
        if (!worldSpace) {
            vars = TempVars.get();

            inverseRotation = this.getWorldRotation().toRotationMatrix(vars.tempMat3).invertLocal();
View Full Code Here

    public void addChildShape(CollisionShape shape, Vector3f location) {
//        Transform transA = new Transform(Converter.convert(new Matrix3f()));
//        Converter.convert(location, transA.origin);
//        children.add(new ChildCollisionShape(location.clone(), new Matrix3f(), shape));
//        ((CompoundShape) objectId).addChildShape(transA, shape.getObjectId());
        addChildShape(shape, location, new Matrix3f());
    }
View Full Code Here

    }

    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

    }

    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

    hector.getHeadNode().attachChild(camNode);

    // aureus: temporary solution; scout should ultimately be a separate object
    scoutNode = new Node();
    scoutNode.setLocalTranslation(new Vector3f(0.0f, 3.0f, -10.0f));
    Matrix3f scoutMatrix = new Matrix3f();
    scoutMatrix.fromAngleAxis((float)Math.atan2(3.0f, 10.0f), Vector3f.UNIT_X);
    scoutNode.setLocalRotation(scoutMatrix);
    hector.getLegsNode().attachChild(scoutNode);

    player.setPhysicsLocation(incarn.getLocation());
View Full Code Here

  public void update(float tpf) {
    // float crouchOffset = jumpCrouching ? Math.min(((jumpCrouchTime / MAX_JUMP_TIME) * 0.25f),
    // 0.25f) : 0.0f;

    Matrix3f bodyRot = new Matrix3f();
    bodyRot.fromAngleNormalAxis(walkAngle * FastMath.DEG_TO_RAD, Vector3f.UNIT_Y);
    Vector3f bodyDir = bodyRot.mult(Vector3f.UNIT_Z.negate()).normalizeLocal();

    if (walking) {
      lastWalkDir = bodyDir.mult(walkMult * 2.0f);
      player.setWalkDirection(lastWalkDir);
      // set animation channels
View Full Code Here

  public void startDemoMotion(Ship ship) {
    motionPath = new ShipDemoMotion();
    motionTrack = new ShipMotionTrack(ship, motionPath);
    //motionTrack.setDirectionType(Direction.Path);
    motionTrack.setDirectionType(Direction.PathAndRotation);
    motionTrack.setRotation(new Quaternion().fromAngles(0, 0, 0));
    motionTrack.setSpeed(0.5f);
    motionTrack.setLoopMode(LoopMode.Loop);
    motionTrack.pause();
    timeLeft = 10;
  }
View Full Code Here

            }
        }

        newUp.set(newDirection).crossLocal(newLeft).normalizeLocal();
       
    Quaternion r = new Quaternion().fromAxes(newLeft, newUp, newDirection);
    r.normalize();
    this.setLocalRotation(r);   
  }
View Full Code Here

    ti.onNew(0, 0, 0);
    gestureSystem.update(1);
    ti.onRelease(0);
    gestureSystem.update(1);
    //printList(clickVectors);
    Assert.assertTrue(clickVectors.get(0).equals(new Vector2f(0,0)));
    Assert.assertTrue(zoomValues.isEmpty());
  }
View Full Code Here

TOP

Related Classes of com.jme3.math.Matrix3f

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.