proximityCastResult.js 744 B

12345678910111213141516171819202122232425262728293031
  1. import { CastingResult } from "./castingResult.js";
  2. /**
  3. * Class representing a contact point produced in a proximity cast
  4. */
  5. export class ProximityCastResult extends CastingResult {
  6. constructor() {
  7. super(...arguments);
  8. this._hitDistance = 0;
  9. }
  10. /**
  11. * Gets the distance from the hit
  12. */
  13. get hitDistance() {
  14. return this._hitDistance;
  15. }
  16. /**
  17. * Sets the distance from the start point to the hit point
  18. * @param distance
  19. */
  20. setHitDistance(distance) {
  21. this._hitDistance = distance;
  22. }
  23. /**
  24. * Resets all the values to default
  25. */
  26. reset() {
  27. super.reset();
  28. this._hitDistance = 0;
  29. }
  30. }
  31. //# sourceMappingURL=proximityCastResult.js.map