You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,9 +33,7 @@ Or you can download via JSDelivr CDN (specifying the version number you want to
33
33
34
34
Install the dependency:
35
35
36
-
```sh
37
-
npm install @c-frame/physx
38
-
```
36
+
`npm install @c-frame/physx`
39
37
40
38
In your project import it:
41
39
@@ -75,7 +73,7 @@ Implements the a physics system using an emscripten compiled PhysX engine.
75
73
76
74
If `autoLoad` is `true`, or when you call `startPhysX()`, the `physx` system will automatically load and initialize the physics system with reasonable defaults and a ground plane. All you have to do is add [`physx-body`](#component-physx-body) to the bodies that you want to be part of the simulation. The system will take try to take care of things like collision meshes, position updates, etc automatically. The simplest physics scene looks something like:
@@ -89,8 +87,8 @@ If you want a little more control over how things behave, you can set the [`phys
89
87
90
88
If you need more low-level control, the PhysX bindings are exposed through the `PhysX` property of the system. So for instance, if you wanted to make use of the [`PxCapsuleGeometry`](https://nvidiagameworks.github.io/PhysX/4.1/documentation/physxapi/files/classPxCapsuleGeometry.html) in your own component, you would call:
91
89
92
-
```
93
-
let myGeometry = new this.el.sceneEl.systems.physx.PhysX.PxCapsuleGeometry(1.0, 2.0)
90
+
```js
91
+
let myGeometry =newthis.el.sceneEl.systems.physx.PhysX.PxCapsuleGeometry(1.0, 2.0)
94
92
```
95
93
96
94
The system uses [a fork](https://github.com/c-frame/PhysXSDK) of PhysX, built using the [Docker Wrapper](https://github.com/c-frame/physx-js). To see what's exposed to JavaScript, see [PxWebBindings.cpp](https://github.com/c-frame/PhysXSDK/blob/emscripten_wip/physx/source/physxwebbindings/src/PxWebBindings.cpp)
@@ -117,7 +115,7 @@ It is also helpful to refer to the [NVIDIA PhysX documentation](https://nvidiaga
@@ -175,7 +173,7 @@ When the component is initialized, and on the `object3dset` event, all visible m
175
173
176
174
Visible meshes can be excluded from this shape generation process by setting the `physx-no-collision` attribute on the corresponding `a-entity` element. Invisible meshes can be included into this shape generation process by settingt the `physx-hidden-collision` attribute on the corresponding `a-entity` element. This can be especially useful when using an external tool (like [Blender V-HACD](https://github.com/andyp123/blender_vhacd)) to create a low-poly convex collision mesh for a high-poly or concave mesh. This leads to this pattern for such cases:
0 commit comments