UNPKG

react-babylonjs

Version:
15 lines (14 loc) 837 B
import { PhysicsAggregate } from '@babylonjs/core/Physics/v2/physicsAggregate.js'; import { Scene } from '@babylonjs/core/scene.js'; import { Nullable } from '@babylonjs/core/types.js'; import { CreatedInstance } from '../CreatedInstance'; import DeferredCreationLifecycleListener from './DeferredCreationLifecycleListener'; /** * There is a lot going on in the PhysicsImpostor constructor, so we delay instantiation so that we have a target * 'object' before creation. */ export default class PhysicsImpostorLifecycleListener extends DeferredCreationLifecycleListener<PhysicsAggregate, any> { private _parent; createInstance: (instance: CreatedInstance<PhysicsAggregate>, scene: Scene, props: any) => Nullable<PhysicsAggregate>; onParented(parent: CreatedInstance<any>, child: CreatedInstance<any>): any; }