-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from Byongho96/master
release
- Loading branch information
Showing
24 changed files
with
672 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../../" /> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
<h1>[name]</h1> | ||
|
||
<p class="desc"> | ||
A mixin that extends `FirstPersonControls` to add device orientation-based controls. This mixin uses device gyroscope data to control actions along the X, Y, and Z axes, enabling motion-based interactions. | ||
</p> | ||
|
||
<h2>Constructor</h2> | ||
|
||
<h3>[name]( [param:FirstPersonControls base] )</h3> | ||
<p> | ||
[page:FirstPersonControls base] — A class that extends `FirstPersonControls`. | ||
</p> | ||
|
||
<h2>Properties</h2> | ||
|
||
<h3>[property:Array gyroXActions]</h3> | ||
<p> | ||
An array of actions triggered by gyroscope movement along the X-axis. Default is `['MOVE_BACKWARD']`. | ||
</p> | ||
|
||
<h3>[property:Number gyroXOffset]</h3> | ||
<p> | ||
Reference value for the gyroscope's X-axis orientation. Default: `0`. | ||
</p> | ||
|
||
<h3>[property:Number gyroXMultiplier]</h3> | ||
<p> | ||
The multiplier for the x-axis orientation. Default: `0.1`. | ||
</p> | ||
|
||
<h3>[property:Array gyroYActions]</h3> | ||
<p> | ||
An array of actions triggered by gyroscope movement along the Y-axis. Default is `['MOVE_RIGHTWARD']`. | ||
</p> | ||
|
||
<h3>[property:Number gyroYOffset]</h3> | ||
<p> | ||
Reference value for the gyroscope's Y-axis orientation. Default: `0`. | ||
</p> | ||
|
||
<h3>[property:Number gyroYMultiplier]</h3> | ||
<p> | ||
The multiplier for the y-axis orientation. Default: `0.1`. | ||
</p> | ||
|
||
<h3>[property:Array gyroZActions]</h3> | ||
<p> | ||
An array of actions triggered by gyroscope movement along the Z-axis. Default is `[]`. | ||
</p> | ||
|
||
<h3>[property:Number gyroZOffset]</h3> | ||
<p> | ||
Reference value for the gyroscope's Z-axis orientation. Default: `0`. | ||
</p> | ||
|
||
|
||
<h3>[property:Number gyroZMultiplier]</h3> | ||
<p> | ||
The multiplier for the z-axis orientation. Default: `0.1`. | ||
</p> | ||
|
||
<h3>[property:Boolean needsResetOrientation]</h3> | ||
<p> | ||
Determines whether the reference values for orientation (`gyroXOffset`, `gyroYOffset`, `gyroZOffset`) should be reset on the next device orientation event. Default: `true`. | ||
</p> | ||
|
||
<h2>Methods</h2> | ||
|
||
<h3>[method:void connect]()</h3> | ||
<p> | ||
Connects the drag functionality by adding event listeners. | ||
</p> | ||
|
||
<h3>[method:void disconnect]()</h3> | ||
<p> | ||
Disconnects the drag functionality by removing event listeners. | ||
</p> | ||
|
||
<h3>[method:void dispose]()</h3> | ||
<p> | ||
Disposes of the drag functionality by cleaning up event listeners and resources. | ||
</p> | ||
|
||
<h2>Source</h2> | ||
|
||
<p>[link:https://github.com/Byongho96/three-game-controls/blob/master/src/mixins/GyroMixin.ts mixins/GyroMixin.ts]</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"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" | ||
"three-game-controls": "../../dist/bundle.esm.js" | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"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" | ||
"three-game-controls": "../../dist/bundle.esm.js" | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"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" | ||
"three-game-controls": "../../dist/bundle.esm.js" | ||
} | ||
} | ||
</script> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> | ||
<link type="text/css" rel="stylesheet" href="../main.css" /> | ||
<link type="text/css" rel="stylesheet" href="./styles.css" /> | ||
</head> | ||
<body> | ||
<div id="info">Kill the monsters by clicking on them</div> | ||
|
@@ -16,7 +17,7 @@ | |
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"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" | ||
"three-game-controls": "../../../dist/bundle.esm.js" | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> | ||
<link type="text/css" rel="stylesheet" href="main.css" /> | ||
<link type="text/css" rel="stylesheet" href="./styles.css" /> | ||
</head> | ||
<body> | ||
<div id="info">Kill the monsters by clicking on them</div> | ||
|
@@ -16,7 +17,7 @@ | |
"imports": { | ||
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js", | ||
"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" | ||
"three-game-controls": "../../../dist/bundle.esm.js" | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#cross { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
width: 50px; | ||
height: 50px; | ||
pointer-events: none; | ||
} | ||
#cross::before, | ||
#cross::after { | ||
content: ''; | ||
position: absolute; | ||
background-color: rgba(68, 68, 68, 0.61); | ||
} | ||
#cross::before { | ||
top: 0; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
width: 4px; | ||
height: 100%; | ||
} | ||
#cross::after { | ||
top: 50%; | ||
left: 0; | ||
transform: translateY(-50%); | ||
width: 100%; | ||
height: 4px; | ||
} |
Oops, something went wrong.