hemisphericLight.d.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import type { Nullable } from "../types";
  2. import type { Scene } from "../scene";
  3. import { Matrix, Vector3 } from "../Maths/math.vector";
  4. import { Color3 } from "../Maths/math.color";
  5. import type { Effect } from "../Materials/effect";
  6. import { Light } from "./light";
  7. import type { IShadowGenerator } from "./Shadows/shadowGenerator";
  8. /**
  9. * The HemisphericLight simulates the ambient environment light,
  10. * so the passed direction is the light reflection direction, not the incoming direction.
  11. */
  12. export declare class HemisphericLight extends Light {
  13. /**
  14. * The groundColor is the light in the opposite direction to the one specified during creation.
  15. * You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction.
  16. */
  17. groundColor: Color3;
  18. /**
  19. * The light reflection direction, not the incoming direction.
  20. */
  21. direction: Vector3;
  22. /**
  23. * Creates a HemisphericLight object in the scene according to the passed direction (Vector3).
  24. * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.
  25. * The HemisphericLight can't cast shadows.
  26. * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
  27. * @param name The friendly name of the light
  28. * @param direction The direction of the light reflection
  29. * @param scene The scene the light belongs to
  30. */
  31. constructor(name: string, direction: Vector3, scene?: Scene);
  32. protected _buildUniformLayout(): void;
  33. /**
  34. * Returns the string "HemisphericLight".
  35. * @returns The class name
  36. */
  37. getClassName(): string;
  38. /**
  39. * Sets the HemisphericLight direction towards the passed target (Vector3).
  40. * Returns the updated direction.
  41. * @param target The target the direction should point to
  42. * @returns The computed direction
  43. */
  44. setDirectionToTarget(target: Vector3): Vector3;
  45. /**
  46. * Returns the shadow generator associated to the light.
  47. * @returns Always null for hemispheric lights because it does not support shadows.
  48. */
  49. getShadowGenerator(): Nullable<IShadowGenerator>;
  50. /**
  51. * Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string).
  52. * @param _effect The effect to update
  53. * @param lightIndex The index of the light in the effect to update
  54. * @returns The hemispheric light
  55. */
  56. transferToEffect(_effect: Effect, lightIndex: string): HemisphericLight;
  57. transferToNodeMaterialEffect(effect: Effect, lightDataUniformName: string): this;
  58. /**
  59. * Computes the world matrix of the node
  60. * @returns the world matrix
  61. */
  62. computeWorldMatrix(): Matrix;
  63. /**
  64. * Returns the integer 3.
  65. * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
  66. */
  67. getTypeID(): number;
  68. /**
  69. * Prepares the list of defines specific to the light type.
  70. * @param defines the list of defines
  71. * @param lightIndex defines the index of the light for the effect
  72. */
  73. prepareLightSpecificDefines(defines: any, lightIndex: number): void;
  74. }