Ejemplo n.º 1
0
void Mesh::createEdgeIndices()
{

    edgeIndices.clear();
    int k=0;
    int index;

    for (uint i=0; i<indices.size(); i++)
    {
        bool valid = true;

        for (uint j=0; j<3; j++)
        {
            Vertex* v = &vertices[indices[i][j]];

            if(!floatEquals(v->Position.x, maxX))
            {
                valid = false;
                break;
            }
        }

        if(valid)
        {
            edgeIndices.push_back(indices[i]);
            for (uint j=0; j<3; j++){
                index=edgeIndices[k][j];
                edgeIndices[k][j]=getEdgeIndex(index);
            }
            k++;
        }
    }

    // update indices .. (currently pointing to old values)

//    for(uint i=0; i<edgeIndices.size(); i++)
//    {
//        for (uint j=0; j<3; j++)
//        {
//            edgeIndices[i][j] = getEdgeIndex(&vertices[edgeIndices[i][j]]);
//        }
//        std::cout<<i<<std::endl;
//    }
}
Ejemplo n.º 2
0
void Map::setEdge(const CL_Point& from, const CL_Point& to, float pheromone)
{
	edgesNew[getEdgeIndex(from, to)].pheromone += pheromone;
}
Ejemplo n.º 3
0
Edge Map::getEdge(const CL_Point& from, const CL_Point& to) const
{
	return edgesOld[getEdgeIndex(from, to)];
}