float fx_Dist(Node a, Node b){ float d = dist(a.x,a.y,a.z, b.x,b.y,b.z); return d; } float fx_DistPV(PVector a, PVector b){ float d = dist(a.x,a.y,a.z, b.x,b.y,b.z); return d; } PVector fx_MirrorPt(PVector axisPt, PVector ptToMirror){ PVector resultPt; PVector pvBetween = PVector.sub(ptToMirror, axisPt); float xDiff = pvBetween.x; float zDiff = pvBetween.z; resultPt = new PVector(axisPt.x-xDiff, ptToMirror.y, axisPt.z-zDiff); return resultPt; } PVector fx_ClosestPtToLine(PVector pvLine, PVector[] arrPVects){ PVector closestPt = null; float minDist = 1000000.0; float maxAngle = 0.0; for(int i=0; i= maxAngle) ){ minDist = d; maxAngle = angle; closestPt = checkPV; } } return closestPt; } Node fx_ClosestNode(Node a, Node[] arrNodes){ Node closeNode = a; float minDist = 1000000.0; for(int i=0; i= maxAngle) ){ minDist = d; maxAngle = angle; closestNode = checkNode; } } return closestNode; } Float fx_TotalSqft(Node[] arrNodes){ float totalSqft = 0.0; for(int i=0; i= minSqft) && (checkNode.sqft >= checkNode.sqftMin * 2) && (checkNode.blnExplodable == true) ){ minSqft = checkNode.sqft; biggestNode = checkNode; } } } return biggestNode; } Node fx_ExplodeNode(Node[] arrNodes){ Node theNode = fx_BiggestNode(arrNodes); myGraph.explodeNode(theNode, sprStr, sprLength); return theNode; } float round(float val, int dp){ return int(val*pow(10,dp))/pow(10,dp); } float fx_NoiseMult(Node a, Node b){ float noiseMult = 1 + (max(abs(a.noiseAllow-b.noiseAllow),noiseMin)-1)/4 * noiseFactor; return noiseMult; } float fx_TrafficMult(Node a, Node b){ float trafficMult = max(0.5, (a.trafficRate+b.trafficRate)/5) * trafficFactor; return trafficMult; } PVector[] fx_GetBBoxPVects(Node[] arrNodes){ PVector[] arrPVects = new PVector[0]; for(int i=0; i= 4) ){ loopPaths.add(usePath); } } for(int j=0; j= 3 ){ checkPath.blnActive = false; k = arrNetworks.size() - 1; } } if( checkPath.blnActive == true ){ arrNetworks.add(checkPath); } } } } }