Skip to content

Commit

Permalink
Merge pull request #47 from Byongho96/master
Browse files Browse the repository at this point in the history
release
  • Loading branch information
Byongho96 authored Jan 16, 2025
2 parents 6bba3e3 + a1c2a58 commit b3fe67a
Show file tree
Hide file tree
Showing 38 changed files with 145 additions and 191 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
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.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,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
12 changes: 6 additions & 6 deletions public/docs/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
src:
local('Roboto Mono'),
local('RobotoMono-Regular'),
url('../assets/RobotoMono-Regular.woff2') format('woff2');
url('../files/RobotoMono-Regular.woff2') format('woff2');
font-style: normal;
font-weight: 400;
}
Expand All @@ -38,7 +38,7 @@
font-weight: 400;
src:
local('Inter-Regular'),
url('../assets/Inter-Regular.woff2?v=3.6') format('woff2');
url('../files/Inter-Regular.woff2?v=3.6') format('woff2');
}

@font-face {
Expand All @@ -47,7 +47,7 @@
font-weight: 600;
src:
local('Inter-SemiBold'),
url('../assets/Inter-SemiBold.woff2?v=3.6') format('woff2');
url('../files/Inter-SemiBold.woff2?v=3.6') format('woff2');
}

html {
Expand Down Expand Up @@ -183,7 +183,7 @@ code.inline {
width: 24px;
height: 24px;
background-color: transparent;
background-image: url('../assets/ic_copy_grey_24dp.svg');
background-image: url('../files/ic_copy_grey_24dp.svg');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
Expand All @@ -198,7 +198,7 @@ code.inline {
.copy-btn.copied {
pointer-events: none;
opacity: 1;
background-image: url('../assets/ic_tick_green_24dp.svg');
background-image: url('../files/ic_tick_green_24dp.svg');
}

table {
Expand Down Expand Up @@ -261,7 +261,7 @@ strong {
height: 44px;

background-color: #fff;
background-image: url('../assets/ic_mode_edit_black_24dp.svg');
background-image: url('../files/ic_mode_edit_black_24dp.svg');
background-size: 50%;
background-position: center;
background-repeat: no-repeat;
Expand Down
6 changes: 3 additions & 3 deletions public/examples/first-person_keyboard_controls.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<script type="importmap">
{
"imports": {
"three-game-controls": "../dist/bundle.esm.js",
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/"
"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
"three-game-controls": "https://cdn.jsdelivr.net/npm/three-game-controls/dist/bundle.esm.js"
}
}
</script>
Expand All @@ -42,7 +42,7 @@
let helpers;

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' ) ] ).then(
( [ world ] ) => {
Expand Down
Loading

0 comments on commit b3fe67a

Please sign in to comment.