public SpriteRayHit(Ray ray, float hitEnter, SpriteRenderer hitSpriteRenderer, Vector3 hitPoint, Vector3 hitNormal) { _ray = ray; _hitEnter = hitEnter; _hitSpriteRenderer = hitSpriteRenderer; _hitCollider = new Octave3DBoxCollider(hitSpriteRenderer.gameObject.GetWorldOrientedBox()); _hitPoint = hitPoint; _hitNormal = hitNormal; _hitNormal.Normalize(); }
public OrientedBoxRayHit(Ray ray, float hitEnter, OrientedBox hitBox) { _ray = ray; _hitEnter = hitEnter; _hitBox = new OrientedBox(hitBox); _hitCollider = new Octave3DBoxCollider(_hitBox); _hitPoint = ray.GetPoint(hitEnter); _hitFace = hitBox.GetBoxFaceClosestToPoint(_hitPoint); _hitNormal = hitBox.GetBoxFacePlane(_hitFace).normal; CorrectHitDataForThinPlanes(); }