private List <Plane> GetPlanesOnWhichOrientedBoxResides(OrientedBox worldOrientedBox) { if (HasCursorPickedTerrainObject()) { List <Vector3> boxCenterAndCornerPoints = worldOrientedBox.GetCenterAndCornerPoints(); var planes = new List <Plane>(boxCenterAndCornerPoints.Count); Octave3DColliderRayHit colliderRayHit; Octave3DCollider hitCollider = _cursorRayHit.ClosestObjectRayHit.HitCollider; foreach (Vector3 boxPoint in boxCenterAndCornerPoints) { Ray ray = new Ray(boxPoint, Normal); if (hitCollider.RaycastBothDirections(ray, out colliderRayHit)) { planes.Add(new Plane(colliderRayHit.HitNormal, colliderRayHit.HitPoint)); } else { planes.Add(Plane); } } return(planes); } return(new List <Plane> { Plane }); }
public Octave3DColliderRayHit(Ray ray, float hitEnter, Vector3 hitPoint, Vector3 hitNormal, Octave3DCollider hitCollider) { _ray = ray; _hitEnter = hitEnter; _hitCollider = hitCollider; _hitPoint = hitPoint; _hitNormal = hitNormal; _hitNormal.Normalize(); }
public PointsOnColliderProjector(Octave3DCollider collider, Plane planeOfPointsToProject) { _collider = collider; _planeOfPointsToProject = planeOfPointsToProject; }