Skip to content

Avoids HTTPS/HTTP conflicts, and linking to out-of-date documentation. #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AmmoDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ The Ammo.js driver provides many features and new functionality that the existin

## Installation

Initial installation is the same as for Cannon.js. See: [Scripts](https://github.com/donmccurdy/aframe-physics-system/blob/master/README.md#installation), then see [Including the Ammo.js Build](#including-the-ammojs-build).
Initial installation is the same as for Cannon.js. See: [Scripts](README.md#installation), then see [Including the Ammo.js Build](#including-the-ammojs-build).

### Including the Ammo.js build

Ammo.js is not a dependency of this project. As a result, it must be included into your project manually. Recommended options are: [script tag](#script-tag) or [NPM and Webpack](#npm-and-webpack).
The latest [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) build is available either via the [Ammo.js github](http://kripken.github.io/ammo.js/builds/ammo.wasm.js) (`http://kripken.github.io/ammo.js/builds/ammo.wasm.js`) or the [Mozilla Reality fork](https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js) (`https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js`) created by the [Mozilla Hubs](https://github.com/mozilla/hubs) team. The latter is especially optimized for use with the Ammo Driver and includes [some functionality](#hacd-and-vhacd) not yet available in the main repository.
The latest [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) build is available either via the [Ammo.js github](https://kripken.github.io/ammo.js/builds/ammo.wasm.js) (`https://kripken.github.io/ammo.js/builds/ammo.wasm.js`) or the [Mozilla Reality fork](https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js) (`https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js`) created by the [Mozilla Hubs](https://github.com/mozilla/hubs) team. The latter is especially optimized for use with the Ammo Driver and includes [some functionality](#hacd-and-vhacd) not yet available in the main repository.

#### Script Tag

Expand All @@ -39,7 +39,7 @@ This is the easiest way to include Ammo.js in your project and is recommended fo
```html
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
or
<script src="http://kripken.github.io/ammo.js/builds/ammo.wasm.js"></script>
<script src="https://kripken.github.io/ammo.js/builds/ammo.wasm.js"></script>
```

Then, add `aframe-physics-system` itself, also with a script tag:
Expand Down Expand Up @@ -255,7 +255,7 @@ Any entity with an `ammo-body` component can also have 1 or more `ammo-shape` co
- **Cone** (`cone`) – Requires `halfExtents` if using `fit: manual`. Use `cylinderAxis` to change which axis the point of the cone is aligned.
- **Hull** (`hull`) – Wraps a model in a convex hull, like a shrink-wrap. Not quite as performant as primitives, but still very fast.
- **Hull Approximate Convex Decomposition** (`hacd`) – This is an experimental feature that generates multiple convex hulls to approximate any convex or concave shape.
- **Volumetric Hull Approximate Convex Decomposition** (`vhacd`) – Also experimental, this is `hacd` with a different algorithm. See: http://kmamou.blogspot.com/2014/11/v-hacd-v20-is-here.html for more information.
- **Volumetric Hull Approximate Convex Decomposition** (`vhacd`) – Also experimental, this is `hacd` with a different algorithm. See: https://kmamou.blogspot.com/2014/11/v-hacd-v20-is-here.html for more information.
- **Mesh** (`mesh`) – Creates a 1:1 concave collision shape with the triangles of the meshes of the entity. May only be used on `static` bodies. This is the least performant shape, however they can work very well for static environments if the following is observed:
- Avoid using meshes with very high triangle density relative to size of convex objects (primitives and hulls) colliding with the mesh. E.g. avoid meshes where an object could collide with dozens or more triangles in a single spot.
- Avoid very high poly meshes in general and use mesh decimation (simplification) if possible.
Expand Down
12 changes: 6 additions & 6 deletions CannonDriver.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cannon Driver

[CANNON.js](http://schteppe.github.io/cannon.js/) is a native JavaScript physics library, which is one of the available choices of driver in aframe-physics-system
[CANNON.js](https://schteppe.github.io/cannon.js/) is a native JavaScript physics library, which is one of the available choices of driver in aframe-physics-system

This page describes how to use aframe-physics-system with the Cannon Driver

Expand Down Expand Up @@ -30,14 +30,14 @@ npm install --save @c-frame/aframe-physics-system
require('aframe-physics-system');
```

Once installed, you'll need to compile your JavaScript using something like [Browserify](http://browserify.org/) or [Webpack](http://webpack.github.io/). Example:
Once installed, you'll need to compile your JavaScript using something like [Browserify](https://browserify.org/) or [Webpack](https://webpack.github.io/). Example:

```bash
npm install -g browserify
browserify my-app.js -o bundle.js
```

`bundle.js` may then be included in your page. See [here](http://browserify.org/#middle-section) for a better introduction to Browserify.
`bundle.js` may then be included in your page. See [here](https://browserify.org/#middle-section) for a better introduction to Browserify.

#### npm + webpack

Expand Down Expand Up @@ -204,7 +204,7 @@ Example:

## Using the CANNON.js API

For more advanced physics, use the CANNON.js API with custom JavaScript and A-Frame components. The [CANNON.js documentation](http://schteppe.github.io/cannon.js/docs/) and source code offer good resources for learning to work with physics in JavaScript.
For more advanced physics, use the CANNON.js API with custom JavaScript and A-Frame components. The [CANNON.js documentation](https://schteppe.github.io/cannon.js/docs/) and source code offer good resources for learning to work with physics in JavaScript.

In A-Frame, each entity's `CANNON.Body` instance is exposed on the `el.body` property. To apply a quick push to an object, you might do the following:

Expand Down Expand Up @@ -291,9 +291,9 @@ More advanced configuration, including specifying different collision behaviors

Resources:

* [CANNON.World](http://schteppe.github.io/cannon.js/docs/classes/World.html)
* [CANNON.World](https://schteppe.github.io/cannon.js/docs/classes/World.html)

* [CANNON.ContactMaterial](http://schteppe.github.io/cannon.js/docs/classes/ContactMaterial.html)
* [CANNON.ContactMaterial](https://schteppe.github.io/cannon.js/docs/classes/ContactMaterial.html)


## Statistics
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A C-Frame fork, collectively maintained by the A-Frame community. Also see [the
-->
Components for A-Frame physics integration.

Supports [CANNON.js](http://schteppe.github.io/cannon.js/) and [Ammo.js](https://github.com/kripken/ammo.js/). See
Supports [CANNON.js](https://schteppe.github.io/cannon.js/) and [Ammo.js](https://github.com/kripken/ammo.js/). See
[examples](https://c-frame.github.io/aframe-physics-system/examples/).

## Contents
Expand Down
6 changes: 3 additions & 3 deletions examples/ammo/compound.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Compound AMMO</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
Expand All @@ -31,10 +31,10 @@
geometry="primitive: circle; radius: 0.01; segments: 4;"
material="color: #FF4444; shader: flat"></a-entity>
</a-entity>
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: left" grab></a-entity>
<a-entity id="right-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: right" grab></a-entity>
hand-controls="hand: right" grab></a-entity>

<!-- Terrain -->
<a-box width="75" height="0.1" depth="75" ammo-body="type: static" ammo-shape visible="false"></a-box>
Expand Down
4 changes: 2 additions & 2 deletions examples/ammo/constraints.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Constraints • AMMO</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-blink-controls.min.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions examples/ammo/materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Materials AMMO</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
Expand Down Expand Up @@ -32,10 +32,10 @@
geometry="primitive: circle; radius: 0.01; segments: 4;"
material="color: #FF4444; shader: flat"></a-entity>
</a-entity>
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: left" grab></a-entity>
<a-entity id="right-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: right" grab></a-entity>
hand-controls="hand: right" grab></a-entity>

<!-- Terrain -->
<a-box width="75" height="0.1" depth="75" ammo-body="type: static; restitution:1" ammo-shape visible="false"></a-box>
Expand Down
2 changes: 1 addition & 1 deletion examples/ammo/perf.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>Physics Benchmark Test - Ammo</title>
<meta name="description" content="Physics Benchamrk Test - Ammo">
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<script src="../components/pinboard.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/ammo/sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Examples • AMMO</title>
<meta name="description" content="Hello, WebVR! - A-Frame" />
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<link rel="stylesheet" href="../styles.css">
Expand Down
2 changes: 1 addition & 1 deletion examples/ammo/spring.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Spring AMMO</title>
<script type="text/javascript" src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script type="text/javascript" src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<link rel="stylesheet" href="../styles.css">
Expand Down
6 changes: 3 additions & 3 deletions examples/ammo/stress.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Stress Test AMMO</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
Expand Down Expand Up @@ -34,10 +34,10 @@
material="color: #FF4444; shader: flat"></a-entity>
</a-entity>

<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: left" grab></a-entity>
<a-entity id="right-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: right" grab></a-entity>
hand-controls="hand: right" grab></a-entity>

<!-- Terrain -->
<a-box width="75" height="0.1" depth="75" ammo-body="type: static" ammo-shape visible="false"></a-box>
Expand Down
8 changes: 4 additions & 4 deletions examples/ammo/sweeper.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Sweeper AMMO</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
Expand All @@ -25,7 +25,7 @@
<a-scene environment
rain-of-entities="components: height|0.2, width|0.2, depth|0.2, ammo-body, ammo-shape, force-pushable, color|#39BB82; spread: 3"
physics="driver:ammo; stats: panel">
<!-- worker version (sweeper not working):
<!-- worker version (sweeper not working):
physics="driver: worker; workerFps: 60; workerInterpolate: true; workerInterpBufferSize: 2;"-->
<!-- Player -->
<a-entity camera wasd-controls look-controls position="0 0.6 0">
Expand All @@ -34,10 +34,10 @@
geometry="primitive: circle; radius: 0.01; segments: 4;"
material="color: #FF4444; shader: flat"></a-entity>
</a-entity>
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
<a-entity id="left-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: left" grab></a-entity>
<a-entity id="right-hand" ammo-body="type: kinematic; emitCollisionEvents: true" ammo-shape="type: sphere; fit: manual; sphereRadius: 0.02;"
hand-controls="hand: right" grab></a-entity>
hand-controls="hand: right" grab></a-entity>

<!-- Terrain -->
<a-box width="75" height="0.1" depth="75" ammo-body="type: static" ammo-shape visible="false"></a-box>
Expand Down
2 changes: 1 addition & 1 deletion examples/ammo/ttl.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Examples • TTL AMMO</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/MozillaReality/ammo.js@8bbc0ea/builds/ammo.wasm.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<link rel="stylesheet" href="../styles.css">
Expand Down
2 changes: 1 addition & 1 deletion examples/cannon-worker/compound.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Compound CANNON Worker</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<script src="../components/force-pushable.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/cannon-worker/constraints.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Constraints CANNON Worker</title>
<script type="text/javascript" src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script type="text/javascript" src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-blink-controls.min.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions examples/cannon-worker/materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Materials CANNON Worker</title>
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<script src="../components/force-pushable.js"></script>
Expand All @@ -23,7 +23,7 @@
<a-scene stats="true"
environment
physics="driver: worker; restitution: 1">
<!-- worker version (force-pushable not working):
<!-- worker version (force-pushable not working):
physics="driver: worker; restitution: 1;">-->
<!-- Player -->
<a-entity camera look-controls wasd-controls position="0 1.6 0">
Expand Down
2 changes: 1 addition & 1 deletion examples/cannon-worker/perf.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>Physics Benchmark Test - Cannon</title>
<meta name="description" content="Physics Benchamrk Test - Cannon Worker">
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
<script src="https://aframe.io/releases/1.4.1/aframe.min.js"></script>
<script src="../../dist/aframe-physics-system.js"></script>
<script src="../components/pinboard.js"></script>
<link rel="stylesheet" href="../styles.css">
Expand Down
Loading