Example #1
0
		public List<RayQueryResult> RaycastSingle(Ray ray, RayQueryLevel level, float maxDistance, DrawableFlags drawableFlags, uint viewMask = UInt32.MaxValue)
		{
			List<RayQueryResult> result = new List<RayQueryResult>();

			int count;
			var ptr = Octree_RaycastSingle(Handle, ref ray, ref level, maxDistance, (uint)drawableFlags, viewMask, out count);

			if (ptr == IntPtr.Zero)
				return result;

			int structSize = Marshal.SizeOf(typeof (RayQueryResult));
			for (int i = 0; i < count; i++)
			{
				IntPtr data = new IntPtr(ptr.ToInt64() + structSize * i);
				RayQueryResult item = (RayQueryResult)Marshal.PtrToStructure(data, typeof(RayQueryResult));
				result.Add(item);
			}

			return result;
		} 
Example #2
0
        public List <RayQueryResult> RaycastSingle(Ray ray, RayQueryLevel level, float maxDistance, DrawableFlags drawableFlags, uint viewMask = UInt32.MaxValue)
        {
            List <RayQueryResult> result = new List <RayQueryResult>();

            int count;
            var ptr = Octree_RaycastSingle(Handle, ref ray, ref level, maxDistance, (uint)drawableFlags, viewMask, out count);

            if (ptr == IntPtr.Zero)
            {
                return(result);
            }

            int structSize = Marshal.SizeOf(typeof(RayQueryResult));

            for (int i = 0; i < count; i++)
            {
                IntPtr         data = new IntPtr(ptr.ToInt64() + structSize * i);
                RayQueryResult item = (RayQueryResult)Marshal.PtrToStructure(data, typeof(RayQueryResult));
                result.Add(item);
            }

            return(result);
        }
Example #3
0
 public List <RayQueryResult> RaycastSingle(Ray ray, RayQueryLevel level, float maxDistance, DrawableFlags drawableFlags, uint viewMask = UInt32.MaxValue)
 {
     Runtime.ValidateRefCounted(this);
     return(Raycast(ray, level, maxDistance, drawableFlags, true, viewMask));
 }
Example #4
0
        public RayQueryResult?RaycastSingle(Ray ray, RayQueryLevel level, float maxDistance, DrawableFlags drawableFlags, uint viewMask = UInt32.MaxValue)
        {
            Runtime.ValidateRefCounted(this);
            var result = Raycast(ray, level, maxDistance, drawableFlags, true, viewMask);

            if (result != null && result.Count > 0)
            {
                return(result[0]);
            }
            return(null);
        }
Example #5
0
 public List<RayQueryResult> RaycastSingle(Ray ray, RayQueryLevel level, float maxDistance, DrawableFlags drawableFlags, uint viewMask = UInt32.MaxValue)
 {
     Runtime.ValidateRefCounted(this);
     return Raycast(ray, level, maxDistance, drawableFlags, true, viewMask);
 }
Example #6
0
 public List <RayQueryResult> Raycast(Ray ray, RayQueryLevel level = RayQueryLevel.Triangle, float maxDistance = 10000, DrawableFlags drawableFlags = DrawableFlags.Geometry, uint viewMask = UInt32.MaxValue)
 {
     Runtime.ValidateRefCounted(this);
     return(Raycast(ray, level, maxDistance, drawableFlags, false, viewMask));
 }