UNPKG

@playcanvas/react

Version:

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

21 lines (20 loc) 760 B
import { StandardMaterial } from 'playcanvas'; import { PublicProps, Serializable } from '../utils/types-utils.ts'; /** * This hook is used to create a material instance and update its properties when the props change. * @param {Materialrops} props - The props to pass to the material. * @returns {StandardMaterial} material - The material instance. * @see https://api.playcanvas.com/engine/classes/StandardMaterial.html * * @example * const material = useMaterial({ * diffuse: 'red', * opacity: 0.5, * }); * * // use the material * <Render type="box" material={material} /> */ export declare const useMaterial: (props: MaterialProps) => StandardMaterial; type MaterialProps = Partial<Serializable<PublicProps<StandardMaterial>>>; export {};