Package eas.simulation.spatial.sim3D.physicalSimulation.standardAgents

Examples of eas.simulation.spatial.sim3D.physicalSimulation.standardAgents.AbstractAgent3D


   
   
    if (simZyk.getLastTick() % 5500 == 5499) {
      Iterator<AbstractAgent3D<?>> iter = env.getAgents().iterator();
      while (iter.hasNext()){
        AbstractAgent3D agent = iter.next();
        agent.getRigidBody().setActivationState(CollisionObject.ACTIVE_TAG);
        Vector3f position = agent.getPosition();
        Vector3f explosionCenter = new Vector3f(0,-10,0);
        explosionCenter.negate();
        Vector3f direction = new Vector3f ();
        VectorUtil.add(direction, position, explosionCenter);
        float distanceFromExplosion = direction.length();
        direction.normalize();
        direction.scale(1/distanceFromExplosion * 1000f);
        agent.getRigidBody().applyCentralImpulse(direction);
      }
    }
  }
 
View Full Code Here

TOP

Related Classes of eas.simulation.spatial.sim3D.physicalSimulation.standardAgents.AbstractAgent3D

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.