@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
19 lines • 968 B
JavaScript
"use client";
import { useComponent } from "../hooks";
import { Entity } from "playcanvas";
import { validatePropsWithDefaults, createComponentDefinition, getStaticNullApplication } from "../utils/validation";
/**
* The GSplat component allows an entity to render a Gaussian Splat.
* @param {GSplatProps} props - The props to pass to the GSplat component.
* @see https://api.playcanvas.com/engine/classes/GSplatComponent.html
* @example
* const { data: splat } = useSplat('./splat.ply')
* <GSplat asset={splat} />
*/
export const GSplat = (props) => {
const safeProps = validatePropsWithDefaults(props, componentDefinition);
useComponent("gsplat", safeProps, componentDefinition.schema);
return null;
};
const componentDefinition = createComponentDefinition("GSplat", () => new Entity("mock-gsplat", getStaticNullApplication()).addComponent('gsplat'), (component) => component.system.destroy(), "GSplatComponent");
//# sourceMappingURL=GSplat.js.map