Examples of addScaled()


Examples of net.sf.fysix.math.Vector2d.addScaled()

      } else {
        spread = (spread/2);
      }
      Vector2d dir = new Vector2d(Math.cos(ph.getWorldObject().getRotation()-Math.PI-Math.toRadians(spread)), Math.sin(ph.getWorldObject().getRotation()-Math.PI-Math.toRadians(spread)));
      Vector2d pos = ph.getWorldObject().getPosition();
      pos.addScaled(9, dir);
      dust.setPosition(pos);
      dir.scale(100);
      Vector2d vel = ph.getWorldObject().getVelocity();
      dust.setVelocity(vel);
      World.getInstance().addObject(dust, true);
View Full Code Here

Examples of net.sf.fysix.math.Vector2d.addScaled()

      int shots = input1.checkEvent(InputAction.SHOOT);
      if (shots > 0) {
        WorldObject bullet = new Planet(2,50, TypeE.WEAPON_SHOT_MINE);
        Vector2d dir = new Vector2d(Math.cos(player1.getWorldObject().getRotation()), Math.sin(player1.getWorldObject().getRotation()));
        Vector2d pos = player1.getWorldObject().getPosition();
        pos.addScaled(16, dir);
        bullet.setPosition(pos);
        dir.scale(1000000);
        //bullet.setVelocity(dir);
        world.addObject(bullet, true);
        bullet.applyImpulse(dir);
View Full Code Here

Examples of net.sf.fysix.math.Vector2d.addScaled()

      shots = input2.checkEvent(InputAction.SHOOT);
      if (shots > 0) {
        WorldObject bullet = new Planet(2,50, TypeE.WEAPON_SHOT_MINE);
        Vector2d dir = new Vector2d(Math.cos(player2.getWorldObject().getRotation()), Math.sin(player2.getWorldObject().getRotation()));
        Vector2d pos = player2.getWorldObject().getPosition();
        pos.addScaled(16, dir);
        bullet.setPosition(pos);
        dir.scale(1000000);
        //bullet.setVelocity(dir);
        world.addObject(bullet, true);
        bullet.applyImpulse(dir);
View Full Code Here

Examples of org.grouplens.lenskit.vectors.MutableSparseVector.addScaled()

        MutableSparseVector v1 = MutableSparseVector.create(ts);
        v1.fill(0);
        v1.set(vec1);
        v1.multiply(1.0 / v1.norm());
        v1.addScaled(vec2, -1.0 / vec2.norm());

        distance = v1.norm();
        return 1-distance;
    }
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.