directionalLightFrustumViewer.d.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import type { Camera } from "../Cameras/camera";
  2. import type { DirectionalLight } from "../Lights/directionalLight";
  3. import { Matrix } from "../Maths/math.vector";
  4. /**
  5. * Class used to render a debug view of the frustum for a directional light
  6. * @see https://playground.babylonjs.com/#7EFGSG#4
  7. * @since 5.0.0
  8. */
  9. export declare class DirectionalLightFrustumViewer {
  10. private _scene;
  11. private _light;
  12. private _camera;
  13. private _inverseViewMatrix;
  14. private _visible;
  15. private _rootNode;
  16. private _lightHelperFrustumMeshes;
  17. private _nearLinesPoints;
  18. private _farLinesPoints;
  19. private _trLinesPoints;
  20. private _brLinesPoints;
  21. private _tlLinesPoints;
  22. private _blLinesPoints;
  23. private _nearPlaneVertices;
  24. private _farPlaneVertices;
  25. private _rightPlaneVertices;
  26. private _leftPlaneVertices;
  27. private _topPlaneVertices;
  28. private _bottomPlaneVertices;
  29. private _oldPosition;
  30. private _oldDirection;
  31. private _oldAutoCalc;
  32. private _oldMinZ;
  33. private _oldMaxZ;
  34. private _transparency;
  35. /**
  36. * Gets or sets the transparency of the frustum planes
  37. */
  38. get transparency(): number;
  39. set transparency(alpha: number);
  40. private _showLines;
  41. /**
  42. * true to display the edges of the frustum
  43. */
  44. get showLines(): boolean;
  45. set showLines(show: boolean);
  46. private _showPlanes;
  47. /**
  48. * true to display the planes of the frustum
  49. */
  50. get showPlanes(): boolean;
  51. set showPlanes(show: boolean);
  52. /**
  53. * Creates a new frustum viewer
  54. * @param light directional light to display the frustum for
  55. * @param camera camera used to retrieve the minZ / maxZ values if the shadowMinZ/shadowMaxZ values of the light are not setup
  56. */
  57. constructor(light: DirectionalLight, camera: Camera);
  58. /**
  59. * Shows the frustum
  60. */
  61. show(): void;
  62. /**
  63. * Hides the frustum
  64. */
  65. hide(): void;
  66. /**
  67. * Updates the frustum.
  68. * Call this method to update the frustum view if the light has changed position/direction
  69. */
  70. update(): void;
  71. /**
  72. * Dispose of the class / remove the frustum view
  73. */
  74. dispose(): void;
  75. protected _createGeometry(): void;
  76. protected _getInvertViewMatrix(): Matrix;
  77. }