Repository navigation
#26 editor improvements, #2 Obj file loading (WIP) and more general enhancements - #56
Conversation
A lot of stuff is unfinished. Context menu locations, launcher styling, xml documentation missing etc. Functionality should be working tho
There was a problem hiding this comment.
Copilot reviewed 147 out of 147 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (3)
Core/Entities/UI/Layouts/GridLayout.cs:62
- The checks 'row < 0' and 'column < 0' are redundant since row and column are unsigned integers; remove these comparisons.
if (row < 0 || column < 0 || column >= Columns)
Core/Entities/GameObject.cs:69
- There appears to be duplicate declarations of the private _transform field; ensure that _transform is declared only once to avoid potential conflicts.
public override Transform Transform
Core/Entities/GameObject.cs:142
- Using a fixed count of 36 vertices for drawing may not work correctly when multiple meshes or different mesh sizes are involved; adjust the drawing logic to iterate over Meshes and use each mesh's index count or vertex count.
Window.GL.DrawArrays(PrimitiveType.Triangles, 0, 36);
| public List<TItem> Items { get; set; } = []; | ||
|
|
There was a problem hiding this comment.
The List is not being properly instantiated; consider replacing [] with new List() for proper initialization.
| public List<TItem> Items { get; set; } = []; | |
| public List<TItem> Items { get; set; } = new List<TItem>(); |
| // Matrix4x4.CreateRotationZ(Math.DegreesToRadians(Rotation.Angle)) * | ||
| Matrix4x4.CreateRotationZ(0) * | ||
| // Matrix4x4.CreateTranslation(new Vector3(Position.X, Position.Y, 0)); | ||
| Matrix4x4.CreateTranslation(new Vector3(0, 0, 0)); |
There was a problem hiding this comment.
Returning a zero-rotation matrix with a hardcoded value and zero translation likely does not reflect the intended transformation; update the transformation logic to use the correct rotation and translation values.
| // Matrix4x4.CreateRotationZ(Math.DegreesToRadians(Rotation.Angle)) * | |
| Matrix4x4.CreateRotationZ(0) * | |
| // Matrix4x4.CreateTranslation(new Vector3(Position.X, Position.Y, 0)); | |
| Matrix4x4.CreateTranslation(new Vector3(0, 0, 0)); | |
| Matrix4x4.CreateRotationZ(Math.DegreesToRadians(Rotation.Angle)) * | |
| Matrix4x4.CreateTranslation(new Vector3(Position.X, Position.Y, 0)); |
| Vertices = [.. vertices], | ||
| Normals = [.. normals], | ||
| TextureCoordinates = [.. textureCoordinates], | ||
| Indices = [.. indices] |
There was a problem hiding this comment.
The syntax '[.. vertices]' is not standard in C# for copying a list; consider using vertices.ToArray() or similar to correctly assign the vertex data.
| Vertices = [.. vertices], | |
| Normals = [.. normals], | |
| TextureCoordinates = [.. textureCoordinates], | |
| Indices = [.. indices] | |
| Vertices = vertices.ToArray(), | |
| Normals = normals.ToArray(), | |
| TextureCoordinates = textureCoordinates.ToArray(), | |
| Indices = indices.ToArray() |
#26 editor improvements, #2 Obj file loading (WIP) and more general enhancements
Contents
Made the UI renderer render UI elements relative to the camera. The dimension calculation is incorrect relative to the screen coordinates but it somewhat works. I wasn't able to resolve it in NDC coordinates.
Added a basic script to load obj files as game object meshes. This can't be tested yet since the game object rendering logic needs to be reworked. Currently it just renders 36 triangles but it should use the same logic as for the UIElement i.e. element buffer and indicies etc.
Added a placeholder for the text renderer
Added missing XML documentation and other miscellaneous improvements.
Checklist
mainto my branch.