Torque X 2.0 and NoRenderMask
by Doug Demyen · in Torque Developer Network · 12/13/2008 (5:41 pm) · 2 replies
Hey, I noticed when going through the Airplane tutorial that it wasn't made with version 2.0. I checked the site to find the updated tutorial and continued from where I left off to find instead of using NoRenderMask to take the compass out of the main camera, it instead included everything else (which I assume were individually tagged).
It looks like NoRenderMask is no longer hooked up to anything, so I did it on my side by adding the code below:
List excludedObjects = new List();
FindObjects(sceneRect, noRenderMask, 0xFFFFFFFF, excludedObjects);
foreach (ISceneObject2D obj in excludedObjects)
{
_containerQueryResults.Remove(obj);
}
in T2DSceneGraph's _RenderObjects method, just below the FindObjects call. I assume the 3D code could be updated similarly by adding:
List excludedObjects = new List();
T3DSceneContainerQueryData queryData = new T3DSceneContainerQueryData();
queryData.WorldBox = _hasReflections ? new Box3F(-100000, -100000, -100000, 100000, 100000, 100000) : _frustum.Bounds;
queryData.ObjectTypes = noRenderMask;
queryData.IgnoreObject = null;
queryData.IgnoreObjects = null;
queryData.FindInvisible = false;
queryData.ResultList = excludedObjects;
_container.FindObjects(queryData);
foreach (ISceneObject3D obj in excludedObjects)
{
_containerQueryResults.Remove(obj);
}
in T3DSceneGraph's _RenderObjects method just below FindObjects.
Obviously this is just quick and dirty (speaking of which, is there a method or property for "is this object, this type?" that I'm not aware of?). I was wondering if NoRenderMask would be hooked up at some point, or if there's a reason it's currently left out? Thanks!
It looks like NoRenderMask is no longer hooked up to anything, so I did it on my side by adding the code below:
List
FindObjects(sceneRect, noRenderMask, 0xFFFFFFFF, excludedObjects);
foreach (ISceneObject2D obj in excludedObjects)
{
_containerQueryResults.Remove(obj);
}
in T2DSceneGraph's _RenderObjects method, just below the FindObjects call. I assume the 3D code could be updated similarly by adding:
List
T3DSceneContainerQueryData queryData = new T3DSceneContainerQueryData();
queryData.WorldBox = _hasReflections ? new Box3F(-100000, -100000, -100000, 100000, 100000, 100000) : _frustum.Bounds;
queryData.ObjectTypes = noRenderMask;
queryData.IgnoreObject = null;
queryData.IgnoreObjects = null;
queryData.FindInvisible = false;
queryData.ResultList = excludedObjects;
_container.FindObjects(queryData);
foreach (ISceneObject3D obj in excludedObjects)
{
_containerQueryResults.Remove(obj);
}
in T3DSceneGraph's _RenderObjects method just below FindObjects.
Obviously this is just quick and dirty (speaking of which, is there a method or property for "is this object, this type?" that I'm not aware of?). I was wondering if NoRenderMask would be hooked up at some point, or if there's a reason it's currently left out? Thanks!
Torque Owner Rich Hudson