@milk-ecs/physx
TypeScript icon, indicating that this package has built-in type declarations

1.0.24 • Public • Published

Milk + PhysX


📦 PhysX Package for Milk.

🔧 Getting started

import { setupPhysx, PhysXPhysicsSystem, PhysXBody, PhysXBox } from '@milk-ecs/physx';

// Ensure to run `setupPhysx` before starting the engine (loads WASM)
setupPhysx().then(() => {
	new Engine();
});

// Add the PhysX system
engine.addSystem(new PhysXPhysicsSystem());

// Creating a simple box
const entity = new Entity();
entity.add(Transform);
entity.add(PhysXBody);
entity.add(PhysXBox, {
    size: Vector3.Equal(1 / 2)
});

🔎 Using PhysX Debugger

  1. Use the Profile build of PhysX
  2. Setup PhysX with a PVDGenerator
    • setupPhysx(createPhysXDebuggerFile(...))
    • setupPhysx(createPhysXDebuggerWebsocket(...))
    • setupPhysx(createPhysXDebuggerTCP(...))

WebSocket Debugger

  1. Create a Websocket -> TCP proxy via websockify 8090 127.0.0.1:5425

TCP on remote server

  1. Create a reverse port-forward ssh -R 8090:127.0.0.1:5425 dev.milkshake.io

Compiling

Only supports building through docker, although you can easily cd into the submodule and run the shell scripts yourself.

  1. yarn compile
  2. yarn build

Readme

Keywords

none

Package Sidebar

Install

npm i @milk-ecs/physx

Weekly Downloads

31

Version

1.0.24

License

MIT

Unpacked Size

19.3 MB

Total Files

30

Last publish

Collaborators

  • vieo
  • andrewmunro