public bool getIntersectionTime(List <uint> phases, Ray ray, Vector3 endPos, float maxDist) { float distance = maxDist; DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phases); impl.intersectRay(ray, callback, ref distance, endPos); if (callback.didHit()) { maxDist = distance; } return(callback.didHit()); }
public bool GetIntersectionTime(Ray ray, Vector3 endPos, PhaseShift phaseShift, float maxDist) { float distance = maxDist; DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); impl.IntersectRay(ray, callback, ref distance, endPos); if (callback.DidHit()) { maxDist = distance; } return(callback.DidHit()); }
public bool isInLineOfSight(Vector3 startPos, Vector3 endPos, PhaseShift phaseShift) { float maxDist = (endPos - startPos).magnitude(); if (!MathFunctions.fuzzyGt(maxDist, 0)) { return(true); } Ray r = new Ray(startPos, (endPos - startPos) / maxDist); DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); impl.intersectRay(r, callback, ref maxDist, endPos); return(!callback.didHit()); }
public float getHeight(float x, float y, float z, float maxSearchDist, PhaseShift phaseShift) { Vector3 v = new Vector3(x, y, z + 0.5f); Ray r = new Ray(v, new Vector3(0, 0, -1)); DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); impl.intersectZAllignedRay(r, callback, ref maxSearchDist); if (callback.didHit()) { return(v.Z - maxSearchDist); } else { return(float.NegativeInfinity); } }