ObjectManager Find method and SceneObject Enabled

rated by 0 users
This post has 3 Replies | 2 Followers

Top 10 Contributor
Posts 1,104
SunBurn_Community_Licensee
SunBurn_Contributor
SunBurn_Pro_Licensee
Philippe Da Silva Posted: 06-21-2010 1:11 PM

Hi,

My guess is that setting a SceneObject Visibility property to None means this SceneObject won't be returned by the ObjectManager.Find method if setting the ObjectVisibility to EnabledDynamicAndStatic.

However, it still seems to be returned. Am I wrong in guessing this way? And if so, what should I do to Disable a SceneObject?

Thanks

Philippe

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi Philippe,

The Enabled flag is ignored when searching for scene objects, it's only considered when searching for lights (which have well defined enabled / disabled states via the Enabled property).

We ignore this filter when searching for scene objects, so the scene graph can easily be used for collision, path finding, and other techniques that may require active but non-renderable objects.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 10 Contributor
Posts 1,104
SunBurn_Community_Licensee
SunBurn_Contributor
SunBurn_Pro_Licensee

Too bad it doesn't follow the same rules ;)

I would find this quite useful as I'm using multiple SceneObjects for one single Entity (for LOD) and having an Enabled/Disabled property getter/setter would allow me to handle a lot of SceneGraph features such as Find for instance.

Could you consider adding this to the SceneObject?

Philippe

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi Philippe,

The object search follows the same rules, it's just SceneObject doesn't have an Enabled property.

We can certainly add the property, in fact I believe this is required for some new features we're rolling out in the next SunBurn version.  With the new property you can completely disable objects while still in the scenegraph, or leave them enabled and non-renderable. It provides a lot of possibilities.

Another option for LOD is to use one SceneObject and swap out the meshes depending on the LOD level.  This is one of the scenarios we designed the new mesh Adding / Removing / Clearing around.  Though there is a small bug with propagating the World transforms to meshes added after the transform is set (will be fixed in the next update) - to avoid this you can set the transform to identity then restore it after swapping the meshes.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Page 1 of 1 (4 items) | RSS