Game Development Community

Rendering tied to collision state

by Tom Spilman · in Torque Game Engine · 03/14/2006 (5:57 pm) · 0 replies

I was having an issue where my character would stop rendering during a special movement mode i setup. I spent a few hours beating my head on the desk over this. Finally i found this...

void Container::findObjects(const Box3F& box, U32 mask, FindCallback callback, void *key)
{
   // blah blah blah
      // blah blah blah
         // blah blah blah
            // blah blah blah

               if ((chain->object->getType() & mask) != 0 &&
                   chain->object->isCollisionEnabled())
               {
                    // add me to the callback.
               }

  // blah
}

Well SceneGraph::buildSceneTree() uses gClientContainer.findObjects() to decide what objects in the scene to render. Since in my I have a mode where my character has it's collision disabled, it wasn't being rendered.

It seems to me that there isn't a good reason to have rendering tied to collision in this way. I know Container::findObjects() is called by some collision code, so it seems that adding a "cullOnCollision" may be in order here.

Thoughts?

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.