1
0
mirror of synced 2024-11-12 10:10:50 +01:00

Use abstract drawable for collision atm to fix lag and drawing issues

This commit is contained in:
KillzXGaming 2019-04-28 19:57:18 -04:00
parent 184e01ad01
commit 1a730f66b7
5 changed files with 9 additions and 13 deletions

Binary file not shown.

View File

@ -429,7 +429,7 @@ namespace FirstPlugin
}
}
public class KCLRendering : EditableObject
public class KCLRendering : AbstractGlDrawable
{
public Vector3 Max = new Vector3(0);
public Vector3 Min = new Vector3(0);
@ -441,8 +441,8 @@ namespace FirstPlugin
protected bool Selected = false;
protected bool Hovered = false;
public override bool IsSelected() => Selected;
public override bool IsSelected(int partIndex) => Selected;
// public override bool IsSelected() => Selected;
// public override bool IsSelected(int partIndex) => Selected;
public bool IsHovered() => Selected;
@ -628,9 +628,7 @@ namespace FirstPlugin
return;
}
public override void Draw(GL_ControlModern control, Pass pass) { }
public override void Draw(GL_ControlModern control, Pass pass, EditorSceneBase editorScene)
public override void Draw(GL_ControlModern control, Pass pass)
{
CheckBuffers();
@ -639,9 +637,9 @@ namespace FirstPlugin
control.CurrentShader = defaultShaderProgram;
control.UpdateModelMatrix(
Matrix4.CreateScale(Runtime.previewScale) *
Matrix4.CreateTranslation(Selected ? editorScene.CurrentAction.NewPos(position) : position));
// control.UpdateModelMatrix(
// Matrix4.CreateScale(Runtime.previewScale) *
// Matrix4.CreateTranslation(Selected ? editorScene.CurrentAction.NewPos(position) : position));
SetRenderSettings(defaultShaderProgram);
@ -666,8 +664,6 @@ namespace FirstPlugin
GL.Disable(EnableCap.DepthTest);
GL.Enable(EnableCap.DepthTest);
GL.Enable(EnableCap.CullFace);
DrawGlobalOctree();
}
private void SetRenderSettings(ShaderProgram shader)
{
@ -740,7 +736,7 @@ namespace FirstPlugin
GL.Uniform1(shader["colorOverride"], 0);
}
public override BoundingBox GetSelectionBox()
/* public override BoundingBox GetSelectionBox()
{
Vector3 Min = new Vector3(0);
Vector3 Max = new Vector3(0);
@ -836,7 +832,7 @@ namespace FirstPlugin
{
position = value;
}
}
}*/
}
//Convert KCL lib vec3 to opentk one so i can use the cross and dot methods