prepRenderImage not called on SceneObject
by J Helleman · in Torque 3D Professional · 03/27/2011 (5:04 pm) · 3 replies
Hi,
I made a class in C++ that derrives from the SceneObject class. I created a SimObject for it in TorqueScript and it gets through the onAdd.
But after that it does tick but doesn't get called on the prepRenderImage function.
Does anyone know why prepRenderImage doesn't get called?
Thanks guys,
Jan
I made a class in C++ that derrives from the SceneObject class. I created a SimObject for it in TorqueScript and it gets through the onAdd.
bool Manager::onAdd()
{
if(!Parent::onAdd())
return false;
onAdd_callback( getId() );
addToScene();
Con::printf("added to scene!");
// Set up a 1x1x1 bounding box
mObjBox.set( Point3F( -0.5f, -0.5f, -0.5f ),
Point3F( 0.5f, 0.5f, 0.5f ) );
Parent::setPosition(Point3F(0.0152232, 0.016707, 3.68072));
_updateShouldTick();
return true;
}But after that it does tick but doesn't get called on the prepRenderImage function.
bool Manager::prepRenderImage(SceneState* state, const U32 stateKey,
const U32 /*startZone*/, const bool /*modifyBaseState*/)
{
Con::printf("TEST?!");
return false;
}Does anyone know why prepRenderImage doesn't get called?
Thanks guys,
Jan
#2
03/28/2011 (9:09 am)
Which typemasks are you applying to your object on the constructor?
#3
03/28/2011 (10:20 am)
Lol your reply was different before :P I was totally confused :)Manager::Manager()
{
// Don't ghost by default.
mNetFlags.set(Ghostable | ScopeAlways);
}But I guess this is not the way to go. I wanted to do it this way to gain easy access to specific render parameters easily (camera frustum etc) but since depending on the bounding box prepRenderImage is called it will not be executed each frame, so I have to come up with a different idea...
Torque 3D Owner J Helleman