Skip to content

Commit

Permalink
One-vector method for Kethane cells
Browse files Browse the repository at this point in the history
  • Loading branch information
DMagic1 committed May 31, 2014
1 parent 94121f0 commit 92fc589
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SCANsatkethane/SCANsatkethane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,9 @@ private void rebuildResourceValue (SCANdata.SCANtype type) {
}
}

private Cell getKethaneCell (int ilon, int ilat) { //Find the Kethane cell corresponding to the current position
Vector3 pos = body.GetWorldSurfacePosition((double)ilat, (double)ilon, 50000d); //Set high altitude just to make sure the vector is above the surface
Vector3 Wpos = body.transform.InverseTransformPoint(pos); //Draws a line from the position defined above through the center of the planet
return Kethane.Cell.Containing(Wpos, 5);
private Cell getKethaneCell (int ilon, int ilat) { //Find the Kethane cell corresponding to the current position
Vector3 pos = body.GetRelSurfaceNVector((double)ilat, (double)ilon);
return Kethane.Cell.Containing(pos, 5);
}

private void updateResourceArray (int lon, int lat, SCANdata.SCANtype type, SCANdata data) {
Expand Down

0 comments on commit 92fc589

Please sign in to comment.