Commit c6a193a8 authored by pitiot's avatar pitiot
Browse files

merging

parent 38eb3098
#ifndef M_ARTICULATED_OBSTACLE_H
#define M_ARTICULATED_OBSTACLE_H
#include "moving_obstacle.h"
using namespace std;
class ArticulatedObstacle
{
public:
ArticulatedObstacle(Simulator* sim, int index, int currentIndex, std::vector<PFP::VEC3> * pos, int nbParts, std::vector<VEC3> goals);
std::vector<MovingObstacle *> members;
int index;
int nbBodyPart;
std::vector<VEC3> goals;
VEC3 curGoal;
};
#endif
#include "articulated_obstacle.h"
ArticulatedObstacle::ArticulatedObstacle(Simulator* sim, int index, int currentIndex, std::vector<PFP::VEC3> * pos, int size , std::vector<VEC3> goals)
{
this->index=index;
nbBodyPart = size;
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1 ,pos[0],goals,true,this,0);
members.push_back(mo4);
for(int i =1; i<nbBodyPart; i++)
{
std::vector<VEC3> goal;
goal.push_back(members[i-1]->center);
MovingObstacle * mo4= new MovingObstacle(sim,currentIndex+1+i ,pos[i],goal,true, this,i);
members.push_back(mo4);
}
}
PFP::VEC3 get_center (ArticulatedObstacle * art, int index)
{
return art->members[index]->center + (art->members[index]->center -art->members[index]->front);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment