Examples of CollisionEvent


Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.CollisionEvent

            Arbiter<AgentType> arb = arbiters.get(i);
           
            if (arb.concerns(body)) {
                for (int j=0;j<arb.getNumContacts();j++) {
                    Contact contact = arb.getContact(j);
                    CollisionEvent event = new CollisionEvent(0, arb.getBody1(), arb.getBody2(), contact.getPosition(), contact.getNormal(), contact.getSeparation());
                   
                    collisions.add(event);
                }
            }
        }
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.CollisionEvent

    private void notifyCollision(AgentType body1, AgentType body2, ROVector2f point, ROVector2f normal, float depth) {
        if (listeners.size() == 0) {
            return;
        }
       
        CollisionEvent event = new CollisionEvent(totalTime,body1,body2,point,normal,depth);
   
        for (int i=0;i<listeners.size();i++) {
            (listeners.get(i)).collisionOccured(event);
        }
    }
View Full Code Here

Examples of framework.collision.CollisionComponent.CollisionEvent

  @Override
  public void onEvent(Event e) {
    if(e != null){
      if(e.getType().equals("Collision")){
        CollisionEvent collis = (CollisionEvent) e;
        SpriteComponent sprite = (SpriteComponent) collis.getCollidedWith().getSiblingByType(SpriteComponent.class.getName());
        if(sprite != null){
          sprite.setImageFilename("res/img/red_dot.png", true);
        }
      }else if(e.getType().equals("CollisionStopped")){
        CollisionEvent collis = (CollisionEvent) e;
        SpriteComponent sprite = (SpriteComponent) collis.getCollidedWith().getSiblingByType(SpriteComponent.class.getName());
        if(sprite != null){
          sprite.setImageFilename("res/img/dot.png", true);
        }
      }else if(e.getType().equals("MousePressed")){
        Collection<Component> comps = ComponentSystem.getInstance().getAllComponents().getComponentsOfType(SpriteComponent.class.getName()).getAllComponents();
View Full Code Here

Examples of net.javlov.world.CollisionEvent

       
    return true;
  }
 
  protected void queueCollisionEvent(Body b1, Body b2, Point2D.Double speed) {
    CollisionEvent e = new CollisionEvent(b1, b2, speed, (Point2D.Double)b2.getLocation());
    collisionList.add(e);
  }
View Full Code Here

Examples of net.javlov.world.CollisionEvent

    for ( GridCell c : getIntersectingCellsLarge(b.getFigure()) )
        c.removeBody(b);
    }
 
  protected void addCollisionEvent(Body b1, Body b2, Point2D.Double speed) {
    CollisionEvent event = new CollisionEvent(b1, b2, speed, (Point2D.Double)b2.getLocation());
    collisionEvents.add(event);
  }
View Full Code Here

Examples of net.javlov.world.CollisionEvent

    CollisionEvent event = new CollisionEvent(b1, b2, speed, (Point2D.Double)b2.getLocation());
    collisionEvents.add(event);
  }
 
  protected void processCollisionEvents() {
    CollisionEvent event;
    while ( !collisionEvents.isEmpty() ) {
      event = collisionEvents.remove();
      for ( CollisionListener listener : listeners )
        listener.collisionOccurred(event);
    }
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.