Examples of Vector2f


Examples of org.newdawn.slick.geom.Vector2f

    bullet_iter = 12;
    if (GameplayState.player.gun.opt_distance_is_power)
      power_add = -10;
   
    /* Searching for player-mouse line angle and setting bullet fly vector */
    vector_pl = new Vector2f(this.x, this.y);
    vector_mouse = new Vector2f(Util.MouseX(), Util.MouseY());
    vector_mouse.sub(vector_pl);
    vector_mouse.normalise();
    float spread = GameplayState.player.gun.opt_spreading-GameplayState.player.gun.opt_spreading_add;
    float rand = new Random().nextFloat()*6-3; //[-3..3]
    vector_mouse.setTheta(vector_mouse.getTheta()+rand/5*spread); //rand/spread_max*(spread-spread_add)
 
View Full Code Here

Examples of org.spout.math.vector.Vector2f

  public void preRender(SnapshotRender snapshotRender) {
    float x = (float) (GenericMath.mod(TrigMath.TWO_PI * freqX / 1000.0 * System.currentTimeMillis(), TrigMath.TWO_PI) - TrigMath.PI);
    x = amplX * (TrigMath.sin(x) + 1.0f);
    float y = (float) (GenericMath.mod(TrigMath.TWO_PI * freqY / 1000.0 * System.currentTimeMillis(), TrigMath.TWO_PI) - TrigMath.PI);
    y = amplY * (TrigMath.sin(y) + 1.0f);
    snapshotRender.getMaterial().getShader().setUniform("animation", new Vector2f(x * size, y * size));
  }
 
View Full Code Here

Examples of soc.qase.tools.vecmath.Vector2f

@param angle the angle to be converted
@return the 2D directional vector */
/*-------------------------------------------------------------------*/
  public static Vector2f degreesToVector2f(float angle)
  {
    return new Vector2f((float)Math.cos(Math.toRadians(angle)), (float)Math.sin(Math.toRadians(angle)));
  }
View Full Code Here

Examples of transientlibs.slick2d.geom.Vector2f

        return -1;
    }

    // TODO: maybe move Coords to Vector2f?
    public Vector2f toVector2f() {
        return new Vector2f((float) x, (float) y);
    }
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.