@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
21 lines (20 loc) • 905 B
TypeScript
import { FC } from "react";
import { CollisionComponent } from "playcanvas";
import { PublicProps } from "../utils/types-utils";
/**
* The Collision component adds a collider to the entity. This enables the entity to collide with other entities.
* You can manually define the shape of the collider with the `type` prop, or let the component infer the shape from a `Render` component.
* @param {CollisionProps} props - The props to pass to the collision component.
* @see https://api.playcanvas.com/engine/classes/CollisionComponent.html
*
* @example
* <Entity>
* <Collision type="box" />
* <Render /> // will infer the shape from the render component
* </Entity>
*/
export declare const Collision: FC<CollisionProps>;
interface CollisionProps extends Partial<PublicProps<CollisionComponent>> {
type?: "box" | "capsule" | "compound" | "cone" | "cylinder" | "mesh" | "sphere";
}
export {};