Skip to content

Commit

Permalink
Merge pull request #46 from Byongho96/master
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
Byongho96 authored Jan 16, 2025
2 parents 9b8b907 + 716f3d8 commit 9c8694c
Show file tree
Hide file tree
Showing 40 changed files with 155 additions and 194 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,23 @@ jobs:

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/docs'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

- name: Deploy dist
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/docs'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: dist

- name: Deploy assets
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/docs'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./assets
destination_dir: assets
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

jobs:
release:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branches": ["main"],
"branches": ["release"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

**Three Game Controls** is a lightweight and versatile game control library built on top of [three.js](https://threejs.org). It provides essential physics engine capabilities, including gravity and collision detection, and supports interactions through various input devices.

- [Documentation](https://three-game-controls.vercel.app)
- [Examples](https://three-game-controls.vercel.app/examples)
- [Documentation](https://byongho96.github.io/three-game-controls/docs/#manual/Installation)
- [Examples](https://byongho96.github.io/three-game-controls/examples/#first-person_keyboard_controls)
- [Issues](https://github.com/Byongho96/three-game-controls/issues)


Expand All @@ -20,11 +20,11 @@

:bulb: **three.js >= 0.139.0** is a prerequisite.


* NPM
```bash
npm install three-game-controls
npm install three three-game-controls
```
<!-- or
or

* CDN
```html
Expand All @@ -33,11 +33,10 @@ npm install three-game-controls
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@<version>/build/three.module.js",
"three-game-controls": "https://cdn.jsdelivr.net/npm/three-game-controls@<version>/dist/bundle.esm.js"
"three-game-controls/assets/": "https://cdn.jsdelivr.net/npm/three-game-controls@<version>/dist/assets/" // if you need assets
}
}
</script>
``` -->
```

## Usage

Expand Down Expand Up @@ -84,7 +83,7 @@ scene.add( directionalLight );
let controls;

const gltfLoader = new GLTFLoader();
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/dist/assets/' );
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/assets/' );

gltfLoader.load( 'collision-world.glb', ( gltf ) => {

Expand Down Expand Up @@ -161,7 +160,7 @@ scene.add( directionalLight );
let controls;

const gltfLoader = new GLTFLoader();
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/dist/assets/' );
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/assets/' );

Promise.all( [
gltfLoader.loadAsync( 'collision-world.glb' ),
Expand Down
94 changes: 1 addition & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@
"animation"
],
"author": "Byongho Lee",
"license": "ISC",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Byongho96/three-game-controls"
},
"bugs": {
"url": "https://github.com/Byongho96/three-game-controls/issues"
},
"homepage": "https://byongho96.github.io/three-game-controls/",
"devDependencies": {
"@babel/core": "^7.25.7",
"@babel/preset-env": "^7.25.7",
Expand All @@ -69,7 +77,6 @@
"husky": "^8.0.0",
"lint-staged": "^15.2.10",
"rollup": "^2.79.2",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-delete": "^2.1.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-serve": "^1.1.1",
Expand Down
4 changes: 2 additions & 2 deletions public/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8" />
<title>GameControls docs</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<link rel="shortcut icon" href="../assets/favicon_white.ico" media="(prefers-color-scheme: dark)" />
<link rel="shortcut icon" href="../assets/favicon.ico" media="(prefers-color-scheme: light)" />
<link rel="shortcut icon" href="../files/favicon_white.ico" media="(prefers-color-scheme: dark)" />
<link rel="shortcut icon" href="../files/favicon.ico" media="(prefers-color-scheme: light)" />
<link rel="stylesheet" type="text/css" href="../index.css" />
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion public/docs/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Getting Started": {
"Overview": "manual/Overview",
"Installation": "manual/Installation",
"Quick Start": "manual/Quick-start",
"Quick Start": "manual/Quick-Start",
"Customization": "manual/Customization"
}
},
Expand Down
4 changes: 2 additions & 2 deletions public/docs/manual/Installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>NPM</h2>
yarn add three three-game-controls
</code>

<!-- <h2>CDN</h2>
<h2>CDN</h2>

<code>
&lt;script type="importmap"&gt;
Expand All @@ -37,7 +37,7 @@ <h2>NPM</h2>
}
}
&lt;/script&gt;
</code> -->
</code>

</body>
</html>
8 changes: 4 additions & 4 deletions public/docs/manual/Quick-Start.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>FirstPersonControls</h2>
</p>

<p>
To use FirstPersonControls, a <strong>background world mesh</strong> is required. For testing, you can use the sample mesh provided.
To use FirstPersonControls, a <strong>background world mesh</strong> is required. For testing, you can use [link:https://github.com/Byongho96/three-game-controls/tree/gh-pages/assets the sample mesh] provided.
</p>

<code>
Expand Down Expand Up @@ -64,7 +64,7 @@ <h2>FirstPersonControls</h2>
let controls;

const gltfLoader = new GLTFLoader();
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/dist/assets/' );
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/assets/' );

gltfLoader.load( 'collision-world.glb', ( gltf ) => {

Expand Down Expand Up @@ -106,7 +106,7 @@ <h2>ThirdPersonControls</h2>

<p>
In addition to the background world mesh, you need a character mesh with a skeletal structure and animation clip data.
These assets can be obtained from platforms like [link:https://www.mixamo.com/#/ Mixamo]. Sample assets are also available for testing.
These assets can be obtained from platforms like [link:https://www.mixamo.com/#/ Mixamo]. [link:https://github.com/Byongho96/three-game-controls/tree/gh-pages/assets Sample assets] are also available for testing.
</p>

<code>
Expand Down Expand Up @@ -147,7 +147,7 @@ <h2>ThirdPersonControls</h2>
let controls;

const gltfLoader = new GLTFLoader();
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/dist/assets/' );
gltfLoader.setPath( 'https://byongho96.github.io/three-game-controls/assets/' );

Promise.all( [
gltfLoader.loadAsync( 'collision-world.glb' ),
Expand Down
Loading

0 comments on commit 9c8694c

Please sign in to comment.