Package com.artemis.util

Examples of com.artemis.util.Vec2f


    @Override
    protected void process(Entity e) {
      int mod = (e.getId() % 2 == 0) ? 1 : 2;
     
      Position pos = mapper.get(e);
      pos.add(new Vec2f(10 * mod, 0));
      pos.xy(pos.x, pos.y * -10 * mod);
     
      pos = mapper.get(e);
      assertEquals(3 + iteration * 10f * mod, pos.x, 0.1);
      assertEquals(7 * Math.pow(-10f * mod, iteration), pos.y, 0.1);
View Full Code Here


  }
 
  @Test
  public void packed_component_add_with_object() throws Exception {
    ComponentMapper<TransPackedFloat> mapper = world.getMapper(TransPackedFloat.class);
    Vec2f v1 = new Vec2f(1f, 2f);
    Vec2f v2 = new Vec2f(3f, 4f);
   
    mapper.get(e1).x(1f).y(1f);
    mapper.get(e2).x(1f).y(1f);
   
    mapper.get(e1).add(v1);
View Full Code Here

  }
 
  @Test
  public void packed_component_set_with_object() throws Exception {
    ComponentMapper<TransPackedFloat> mapper = world.getMapper(TransPackedFloat.class);
    Vec2f v1 = new Vec2f(1f, 2f);
    Vec2f v2 = new Vec2f(3f, 4f);
   
    mapper.get(e1).x(1).y(1);
    mapper.get(e2).x(1).y(1);
   
    mapper.get(e1).set(v1);
View Full Code Here

TOP

Related Classes of com.artemis.util.Vec2f

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.