本文整理汇总了C#中TerraViewer.Vector3d.Subtract方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3d.Subtract方法的具体用法?C# Vector3d.Subtract怎么用?C# Vector3d.Subtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TerraViewer.Vector3d
的用法示例。
在下文中一共展示了Vector3d.Subtract方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueueThread
public static void QueueThread()
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US", false);
bool fileOnly = fileOnlyThreadID == Thread.CurrentThread.ManagedThreadId;
while (running)
{
if (queue.Count < 1)
{
System.Threading.Thread.Sleep(50);
}
else
{
System.Threading.Thread.Sleep(1);
}
double minDistance = 1000000000000000000;
bool overlayTile = false;
long maxKey = 0;
int level = 1000;
queueMutex.WaitOne();
foreach (Tile t in queue.Values )
{
if (!t.RequestPending ) // && t.InViewFrustum)
{
Vector3d vectTemp = new Vector3d(t.SphereCenter);
vectTemp.TransformCoordinate(Earth3d.WorldMatrix);
if (Earth3d.MainWindow.Space)
{
vectTemp.Subtract(new Vector3d(0.0f, 0.0f, -1.0f));
}
else
{
vectTemp.Subtract(Earth3d.MainWindow.RenderContext11.CameraPosition);
}
double distTemp = Math.Max(0,vectTemp.Length()-t.SphereRadius);
bool thisIsOverlay = (t.Dataset.Projection == ProjectionType.Tangent) || (t.Dataset.Projection == ProjectionType.SkyImage);
if (distTemp < minDistance && (!overlayTile || thisIsOverlay))
{
Tile test = (Tile)queue[t.Key];
if (!test.FileChecked)
{
test.FileExists = File.Exists(test.FileName);
test.FileChecked = true;
if (test.Volitile)
{
test.FileExists = false;
}
}
if (test.FileExists || (!test.FileExists && !fileOnly))
{
minDistance = distTemp;
maxKey = t.Key;
level = t.Level;
overlayTile = thisIsOverlay;
}
}
}
}
if (maxKey != 0)
{
Tile workTile = (Tile)queue[maxKey];
workTile.RequestPending = true;
TileCache.RequestCount++;
queueMutex.ReleaseMutex();
TileCache.GetTileFromWeb(workTile, true);
queueMutex.WaitOne();
TileCache.RequestCount--;
workTile.RequestPending = false;
queue.Remove(workTile.Key);
}
queueMutex.ReleaseMutex();
}
return;
}
示例2: GotoReticlePoint
public void GotoReticlePoint(int id)
{
Coordinates result = new Coordinates(0, 0);
Vector3d PickRayOrig;
Vector3d PickRayDir;
if (!Reticle.Reticles.ContainsKey(id))
{
return;
}
Reticle ret = Reticle.Reticles[id];
Vector3d pick = Coordinates.RADecTo3d(ret.Az / 15 - 6, ret.Alt, 1);
double distance = (Math.Min(1, (.5 * (ZoomFactor / 180)))) - 1 + 0.0001;
PickRayOrig = new Vector3d(0, -distance, 0);
Matrix3d mat = WorldMatrix * Matrix3d.RotationX(((config.TotalDomeTilt) / 180 * Math.PI));
mat.Invert();
mat.MultiplyVector(ref pick);
mat.MultiplyVector(ref PickRayOrig);
PickRayDir = pick;
Vector3d temp = new Vector3d(PickRayOrig);
temp.Subtract(Earth3d.MainWindow.viewCamera.ViewTarget);
IPlace closetPlace = Grids.FindClosestObject(temp, new Vector3d(PickRayDir));
if (closetPlace != null)
{
GotoTarget(closetPlace, false, false, true);
}
}
示例3: FindCurrentObject
private void FindCurrentObject()
{
var loc = Earth3d.MainWindow.RenderWindow.PointToClient(PointToScreen(new Point(300, 88)));
IPlace closetPlace = null;
var result = new Coordinates(0,0);
if (Earth3d.MainWindow.SolarSystemMode)
{
var pt = loc;
Vector3d PickRayOrig;
Vector3d PickRayDir;
var rect = Earth3d.MainWindow.RenderWindow.ClientRectangle;
Earth3d.MainWindow.TransformStarPickPointToWorldSpace(pt, rect.Width, rect.Height, out PickRayOrig, out PickRayDir);
var temp = new Vector3d(PickRayOrig);
temp.Subtract(Earth3d.MainWindow.viewCamera.ViewTarget);
//closetPlace = Grids.FindClosestObject(temp , new Vector3d(PickRayDir));
CallFindClosestObject(temp, new Vector3d(PickRayDir));
}
else
{
// TODO fix this for earth, plantes, panoramas
result = Earth3d.MainWindow.GetCoordinatesForScreenPoint(loc.X, loc.Y);
var constellation = Earth3d.MainWindow.ConstellationCheck.FindConstellationForPoint(result.RA, result.Dec);
//Place[] resultList = ContextSearch.FindClosestMatches(constellation, result.RA, result.Dec, ZoomFactor / 600, 5);
closetPlace = ContextSearch.FindClosestMatch(constellation, result.RA, result.Dec, Earth3d.MainWindow.DegreesPerPixel * 80);
if (closetPlace == null)
{
// closetPlace = Grids.FindClosestMatch(constellation, result.RA, result.Dec, Earth3d.MainWindow.DegreesPerPixel * 80);
CallFindClosestMatch(constellation, result.RA, result.Dec, Earth3d.MainWindow.DegreesPerPixel * 80);
noPlaceDefault = new TourPlace(Language.GetLocalizedText(90, "No Object"), result.Dec, result.RA, Classification.Unidentified, constellation, ImageSetType.Sky, -1);
//Earth3d.MainWindow.SetLabelText(null, false);
return;
}
Earth3d.MainWindow.SetLabelText(closetPlace, false);
Target = closetPlace;
}
}
示例4: GeoTo3d
protected Vector3d GeoTo3d(double lat, double lng, bool useLocalCenter)
{
if (dataset.DataSetType == ImageSetType.Panorama)
{
Vector3d retVal = new Vector3d(-(Math.Cos(lng * RC) * Math.Cos(lat * RC) * radius), (Math.Sin(lat * RC) * radius), (Math.Sin(lng * RC) * Math.Cos(lat * RC) * radius));
if (useLocalCenter)
{
retVal.Subtract(localCenter);
}
return retVal;
}
else
{
Vector3d retVal = new Vector3d((Math.Cos(lng * RC) * Math.Cos(lat * RC) * radius), (Math.Sin(lat * RC) * radius), (Math.Sin(lng * RC) * Math.Cos(lat * RC) * radius));
if (useLocalCenter)
{
retVal.Subtract(localCenter);
}
return retVal;
}
}