Possible bug in DefaultRaySceneQuery


Topic related to current development efforts on the core engine and demos

Veteran

Posts: 82

Joined: Tue Mar 10, 2009 10:01 am

Post Thu Nov 12, 2009 6:27 pm

Possible bug in DefaultRaySceneQuery

Hi,i was testing RayScene queries into Axiom,but i found that mouse picking using DefautlRaySceneQUery doesn't work:
  Code:

/// <summary>
    ///    Default implementation of RaySceneQuery.
    /// </summary>
    /// <remarks>
    /// Note that becuase we have no scene partitioning, we actually
    /// perform a complete scene search even if restricted results are
    /// requested; smarter scene manager queries can utilise the paritioning
    /// of the scene in order to reduce the number of intersection tests
    /// required to fulfil the query
    /// </remarks>
    public class DefaultRaySceneQuery : RaySceneQuery
    {
        protected internal DefaultRaySceneQuery( SceneManager creator )
            : base( creator )
        {
            // No world geometry results supported
            this.AddWorldFragmentType( WorldFragmentType.None );
        }

        public override void Execute( IRaySceneQueryListener listener )
        {
            MovableObjectFactoryMap factories = Root.Instance.MovableObjectFactories;
            foreach ( KeyValuePair<string, MovableObjectFactory> map in factories )
            {
                MovableObjectCollection movableObjects = this.creator.GetMovableObjectCollection( map.Value.Type );
                foreach ( MovableObject movableObject in movableObjects )
                {
                    // skip group if query type doesn't match
                    if ( ( this.QueryTypeMask & movableObject.TypeFlags ) != 0 )
                    {
                        break;
                    }
....


The line if ( ( this.QueryTypeMask & movableObject.TypeFlags ) != 0 ) should be == 0 and not != 0 as ogre expression is:
  Code:
// skip whole group if type doesn't match
if (!(a->getTypeFlags() & mQueryTypeMask))
   break;


Test it out

Veteran

Posts: 82

Joined: Tue Mar 10, 2009 10:01 am

Post Mon Nov 16, 2009 10:00 am

Re: Possible bug in DefaultRaySceneQuery

As i saw this was fixed on SVN,revision 1888 :)
User avatar

Site Admin

Posts: 1270

Joined: Thu Mar 02, 2006 11:29 pm

Location: Boston, MA, USA

Post Mon Nov 16, 2009 10:48 am

Re: Possible bug in DefaultRaySceneQuery

Yes,
I circled back to it because it was the root cause of stencil shadows not rendering correctly. Thanks for pointing it out, it helped a lot when tracking that down.
Borrillis
The Steward of Axiom

Veteran

Posts: 82

Joined: Tue Mar 10, 2009 10:01 am

Post Mon Nov 16, 2009 11:12 am

Re: Possible bug in DefaultRaySceneQuery

Glad i help you out there!! You're welcome man :)

Return to Engine Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.