Examples of normalise()


Examples of org.apache.stanbol.entityhub.indexing.core.normaliser.ScoreNormaliser.normalise()

            assertTrue(entity.id.startsWith("http://dbpedia.org/resource/"));
            float score = entity.score.floatValue();
            assertTrue(score > 0);
            assertTrue(score <=lastScore);
            lastScore = score;
            Float normalisedScore = normaliser.normalise(entity.score);
            assertNotNull(normalisedScore);
            float nScore = normalisedScore.floatValue();
            assertTrue(nScore <= lastNormalisedScore);
            if(score < 2){ //the value of "min-score" in minincoming
                log.info("score="+score+" nScore="+nScore);
View Full Code Here

Examples of org.jtester.module.database.environment.normalise.TypeNormaliser.normalise()

    if (currVal == null) {
      return null;
    }
    TypeNormaliser tn = TypeNormaliserFactory.getNormaliser(currVal.getClass());
    if (tn != null) {
      currVal = tn.normalise(currVal);
    }
    return currVal;
  }

  public DbParameterAccessor(DbParameterAccessor acc) {
View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

  protected void reflectAtBall(Ball ball, Vector2f fixedBallPosition) {
    // let n be the vector connecting the balls (n is orthogonal to
    // reflection line)
    Vector2f n = new Vector2f();
    Vector2f.sub(fixedBallPosition, ball.getPosition(), n);
    n.normalise();

    // project velocity onto n and scale by 2
    n.scale(2.0f * Vector2f.dot(ball.getVelocity(), n));
    Vector2f newVel = new Vector2f();

View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

      float m1 = ball.getMass();
      float m2 = ball2.getMass();

      Vector2f n = new Vector2f();
      Vector2f.sub(ball2.getPosition(), ball.getPosition(), n);
      n.normalise();
      Vector2f t = new Vector2f(n.y, -n.x);

      float v1_n = Vector2f.dot(v1, n);
      float v2_n = Vector2f.dot(v2, n);
      float v1_t = Vector2f.dot(v1, t);
View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

        float m1 = paddle.getMass();
        float m2 = ball.getMass();

        Vector2f n = new Vector2f();
        Vector2f.sub(ball.getPosition(), paddle.getHemispherePosition(hemispherePlace), n);
        n.normalise();
        Vector2f t = new Vector2f(n.y, -n.x);

        float v1_n = Vector2f.dot(v1, n);
        float v2_n = Vector2f.dot(v2, n);
        float v2_t = Vector2f.dot(v2, t);
View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

    // place ball at a small distance from paddle
    Vector2f paddlePos = paddleAttached.getPosition();
    Vector2f dir = new Vector2f();
    paddlePos.negate(dir);
    dir.normalise();
    dir.scale(1.5f * radius + 1.5f * paddleAttached.getRadius());
    Vector2f.add(paddlePos, dir, dir);
    setPosition(dir);
  }

View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

  public void serve() {
    if (attached) {
      // add random velocity away from paddle
      Vector2f away = new Vector2f();
      Vector2f.sub(getPosition(), lastPaddle.getPosition(), away);
      away.normalise();
      Vector2f.add(away, new Vector2f((float) Math.random() - 0.5f, (float) Math.random() - 0.5f), away);
      away.normalise();
      away.scale(INITIAL_SPEED);

      Vector2f v = getVelocity();
View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

      // add random velocity away from paddle
      Vector2f away = new Vector2f();
      Vector2f.sub(getPosition(), lastPaddle.getPosition(), away);
      away.normalise();
      Vector2f.add(away, new Vector2f((float) Math.random() - 0.5f, (float) Math.random() - 0.5f), away);
      away.normalise();
      away.scale(INITIAL_SPEED);

      Vector2f v = getVelocity();
      Vector2f.add(v, away, v);
      setVelocity(v);
View Full Code Here

Examples of org.lwjgl.util.vector.Vector2f.normalise()

 
  public void fire()
  {
    // Fire a bullet to player's ship
    Vector2f directionToplayer = new Vector2f(Prototyp.player1.position.x-this.position.x,Prototyp.player1.position.y-this.position.y);
    directionToplayer.normalise();
    directionToplayer.x *= 50;
    directionToplayer.y *= 50;
   
    EnemyBullet b = new EnemyBullet();
   
View Full Code Here

Examples of org.lwjgl.util.vector.Vector3f.normalise()

    glCullFace(GL_BACK);
    glEnable(GL_CULL_FACE);
    glEnable(GL_DEPTH_TEST);

    final Vector3f lp = new Vector3f(5.0f, 5.0f, 10.0f);
    lp.normalise();
    glLight(GL_LIGHT0, GL_POSITION, lp.getX(), lp.getY(), lp.getZ(), 0.0f);

    /* make the gears */
    gear1 = new Gear(gear(1.0f, 4.0f, 1.0f, 20, 0.7f), new float[] { 0.8f, 0.1f, 0.0f, 1.0f });
    gear2 = new Gear(gear(0.5f, 2.0f, 2.0f, 10, 0.7f), new float[] { 0.0f, 0.8f, 0.2f, 1.0f });
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.