@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
27 lines (26 loc) • 1.03 kB
TypeScript
import { FC } from "react";
import { PublicProps, Serializable } from "../utils/types-utils.ts";
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>;
declare const rigidBodyTypes: readonly ["static", "dynamic", "kinematic"];
type RigidBodyType = typeof rigidBodyTypes[number];
interface RigidBodyProps extends Partial<Serializable<PublicProps<RigidBodyComponent>>> {
/**
* Sets the rigid body type determines how the body is simulated.
* @default "static"
*/
type?: RigidBodyType;
}
export {};