internal static float GetResponceWeight(ProxyForceRegionResponce responce) { switch (responce) { case ProxyForceRegionResponce.Nothing: return(0.0f); case ProxyForceRegionResponce.StayOutOf: case ProxyForceRegionResponce.AlignWithVolume: case ProxyForceRegionResponce.AlignWithEdge: return(1.0f); default: throw new System.NotImplementedException("Responce weight for : " + responce); } }
internal DistanceSample AdjustedForResponce(ProxyForceRegionResponce resp, Vector3 worldPoint, Pose sampleRegionPose) { var ans = this; ans.WorldPoint = worldPoint; if (resp == ProxyForceRegionResponce.StayOutOf) { if (Distance > 0.0f) { ans.HasSample = false; } else { // If pushing out, go other way if deeply overlapping if (Vector3.Dot(ToSurface, worldPoint - sampleRegionPose.position) > 0.0f) { ans.ToSurface *= -1.0f; } } } return(ans); }