Game Development Community

ShapeBase render question

by Gerald Fishel · in Torque Game Engine Advanced · 12/27/2008 (11:49 am) · 1 replies

Hi all,

Currently I'm trying to extend ShapeBase in a way similar to the "Item" class. I got it almost working, but there's a quirk that I haven't been able to figure out yet.

When I add an instance of my shape to the scene, it works fine. Then I save the mission, and close and restart the game, and when the mission loads, the item is not visible. All of the collision detection works on it, but the mesh is not being rendered.

If I invoke the world editor, and select the item from the tree control, I can see the bounding box rendered, but still no mesh.

Now if I move the item with the gizmo, then it will start rendering correctly. But only if I use the mouse to move it. If I change the position in the inspector and click Apply, the bounding box moves but it still doesn't render the mesh.

Is there some kind of flag that needs to be set?

I set a breakpoint on prepRenderImage, and it's being called as expected, and if I step into the meat of it I don't see anything noticeably wrong.

I'm going to continue hacking away at it, but just wondering if somebody might know what could cause this.

Thanks,
Gerald

#1
12/27/2008 (8:36 pm)
Okay, I figured out the problem. I copied the Item/ItemData classes and then gutted all of the Item specific stuff, and didn't realize that passing the world position was necessary in packUpdate/unpackUpdate. I just assumed it was being done from ShapeBase. Once again proving that what they say about assuming is true ;)