[Bug 1.0.1] RenderShapeExample Doesn't Render (w/ Fix) - RESOLVED
by Ryan Mounts · in Torque 3D Professional · 11/12/2009 (11:41 am) · 2 replies
I had a piece of code working that created a TSStatic in c++. I wanted to try out the RenderShapeExample to customize it for my project, so I simply swapped the TSStatic for a RenderShapeExample. The object did not render. After debugging for a bit, it was clear that the shape was never getting created client-side. In RenderShapeExample, the only place the shape gets created is in packUpdate (server-side) and unpackUpdate (client-side). The problem is that in unpackUpdate, the client will only create the shape if it has already been properly added to the scene. When the RenderShapeExample object is initially created server-side, however, it sends its first packet before OnAdd() gets called client-side. Therefore, the shape never gets created client-side because it is not properly added when it gets the packet.
Anyway, if that was all confusing, it's easy to fix. Simply add "createShape();" somewhere in RenderShapeExample::onAdd() to give the object a chance to create its shape when added to the scene. This is the way TSStatic does it.
It's not a big bug, but a rendering example is not very useful if it doesn't work. :)
Anyway, if that was all confusing, it's easy to fix. Simply add "createShape();" somewhere in RenderShapeExample::onAdd() to give the object a chance to create its shape when added to the scene. This is the way TSStatic does it.
It's not a big bug, but a rendering example is not very useful if it doesn't work. :)
Associate James Ford
Sickhead Games
Logged as THREED-808