@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
26 lines (25 loc) • 1.05 kB
TypeScript
import { FC } from "react";
import { PublicProps } from "../utils/types-utils";
import { RigidBodyComponent } from "playcanvas";
/**
* Adding a RigidBody component to an entity allows it to participate in the physics simulation.
* Rigid bodies have mass, and can be moved around by forces. Ensure `usePhysics` is set on the Application
* to use this component.
*
* @param {RigidBodyProps} props - The props to pass to the rigid body component.
* @see https://api.playcanvas.com/engine/classes/RigidBodyComponent.html
* @example
* <Entity>
* <RigidBody type="box" />
* </Entity>
*/
export declare const RigidBody: FC<RigidBodyProps>;
interface RigidBodyProps extends Partial<PublicProps<RigidBodyComponent>> {
/**
* The shape of rigid body to create.
* A `<Render/>` component can have a different shape to the rigid body. This is useful if you want to have a visual representation of the rigid body.
* @default "box"
*/
type?: "box" | "capsule" | "compound" | "cone" | "cylinder" | "mesh" | "sphere";
}
export {};