- Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDebugHelper.cs
More file actions
Latest commit
44 lines (41 loc) · 1.76 KB
/
Copy pathDebugHelper.cs
File metadata and controls
44 lines (41 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingExileCore;
usingExileCore.PoEMemory.MemoryObjects;
usingSharpDX;
namespaceTerrain
{
internalclassDebugHelper
{
publicstaticvoidDrawEllipseToWorld(Cameracamera,Graphicsgraphics,Vector3vector3Pos,intradius,
intpoints,intlineWidth,Colorcolor)
{
//var camera = GameController.Game.IngameState.Camera;
varplottedCirclePoints=newList<Vector3>();
varslice=2*Math.PI/points;
for(vari=0;i<points;i++)
{
varangle=slice*i;
varx=(decimal)vector3Pos.X+decimal.Multiply(radius,(decimal)Math.Cos(angle));
vary=(decimal)vector3Pos.Y+decimal.Multiply(radius,(decimal)Math.Sin(angle));
plottedCirclePoints.Add(newVector3((float)x,(float)y,vector3Pos.Z));
}
for(vari=0;i<plottedCirclePoints.Count;i++)
{
if(i>=plottedCirclePoints.Count-1)
{
varpointEnd1=camera.WorldToScreen(plottedCirclePoints.Last());
varpointEnd2=camera.WorldToScreen(plottedCirclePoints[0]);
//Graphics.DrawLine(pointEnd1, pointEnd2, lineWidth, color);
graphics.DrawLine(pointEnd1,pointEnd2,lineWidth,color);
return;
}
varpoint1=camera.WorldToScreen(plottedCirclePoints[i]);
varpoint2=camera.WorldToScreen(plottedCirclePoints[i+1]);
//Graphics.DrawLine(point1, point2, lineWidth, color);
graphics.DrawLine(point1,point2,lineWidth,color);
}
}
}
}