mirror of
https://github.com/4sval/FModel.git
synced 2026-03-28 04:35:28 -05:00
hmm
This commit is contained in:
parent
f7c1a764f7
commit
0b01400493
|
|
@ -88,6 +88,8 @@ public class Model : IDisposable
|
|||
|
||||
public void Bind(Camera camera)
|
||||
{
|
||||
ImGui.Text($"Entity: {Name}");
|
||||
|
||||
_vao.Bind();
|
||||
|
||||
_shader.Use();
|
||||
|
|
@ -115,13 +117,15 @@ public class Model : IDisposable
|
|||
|
||||
ImGui.BeginTable("Sections", 2, ImGuiTableFlags.RowBg);
|
||||
ImGui.TableSetupColumn("Index", ImGuiTableColumnFlags.WidthFixed);
|
||||
ImGui.TableSetupColumn("Material");
|
||||
ImGui.TableSetupColumn("Material", ImGuiTableColumnFlags.WidthStretch);
|
||||
ImGui.TableHeadersRow();
|
||||
for (int section = 0; section < Sections.Length; section++)
|
||||
{
|
||||
Sections[section].Bind(section);
|
||||
Sections[section].Bind(section, Indices.Length);
|
||||
}
|
||||
ImGui.EndTable();
|
||||
|
||||
ImGui.Separator();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using CUE4Parse.UE4.Assets.Exports.Material;
|
||||
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||
using CUE4Parse_Conversion.Meshes.PSK;
|
||||
|
|
@ -75,7 +76,7 @@ public class Section : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
public void Bind(int index)
|
||||
public void Bind(int index, float indices)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
|
||||
|
|
@ -86,10 +87,11 @@ public class Section : IDisposable
|
|||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text($"Faces: {FacesCount}");
|
||||
ImGui.Text($"Face First Index: {FirstFaceIndex}");
|
||||
ImGui.Text($"Faces: {FacesCount} ({Math.Floor(FacesCount / indices * 100f)}%%)");
|
||||
ImGui.Text($"First Face: {FirstFaceIndex}");
|
||||
ImGui.Separator();
|
||||
ImGui.Text($"Diffuse: ({Parameters.Diffuse?.ExportType}) {Parameters.Diffuse?.Name}");
|
||||
ImGui.Text($"Normal: ({Parameters.Normal?.ExportType}) {Parameters.Normal?.Name}");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public class Snooper
|
|||
private GL _gl;
|
||||
private Camera _camera;
|
||||
private IKeyboard _keyboard;
|
||||
private IMouse _mouse;
|
||||
private Vector2 _previousMousePosition;
|
||||
|
||||
private Model[] _models;
|
||||
|
|
@ -40,6 +41,8 @@ public class Snooper
|
|||
|
||||
var options = WindowOptions.Default;
|
||||
options.Size = new Vector2D<int>(Width, Height);
|
||||
options.WindowBorder = WindowBorder.Hidden;
|
||||
options.Position = new Vector2D<int>(5, 5); // this doesn't fucking work WTF
|
||||
options.Title = "Snooper";
|
||||
_window = Window.Create(options);
|
||||
|
||||
|
|
@ -87,12 +90,11 @@ public class Snooper
|
|||
_input = _window.CreateInput();
|
||||
_keyboard = _input.Keyboards[0];
|
||||
_keyboard.KeyDown += KeyDown;
|
||||
foreach (var mouse in _input.Mice)
|
||||
{
|
||||
// mouse.Cursor.CursorMode = CursorMode.Raw;
|
||||
// mouse.MouseMove += OnMouseMove;
|
||||
// mouse.Scroll += OnMouseWheel;
|
||||
}
|
||||
_mouse = _input.Mice[0];
|
||||
_mouse.MouseDown += OnMouseDown;
|
||||
_mouse.MouseUp += OnMouseUp;
|
||||
_mouse.MouseMove += OnMouseMove;
|
||||
_mouse.Scroll += OnMouseWheel;
|
||||
|
||||
_gl = GL.GetApi(_window);
|
||||
_gl.Enable(EnableCap.Blend);
|
||||
|
|
@ -130,9 +132,7 @@ public class Snooper
|
|||
|
||||
foreach (var model in _models)
|
||||
{
|
||||
ImGui.Text($"Entity: {model.Name}");
|
||||
model.Bind(_camera);
|
||||
ImGui.Separator();
|
||||
}
|
||||
|
||||
float framerate = ImGui.GetIO().Framerate;
|
||||
|
|
@ -174,17 +174,33 @@ public class Snooper
|
|||
}
|
||||
}
|
||||
|
||||
private void OnMouseDown(IMouse mouse, MouseButton button)
|
||||
{
|
||||
if (button != MouseButton.Left) return;
|
||||
mouse.Cursor.CursorMode = CursorMode.Raw;
|
||||
}
|
||||
|
||||
private void OnMouseUp(IMouse mouse, MouseButton button)
|
||||
{
|
||||
if (button != MouseButton.Left) return;
|
||||
mouse.Cursor.CursorMode = CursorMode.Normal;
|
||||
}
|
||||
|
||||
private void OnMouseMove(IMouse mouse, Vector2 position)
|
||||
{
|
||||
const float lookSensitivity = 0.1f;
|
||||
if (_previousMousePosition == default) { _previousMousePosition = position; }
|
||||
else
|
||||
{
|
||||
var xOffset = (position.X - _previousMousePosition.X) * lookSensitivity;
|
||||
var yOffset = (position.Y - _previousMousePosition.Y) * lookSensitivity;
|
||||
_previousMousePosition = position;
|
||||
if (mouse.Cursor.CursorMode == CursorMode.Raw)
|
||||
{
|
||||
const float lookSensitivity = 0.1f;
|
||||
var xOffset = (position.X - _previousMousePosition.X) * lookSensitivity;
|
||||
var yOffset = (position.Y - _previousMousePosition.Y) * lookSensitivity;
|
||||
|
||||
_camera.ModifyDirection(xOffset, yOffset);
|
||||
_camera.ModifyDirection(xOffset, yOffset);
|
||||
}
|
||||
|
||||
_previousMousePosition = position;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user