Package com.jme3.math

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


        // loading 'obmat' and inverting it makes us avoid errors in such cases
        Matrix4f invertedObjectOwnerGlobalMatrix = objectHelper.getMatrix(skeletonOwnerObjectStructure, "obmat", blenderContext.getBlenderKey().isFixUpAxis()).invertLocal();
        if (objectHelper.isParent(skeletonOwnerOma, armatureObjectOMA)) {
            boneMatrixInModelSpace = globalBoneMatrix.mult(invertedObjectOwnerGlobalMatrix);
        } else {
            boneMatrixInModelSpace = invertedObjectOwnerGlobalMatrix.mult(globalBoneMatrix);
        }

        Matrix4f boneLocalMatrix = parent == null ? boneMatrixInModelSpace : parent.boneMatrixInModelSpace.invert().multLocal(boneMatrixInModelSpace);

        Vector3f poseLocation = parent == null || !this.is(CONNECTED_TO_PARENT) ? boneLocalMatrix.toTranslationVector() : new Vector3f(0, parent.length, 0);
View Full Code Here


      // Velocity
      Vector3f currentVelocity = new Vector3f(vehicleControl.getLinearVelocity());
      Quaternion currentRotation = new Quaternion(vehicleControl.getPhysicsRotation());

      Vector3f targetVelocity = currentRotation.mult(new Vector3f(0f, 0f, targetSpeed));

      float xDiff = currentVelocity.x - targetVelocity.x;
      float zDiff = currentVelocity.z - targetVelocity.z;
      Vector3f diffVector = new Vector3f(xDiff, 0f, zDiff);
View Full Code Here

      xThrust = (hemisphereVector.x > 0) ? xThrust : xThrust;
      zThrust = (hemisphereVector.z > 0) ? zThrust : zThrust;

      Vector3f impulse = new Vector3f(xThrust, 0f, zThrust);

      vehicleControl.applyImpulse(currentRotation.mult(impulse), Vector3f.ZERO);

      // // Velocity

      // System.out.println(vehicleControl.getPhysicsRotation().mult(v));
      // System.out.println("tar: " + targetVelocity);
View Full Code Here

      Quaternion q = new Quaternion();//Quaternion.DIRECTION_Z;
      q.fromAngles(Rotation.x, Rotation.y, Rotation.z);
     
     
      q.mult(CurrentMovement, CurrentMovement);
     
      Position.addLocal(CurrentMovement.multLocal(MovementSpeed * tpf));
      Rotation.addLocal(CurrentRotation.multLocal(RotationSpeed * tpf));
     
      Camera.setLocation(Position);
 
View Full Code Here

     
      Position.addLocal(CurrentMovement.multLocal(MovementSpeed * tpf));
      Rotation.addLocal(CurrentRotation.multLocal(RotationSpeed * tpf));
     
      Camera.setLocation(Position);
      Camera.lookAt(q.mult(View).addLocal(Position), q.mult(Up));
     
      CurrentMovement.set(0,0,0);
      CurrentRotation.set(0,0,0);
    }
   
View Full Code Here

     
      Position.addLocal(CurrentMovement.multLocal(MovementSpeed * tpf));
      Rotation.addLocal(CurrentRotation.multLocal(RotationSpeed * tpf));
     
      Camera.setLocation(Position);
      Camera.lookAt(q.mult(View).addLocal(Position), q.mult(Up));
     
      CurrentMovement.set(0,0,0);
      CurrentRotation.set(0,0,0);
    }
   
View Full Code Here

    if(rotation == null)
      rotation = new Quaternion();
   
    //TODO: use angular velocity
    float rot = 0.01f * gameTime;
    obj.dataObject.setRotation(rotation.mult(new Quaternion(rot, rot, rot, 1)));

    return AIResult.Success;
    }

  }
View Full Code Here

  public void rotateEpsilon(float epsilon) {

    Quaternion quat = new Quaternion();
    // seems silly to make this over and over.
    quat.fromAngleAxis(epsilon, Vector3f.UNIT_Y);
    quat.mult(viewDirection, viewDirection);
    player.setViewDirection(viewDirection);
  }

  public void forwardEpsilon(float epsilon) {
View Full Code Here

      Distance = Math.abs(Distance);
      Distance = (Epsilon > Distance ? Epsilon : Distance);

      // this point needs adjustment
      Vector2f Normal = m_Side[SideNumber].getNormal();
      Normal = Normal.mult(Distance);
      TestPoint.x += Normal.x;
      TestPoint.y += Normal.y;
      return (true);
    }
    return (false);
View Full Code Here

    if (result.result == PATH_RESULT.EXITING_CELL) {
      Vector2f PathDirection = new Vector2f(result.intersection.x
          - m_CenterPoint.x, result.intersection.y - m_CenterPoint.z);

      PathDirection = PathDirection.mult(0.9f);

      TestPoint.x = m_CenterPoint.x + PathDirection.x;
      TestPoint.y = m_CenterPoint.z + PathDirection.y;
      return (true);
    } else if (result.result == PATH_RESULT.NO_RELATIONSHIP) {
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.