Examples of MotionInfluence


Examples of fr.utbm.gi.vi51.framework.environment.MotionInfluence

    List<MotionInfluence> influenceList = new ArrayList<MotionInfluence>(influences);
    List<AnimatAction> actions = new ArrayList<AnimatAction>(influenceList.size());
   
    // Compute actions
    for(int index1=0; index1<influenceList.size(); index1++) {
      MotionInfluence inf1 = influenceList.get(index1);
      AgentBody body1 = getAgentBodyFor(inf1.getEmitter());
      if (body1!=null) {
        Vector2d move;
        double rotation;
        if (inf1.getType()==DynamicType.STEEERING) {
          move = computeSteeringTranslation(body1, inf1.getLinearInfluence(), timeManager);
          rotation = computeSteeringRotation(body1, inf1.getAngularInfluence(), timeManager);
        }
        else {
          move = computeKinematicTranslation(body1, inf1.getLinearInfluence(), timeManager);
          rotation = computeKinematicRotation(body1, inf1.getAngularInfluence(), timeManager);
        }
       
        double x1 = body1.getX();
        double y1 = body1.getY();

        // Trivial collision detection
        for(int index2=index1+1; index2<influenceList.size(); index2++) {
          MotionInfluence inf2 = influenceList.get(index2);
          AgentBody body2 = getAgentBodyFor(inf2.getEmitter());
          if (body2!=null) {
            double x2 = body2.getX();
            double y2 = body2.getY();
                       
            double distance = new Vector2d(x2-x1,y2-y1).length();
View Full Code Here

Examples of fr.utbm.gi.vi51.framework.environment.MotionInfluence

    List<MotionInfluence> influenceList = new ArrayList<MotionInfluence>(influences);
    List<AnimatAction> actions = new ArrayList<AnimatAction>(influenceList.size());
   
    // Compute actions
    for(int index1=0; index1<influenceList.size(); index1++) {
      MotionInfluence inf1 = influenceList.get(index1);
      AgentBody body1 = getAgentBodyFor(inf1.getEmitter());
      if (body1!=null) {
        Vector2d move;
        double rotation;
        if (inf1.getType()==DynamicType.STEEERING) {
          move = computeSteeringTranslation(body1, inf1.getLinearInfluence(), timeManager);
          rotation = computeSteeringRotation(body1, inf1.getAngularInfluence(), timeManager);
        }
        else {
          move = computeKinematicTranslation(body1, inf1.getLinearInfluence(), timeManager);
          rotation = computeKinematicRotation(body1, inf1.getAngularInfluence(), timeManager);
        }
       
        double x1 = body1.getX();
        double y1 = body1.getY();

        // Trivial collision detection
        for(int index2=index1+1; index2<influenceList.size(); index2++) {
          MotionInfluence inf2 = influenceList.get(index2);
          AgentBody body2 = getAgentBodyFor(inf2.getEmitter());
          if (body2!=null) {
            double x2 = body2.getX();
            double y2 = body2.getY();
                       
            double distance = new Vector2d(x2-x1,y2-y1).length();
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.