Exemple #1
0
        public void WorldRayCast(Vector3D origin, Vector3D endPoint, EventHandler <CWorldRayFilterEventArgs> pWorldRayFilter, object userData, EventHandler <CWorldRayPreFilterEventArgs> pWorldRayPrefilter)
        {
            if (pWorldRayFilter != null)
            {
                m_WorldRayFilter       = new EventHandler <CWorldRayFilterEventArgs>(pWorldRayFilter);
                m_NewtonWorldRayFilter = new Newton.NewtonWorldRayFilterCallback(InvokeWorldRayFilter);
            }
            else
            {
                m_NewtonWorldRayFilter = null;
            }

            if (pWorldRayPrefilter != null)
            {
                m_WorldRayPrefilter       = new EventHandler <CWorldRayPreFilterEventArgs>(pWorldRayPrefilter);
                m_NewtonWorldRayPrefilter = new Newton.NewtonWorldRayPrefilterCallback(InvokeWorldRayPrefilter);
            }
            else
            {
                m_NewtonWorldRayPrefilter = null;
            }

            Newton.NewtonWorldRayCast(m_Handle,
                                      new NewtonVector3(origin).NWVector3,
                                      new NewtonVector3(endPoint).NWVector3,
                                      m_NewtonWorldRayFilter,
                                      (IntPtr)(userData ?? IntPtr.Zero),
                                      m_NewtonWorldRayPrefilter);
        }
Exemple #2
0
        public void WorldRayCast(Vector3D origin, Vector3D endPoint, EventHandler<CWorldRayFilterEventArgs> pWorldRayFilter, object userData, EventHandler<CWorldRayPreFilterEventArgs> pWorldRayPrefilter)
        {
            if (pWorldRayFilter != null)
            {
                m_WorldRayFilter = new EventHandler<CWorldRayFilterEventArgs>(pWorldRayFilter);
                m_NewtonWorldRayFilter = new Newton.NewtonWorldRayFilterCallback(InvokeWorldRayFilter);
            }
            else
                m_NewtonWorldRayFilter = null;

            if (pWorldRayPrefilter != null)
            {
                m_WorldRayPrefilter = new EventHandler<CWorldRayPreFilterEventArgs>(pWorldRayPrefilter);
                m_NewtonWorldRayPrefilter = new Newton.NewtonWorldRayPrefilterCallback(InvokeWorldRayPrefilter);
            }
            else
                m_NewtonWorldRayPrefilter = null;

            Newton.NewtonWorldRayCast(m_Handle,
                new NewtonVector3(origin).NWVector3,
                new NewtonVector3(endPoint).NWVector3,
                m_NewtonWorldRayFilter,
                (IntPtr)(userData ?? IntPtr.Zero),
                m_NewtonWorldRayPrefilter);
        }