BOOL motionEquals(Motion* motion1, Motion* motion2) { BOOL result; result &= floatEquals(motion1->position, motion2->position); result &= floatEquals(motion1->oldPosition, motion2->oldPosition); result &= floatEquals(motion1->u, motion2->u); return result; }
void Mesh::setVertices(){ int noEdge=0; int edge=0; int all=0; bool isEdge=false; bool isNoEdge=false; for(uint i=0; i<vertices.size(); i++) { if(floatEquals(vertices[i].Position.x, maxX)){ if(!floatEquals(fabs(vertices[i].Position.y), maxY) && !floatEquals(fabs(vertices[i].Position.z), maxZ)) //noEdge { faceVertices.push_back(&vertices[i]); noEdgeToEdgeMapping.push_back(edge);//[noEdge]=k; noEdge++; isNoEdge=true; } { //Edge faceVerticesEdge.push_back(&vertices[i]); edgeToAllMapping.push_back(all);//[edge]=all; if(!floatEquals(fabs(vertices[i].Position.y), maxY) && !floatEquals(fabs(vertices[i].Position.z), maxZ)) edgeToNoEdgeMapping.push_back(noEdge-1); else edgeToNoEdgeMapping.push_back(-1); edge++; isEdge=true; } } allVertices.push_back(&vertices[i]); //all if(isEdge) allToEdgeMapping.push_back(edge-1);//[all]=edge; else allToEdgeMapping.push_back(-1); all++; isNoEdge=false; isEdge=false; } }
BOOL pidEquals(Pid* pid1, Pid* pid2) { BOOL result; result &= floatEquals(pid1->p, pid2->p); result &= floatEquals(pid1->i, pid2->i); result &= floatEquals(pid1->d, pid2->d); result &= floatEquals(pid1->maxIntegral, pid2->maxIntegral); return result; }
BOOL motionErrorEquals(MotionError* motionError1, MotionError* motionError2) { BOOL result; result &= floatEquals(motionError1->previousError, motionError2->previousError); result &= floatEquals(motionError1->error, motionError2->error); result &= floatEquals(motionError1->derivativeError, motionError2->derivativeError); result &= floatEquals(motionError1->integralError, motionError2->integralError); return result; }
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; // } }
BOOL motionInstructionEquals(MotionInstruction* motionInstruction1, MotionInstruction* motionInstruction2) { BOOL result; result &= floatEquals(motionInstruction1->nextPosition, motionInstruction2->nextPosition); return result; }
bool Mesh::isEdge(Vertex * v){ bool edge = false; if(floatEquals(fabs(v->Position.y), maxY) || floatEquals(fabs(v->Position.z), maxZ)) edge=true; return edge; }