physicsEngineComponent.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import type { Nullable } from "../../types";
  2. import type { Observer } from "../../Misc/observable";
  3. import type { Vector3 } from "../../Maths/math.vector";
  4. import type { Node } from "../../node";
  5. import type { PhysicsBody } from "./physicsBody";
  6. import "../joinedPhysicsEngineComponent";
  7. declare module "../../Meshes/transformNode" {
  8. /**
  9. *
  10. */
  11. /** @internal */
  12. interface TransformNode {
  13. /** @internal */
  14. _physicsBody: Nullable<PhysicsBody>;
  15. /**
  16. * @see
  17. */
  18. physicsBody: Nullable<PhysicsBody>;
  19. /**
  20. *
  21. */
  22. getPhysicsBody(): Nullable<PhysicsBody>;
  23. /** Apply a physic impulse to the mesh
  24. * @param force defines the force to apply
  25. * @param contactPoint defines where to apply the force
  26. * @returns the current mesh
  27. */
  28. applyImpulse(force: Vector3, contactPoint: Vector3): TransformNode;
  29. /** Apply a physic angular impulse to the mesh
  30. * @param angularImpulse defines the torque to apply
  31. * @returns the current mesh
  32. */
  33. applyAngularImpulse(angularImpulse: Vector3): TransformNode;
  34. /** @internal */
  35. _disposePhysicsObserver: Nullable<Observer<Node>>;
  36. }
  37. }