UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

24 lines (20 loc) 840 B
/** * Updates the debug display of a physics sim * * */ import {ParamlessBaseTriggerAndObjectJsNode} from './_BaseTriggerAndObject'; import {inputObject3D} from './_BaseObject3D'; import {JsLinesCollectionController} from './code/utils/JsLinesCollectionController'; import {Poly} from '../../Poly'; export class PhysicsDebugUpdateJsNode extends ParamlessBaseTriggerAndObjectJsNode { static override type() { return 'physicsDebugUpdate'; } override setTriggerableLines(shadersCollectionController: JsLinesCollectionController) { const object3D = inputObject3D(this, shadersCollectionController); const func = Poly.namedFunctionsRegister.getFunction('physicsDebugUpdate', this, shadersCollectionController); const bodyLine = func.asString(object3D); shadersCollectionController.addTriggerableLines(this, [bodyLine]); } }