Ejemplo n.º 1
0
        public void FloorPick(Ray ray, Action <List <ISpatialObject> > callback)
        {
            var transformedRay = new Ray(WorldRoot.InverseTransformPoint(ray.origin), WorldRoot.InverseTransformDirection(ray.direction));

            // narrow down the possible objects using the spatial picker
            SpatialPickerAsync.Pick(transformedRay, callback);
        }
Ejemplo n.º 2
0
        public void Pick(Vector3[] samplePoints, int samplePointCount, Action <List <Tuple <GameObject, RaycastHit> > > callback, string[] flagsExcluded = null)
        {
            PrePickSamplePoints(samplePoints, samplePointCount);

            // narrow down the possible objects using the spatial picker
            SpatialPickerAsync.Pick(samplePoints, samplePointCount, list =>
            {
                PreRaycast(list);
                var results = new List <Tuple <GameObject, RaycastHit> >();
                RaycastSamplePointsInternal(results);
                PostRaycast(results);
                callback(results);
            }, flagsExcluded);
        }
Ejemplo n.º 3
0
        public void Pick(Ray ray, Action <List <Tuple <GameObject, RaycastHit> > > callback, string[] flagsExcluded = null)
        {
            var transformedRay = new Ray(WorldRoot.InverseTransformPoint(ray.origin), WorldRoot.InverseTransformDirection(ray.direction));

            // narrow down the possible objects using the spatial picker
            SpatialPickerAsync.Pick(transformedRay, list =>
            {
                PreRaycast(list);
                var results = new List <Tuple <GameObject, RaycastHit> >();
                RaycastInternal(ray, results);
                PostRaycast(results);
                callback(results);
            }, flagsExcluded);
        }
Ejemplo n.º 4
0
        public void Pick(Vector3 origin, float distance, Action <List <Tuple <GameObject, RaycastHit> > > callback, string[] flagsExcluded = null)
        {
            SpatialPickerAsync.Pick(origin, distance, list =>
            {
                var results = new List <Tuple <GameObject, RaycastHit> >();
                foreach (var spatialObject in list)
                {
                    if (spatialObject.LoadedObject == null)
                    {
                        continue;
                    }

                    results.Add(new Tuple <GameObject, RaycastHit>(spatialObject.LoadedObject, k_BlankRaycastHit));
                }

                callback(results);
            }, flagsExcluded);
        }