More improvements
This commit is contained in:
parent
47dee0ea3d
commit
a0b28dc7ae
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -15,7 +15,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
get
|
||||
{
|
||||
var point = new RenderablePathPoint(Translate, Rotate, Scale, this);
|
||||
var point = new RenderablePathPoint(new Vector4(0f, 0.25f, 1f, 1f), Translate, Rotate, Scale, this);
|
||||
return point;
|
||||
}
|
||||
}
|
||||
|
@ -31,10 +31,12 @@ namespace GL_EditorFramework.EditorDrawables
|
||||
|
||||
public override bool IsSelected(int partIndex) => Selected;
|
||||
|
||||
protected static Vector4 Color = new Vector4(0f, 0.25f, 1f, 1f);
|
||||
public Vector4 Color = new Vector4(0f, 0.25f, 1f, 1f);
|
||||
|
||||
public RenderablePathPoint(Vector3 pos, Vector3 rot, Vector3 sca, object nodeObject) {
|
||||
public RenderablePathPoint(Vector4 color, Vector3 pos, Vector3 rot, Vector3 sca, object nodeObject) {
|
||||
NodeObject = nodeObject;
|
||||
|
||||
Color = color;
|
||||
UpdateTransform(pos, rot, sca);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
get
|
||||
{
|
||||
var point = new RenderablePathPoint(Translate, Rotate, new OpenTK.Vector3(30), this);
|
||||
var point = new RenderablePathPoint(new Vector4(1f, 0f, 0f, 1f), Translate, Rotate, new OpenTK.Vector3(30), this);
|
||||
point.CanConnect = true;
|
||||
return point;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GL_EditorFramework.EditorDrawables;
|
||||
using OpenTK;
|
||||
|
||||
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
@ -68,6 +70,17 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
|
||||
public class LapPathPoint : PathPoint
|
||||
{
|
||||
|
||||
[Browsable(false)]
|
||||
public override RenderablePathPoint RenderablePoint
|
||||
{
|
||||
get
|
||||
{
|
||||
var point = new RenderablePathPoint(new Vector4(0f, 0.25f, 1f, 0.1f), Translate, Rotate, Scale, this);
|
||||
return point;
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Properties")]
|
||||
public int CheckPoint
|
||||
{
|
||||
|
@ -10,10 +10,21 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
public class RenderableConnectedPaths : AbstractGlDrawable
|
||||
{
|
||||
public Color LineColor = Color.Green;
|
||||
|
||||
public RenderableConnectedPaths(Color color) {
|
||||
LineColor = color;
|
||||
}
|
||||
|
||||
//Lap paths use 4 points for each rectangle
|
||||
//This also applies to gravity paths
|
||||
public bool Use4PointConnection = false;
|
||||
|
||||
private static ShaderProgram defaultShaderProgram;
|
||||
|
||||
public List<PathGroup> PathGroups = new List<PathGroup>();
|
||||
|
||||
|
||||
public void AddGroup(PathGroup group)
|
||||
{
|
||||
PathGroups.Add(new PathGroup()
|
||||
@ -60,7 +71,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
GL.LineWidth(2f);
|
||||
foreach (var nextPt in path.NextPoints)
|
||||
{
|
||||
GL.Color3(Color.Blue);
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
|
||||
@ -68,7 +79,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
}
|
||||
foreach (var prevPt in path.PrevPoints)
|
||||
{
|
||||
GL.Color3(Color.Blue);
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
|
||||
@ -86,22 +97,32 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
foreach (var path in group.PathPoints)
|
||||
{
|
||||
GL.LineWidth(2f);
|
||||
foreach (var nextPt in path.NextPoints)
|
||||
if (Use4PointConnection)
|
||||
{
|
||||
GL.Color3(Color.Blue);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
|
||||
GL.End();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
foreach (var prevPt in path.PrevPoints)
|
||||
else
|
||||
{
|
||||
GL.Color3(Color.Blue);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
|
||||
GL.End();
|
||||
GL.LineWidth(2f);
|
||||
foreach (var nextPt in path.NextPoints)
|
||||
{
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
|
||||
GL.End();
|
||||
}
|
||||
foreach (var prevPt in path.PrevPoints)
|
||||
{
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(path.Translate);
|
||||
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
|
||||
GL.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,19 +73,19 @@ namespace FirstPlugin.Forms
|
||||
treeView1.Nodes.Add("Scene");
|
||||
|
||||
if (scene.EnemyPaths.Count > 0) {
|
||||
AddPathDrawable("Enemy Path", scene.EnemyPaths);
|
||||
AddPathDrawable("Enemy Path", scene.EnemyPaths, Color.Red);
|
||||
}
|
||||
if (scene.EnemyPaths.Count > 0) {
|
||||
AddPathDrawable("Lap Path", scene.LapPaths, false);
|
||||
AddPathDrawable("Lap Path", scene.LapPaths,Color.Blue, false);
|
||||
}
|
||||
|
||||
IsLoaded = true;
|
||||
}
|
||||
|
||||
private void AddPathDrawable(string Name, IEnumerable<PathGroup> Groups, bool CanConnect = true)
|
||||
private void AddPathDrawable(string Name, IEnumerable<PathGroup> Groups, Color color, bool CanConnect = true)
|
||||
{
|
||||
//Create a connectable object to connect each point
|
||||
var renderablePathConnected = new RenderableConnectedPaths();
|
||||
var renderablePathConnected = new RenderableConnectedPaths(color);
|
||||
|
||||
if (CanConnect) {
|
||||
viewport.AddDrawable(renderablePathConnected);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user