File | Line |
---|
SteeringStuff/SteeringTools.java | 24 |
SteeringStuff/SteeringTools.java | 59 |
dA.normalize();
dB.normalize();
if (!dA.equals(dB)) {
if (dA.x == 0) dA.x = 0.001;
if (dB.x == 0) dB.x = 0.001;
if (dA.y == 0) dA.y = 0.001;
if (dB.y == 0) dB.y = 0.001;
double tB = ( (sA.y - sB.y) / dB.y ) + ( ( dA.y * (sB.x - sA.x) ) / (dA.x * dB.y) );
tB = tB / (1 - ((dB.x * dA.y)/(dA.x * dB.y)) );
double tA = ( sB.x - sA.x + (tB*dB.x) );
tA = tA / dA.x;
double pointX = sA.x + tA * dA.x;
double pointY = sA.y + tA * dA.y; |
File | Line |
---|
Steerings/WallFollowingSteer.java | 388 |
Steerings/WallFollowingSteer.java | 408 |
normal = nrightfront.getHitNormal();
multiplier = Math.pow(1 - (longSideFrontRayLength - botToHitLocation.length()) / longSideFrontRayLength, orderOfTheForce);
normal.scale(attractiveForceWeight * multiplier * wallForce);
nextVelocity.sub((Tuple3d) normal);
//if (SteeringManager.DEBUG) System.out.println("right-front to "+normal.length());
//When closer, the bot is pushed away from the wall by another force.
if (botToHitLocation.length() < shortSideFrontRayLength) {
shortrays = true;
multiplier = Math.pow(((shortSideFrontRayLength - botToHitLocation.length()) * 2f / shortSideFrontRayLength), orderOfTheForce);
normal.normalize();
normal.scale(repulsiveForceWeight * multiplier * wallForce);
nextVelocity.add((Tuple3d) normal);
//if (SteeringManager.DEBUG) System.out.println("right-front from "+normal.length());
}
}
if (sensornFront) { |
File | Line |
---|
Steerings/WallFollowingSteer.java | 349 |
Steerings/WallFollowingSteer.java | 369 |
normal = nright.getHitNormal();
multiplier = Math.pow(1 - (longSideRayLength - botToHitLocation.length()) / longSideRayLength, orderOfTheForce);
normal.scale(attractiveForceWeight * multiplier * wallForce);
nextVelocity.sub((Tuple3d) normal);
//if (SteeringManager.DEBUG) System.out.println("right to "+normal.length());
//When closer, the bot is pushed away from the wall by another force.
if (botToHitLocation.length() < shortSideRayLength) {
shortrays = true;
multiplier = Math.pow(((shortSideRayLength - botToHitLocation.length()) * 2f / shortSideRayLength), orderOfTheForce);
normal.normalize();
normal.scale(repulsiveForceWeight * multiplier * wallForce);
nextVelocity.add((Tuple3d) normal);
//if (SteeringManager.DEBUG) System.out.println("right from "+normal.length());
}
}
if (sensornLeftFront) { |
File | Line |
---|
SteeringProperties/WallFollowingProperties.java | 192 |
Steerings/WallFollowingSteer.java | 592 |
this.orderOfTheForce = ((WallFollowingProperties)newProperties).getOrderOfTheForce();
this.attractiveForceWeight = ((WallFollowingProperties)newProperties).getAttractiveForceWeight();
this.repulsiveForceWeight = ((WallFollowingProperties)newProperties).getRepulsiveForceWeight();
this.concaveEdgesForceWeight = ((WallFollowingProperties)newProperties).getConcaveEdgesForceWeight();
this.convexEdgesForceWeight = ((WallFollowingProperties)newProperties).getConvexEdgesForceWeight();
this.justMySide = ((WallFollowingProperties)newProperties).isJustMySide();
this.specialDetection = ((WallFollowingProperties)newProperties).isSpecialDetection();
this.frontCollisions = ((WallFollowingProperties)newProperties).isFrontCollisions();
}
public WallFollowingProperties getProperties() { |
File | Line |
---|
SteeringProperties/LeaderFollowingProperties.java | 247 |
Steerings/LeaderFollowingSteer.java | 342 |
this.distanceFromTheLeader = ((LeaderFollowingProperties)newProperties).getDistanceFromTheLeader();
this.forceDistance = ((LeaderFollowingProperties)newProperties).getForceDistance();
this.myLFtype = ((LeaderFollowingProperties)newProperties).getMyLFtype();
this.deceleration = ((LeaderFollowingProperties)newProperties).isDeceleration();
this.angleFromTheLeader = ((LeaderFollowingProperties)newProperties).getAngleFromTheLeader();
this.velocityMemory = ((LeaderFollowingProperties)newProperties).isVelocityMemory();
this.sizeOfMemory = ((LeaderFollowingProperties)newProperties).getSizeOfMemory();
this.circumvention = ((LeaderFollowingProperties)newProperties).isCircumvention(); |