@takram/three-atmosphere
Version:
A Three.js and R3F implementation of Precomputed Atmospheric Scattering
40 lines (39 loc) • 1.56 kB
TypeScript
import { ReactNode } from 'react';
import { Matrix4, Vector3 } from 'three';
import { Ellipsoid } from '@takram/three-geospatial';
import { PrecomputedTextures } from '../PrecomputedTexturesLoader';
import { AtmosphereOverlay, AtmosphereShadow, AtmosphereShadowLength } from '../types';
export interface AtmosphereTransientStates {
sunDirection: Vector3;
moonDirection: Vector3;
rotationMatrix: Matrix4;
ellipsoidCenter: Vector3;
ellipsoidMatrix: Matrix4;
overlay: AtmosphereOverlay | null;
shadow: AtmosphereShadow | null;
shadowLength: AtmosphereShadowLength | null;
}
/** @deprecated Use AtmosphereTransientStates instead. */
export interface AtmosphereTransientProps extends AtmosphereTransientStates {
}
export interface AtmosphereContextValue {
textures?: PrecomputedTextures | null;
ellipsoid?: Ellipsoid;
correctAltitude?: boolean;
photometric?: boolean;
transientStates?: AtmosphereTransientStates;
}
export declare const AtmosphereContext: import('react').Context<AtmosphereContextValue>;
export interface AtmosphereProps {
textures?: PrecomputedTextures | string;
ellipsoid?: Ellipsoid;
correctAltitude?: boolean;
photometric?: boolean;
date?: number | Date;
children?: ReactNode;
}
export interface AtmosphereApi extends AtmosphereTransientStates {
textures?: PrecomputedTextures;
updateByDate: (date: number | Date) => void;
}
export declare const Atmosphere: import('react').ForwardRefExoticComponent<AtmosphereProps & import('react').RefAttributes<AtmosphereApi>>;