phecdaDia / Singularity

Awful Monogame 3D Engine
2 stars 0 forks source link

Octree Children Bug #131

Closed phecdaDia closed 6 years ago

phecdaDia commented 6 years ago

Describe the bug In our game we have an object that has the following children hierarchy : (Top Object) (Translation) (Translation | Scale) (Translation | Rotation) and the Octree spews errors at us.

To Reproduce Steps to reproduce the behavior:

  1. Create an object with the following Hierarchy: (Translation) (Translation | Scale) (Translation | Rotation)

Expected behavior Everything works‽

Screenshots Screenshot of our object 2018-08-17_14-44-30

Desktop (please complete the following information):

phecdaDia commented 6 years ago

Unable to replicate in ST with the current information.

phecdaDia commented 6 years ago

The error was in line 146, GameScene.cs where GameObject.Position was used instead of GameObject.GetHierarchyPosition() which caused the children to be added to the wrong octree. image Additionally there was a bug in the octree that caused the children octrees to have the wrong coordinates.

Both have been fixed.

phecdaDia commented 6 years ago

Still giving error in game:

Something went wrong in the octree!
Found Object in OT: {X:0 Y:0 Z:16} {X:8 Y:8 Z:24}
Octree Information: 2 / 2
Expected position: {X:4.896117 Y:0.5739011 Z:15.86808}
phecdaDia commented 6 years ago

The error comes from a bad implementation of our Camera.