custom sceneobject questions

Started by Oz 1 post 73 views

Reply on sbox.game
  1. #1
    Oz 100
    So I'm exploring the engine a bit more and currently want to create my own scene object. It's a basic grid-mesh that I'm rendering using Graphics.Draw with 2 GPUBuffers for the vertices and indices.  This works but there's a few things I'm struggling with:

    1. How can I make sure the scene objects transform is updated alongside the gameobjects? I got it working by updating the transform in PeRender but I'm not sure that's the right way. I've looked at the built-in renderers and didn't quite get it yet.

    2. How can I make sure my custom scene object works with the debug wireframe mode. Everything else shows wireframe, except my object.

    3. How can I make sure when I press 'F' in the editor it zooms in correctly. I assume it had to do with IHasBounds, I've implemented it, but it's still treating it as an infinitely small point at the pivot.

    Thanks!