UNPKG

@playcanvas/react

Version:

A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.

52 lines (50 loc) 1.26 kB
import { Scene, Sky } from "playcanvas"; import { PublicProps } from "../utils/types-utils.ts"; import { Asset } from "playcanvas"; /** * @beta * Environment component * The Environment component is used to set the environment lighting and skybox. * * @example * ```tsx * <Environment /> * ``` */ declare function Environment(props: EnvironmentProps): null; type SceneProps = Omit<Partial<PublicProps<Scene>>, 'skybox' | 'envAtlas'> & { /** * The skybox asset. * Used to set the skybox of the environment. */ skybox?: Asset | null; /** * The environment lighting. * Used to set the lighting of the environment. */ envAtlas?: Asset | null; }; type SkyProps = Omit<Partial<PublicProps<Sky>>, 'node' | 'center'> & { /** * The scale of the sky. */ scale?: [number, number, number]; /** * The position of the sky. */ position?: [number, number, number]; /** * The center of the sky. */ center?: [number, number, number]; /** * The rotation of the sky. */ rotation?: [number, number, number]; /** * Whether to show the skybox. */ showSkybox?: boolean; }; type EnvironmentProps = SkyProps & SceneProps; export { Environment };