/// <summary>
        /// Queues a raycast
        /// </summary>
        /// <param name="position">Origin of Ray</param>
        /// <param name="direction">Ray normal</param>
        /// <param name="length">Ray length</param>
        /// <param name="retMethod">Return method to send the results</param>
        public void QueueRequest(Vector3 position, Vector3 direction, float length, RayCallback retMethod)
        {
            ODERayRequest req = new ODERayRequest();
            req.geom = IntPtr.Zero;
            req.callbackMethod = retMethod;
            req.Count = 0;
            req.length = length;
            req.Normal = direction;
            req.Origin = position;

            m_PendingRequests.Enqueue(req);
        }
Пример #2
0
 public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
 {
     if (retMethod != null)
         retMethod(new List<ContactResult>());
 }
 public override void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count,
                                   RayCallback retMethod)
 {
     if (retMethod != null)
     {
         m_rayCastManager.QueueRequest(position, direction, length, Count, retMethod);
     }
 }
        /// <summary>
        /// Queues a raycast
        /// </summary>
        /// <param name="position">Origin of Ray</param>
        /// <param name="direction">Ray normal</param>
        /// <param name="length">Ray length</param>
        /// <param name="count"></param>
        /// <param name="retMethod">Return method to send the results</param>
        public void QueueRequest(Vector3 position, Vector3 direction, float length, int count, RayCallback retMethod)
        {
            lock (m_PendingRequests)
            {
                ODERayRequest req = new ODERayRequest();
                req.callbackMethod = retMethod;
                req.length = length;
                req.Normal = direction;
                req.Origin = position;
                req.Count = count;

                m_PendingRayRequests.Add(req);
            }
        }
        /// <summary>
        ///     Queues a raycast
        /// </summary>
        /// <param name="position">Origin of Ray</param>
        /// <param name="direction">Ray normal</param>
        /// <param name="length">Ray length</param>
        /// <param name="count">Ray count</param>
        /// <param name="retMethod">Return method to send the results</param>
        public void QueueRequest(Vector3 position, Vector3 direction, float length, int count, RayCallback retMethod)
        {
            lock (m_PendingRayRequests)
            {
                ODERayRequest req = new ODERayRequest
                                        {
                                            CallbackMethod = retMethod,
                                            Length = length,
                                            Normal = direction,
                                            Origin = position,
                                            Count = count
                                        };

                m_PendingRayRequests.Add(req);
            }
        }
Пример #6
0
        public override void RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
        {
            if (retMethod != null && actor != null)
            {
                IntPtr geom;
                if (actor is OdePrim)
                    geom = ((OdePrim)actor).prim_geom;
                else if (actor is OdeCharacter)
                    geom = ((OdePrim)actor).prim_geom;
                else
                    return;
                if (geom == IntPtr.Zero)
                    return;

                m_rayCastManager.QueueRequest(geom,position, direction, length, Count, retMethod);
            }
        }
Пример #7
0
        public override void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
        {
            if (retMethod != null)
            {
                ODERayRequest req = new ODERayRequest();
                req.actor = null;
                req.callbackMethod = retMethod;
                req.length = length;
                req.Normal = direction;
                req.Origin = position;
                req.Count = Count;
                req.filter = RayFilterFlags.AllPrims;

                m_rayCastManager.QueueRequest(req);
            }
        }