-
Notifications
You must be signed in to change notification settings - Fork 0
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 #9 from poeticAndroid/glitch
Glitch
- Loading branch information
Showing
9 changed files
with
88 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# A-Frame components and stuff made by poeticAndroid! | ||
# A-Frame components made by poeticAndroid! | ||
|
||
```html | ||
<script type="text/javascript" src="https://aframe.io/releases/1.0.4/aframe.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-physics-system.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.6/components/utils.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.6/components/a-tiledwalls.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.6/components/a-locomotion.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.6/components/a-items.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.6/components/a-door.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.7/components/utils.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.7/components/a-tiledwalls.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.7/components/a-locomotion.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.7/components/a-items.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/poeticAndroid/poetic-aframe@v0.7/components/a-door.js"></script> | ||
``` | ||
|
||
[Click for demo!](https://poetic-aframe.glitch.me/) | ||
|
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 |
---|---|---|
@@ -1,39 +1,54 @@ | ||
a-items.js | ||
========== | ||
# a-items.js | ||
|
||
Components to facilitate grabbable and usable items. | ||
|
||
grabber | ||
------- | ||
## grabber | ||
|
||
Add the `grabber` component to your player rig like so: | ||
|
||
```html | ||
<a-entity id="player" grabber ></a-entity> | ||
<a-entity id="player" grabber></a-entity> | ||
``` | ||
|
||
This makes it possible to grab grabbable objects using the grab-button on a VR-controller, shoulder-button on gamepad, E-key on keyboard or long-tap on touchscreen. | ||
To use an item press the trigger on controller or gamepad, left mousebutton or tap on touchscreen. | ||
|
||
grabbable | ||
--------- | ||
## grabbable | ||
|
||
Add the `grabbable` component to any object you want the player to be able to pick up. | ||
|
||
```html | ||
<a-entity grabbable ></a-entity> | ||
<a-entity grabbable></a-entity> | ||
``` | ||
|
||
### Properties | ||
|
||
| Property | Description | Default | | ||
|-----------------|------------------------------------------------------------------------------------------------------|---------| | ||
| --------------- | ---------------------------------------------------------------------------------------------------- | ------- | | ||
| freeOrientation | When enabled grabbed object keep their orientation, otherwise it resets to same orientation as hand. | true | | ||
| dynamicBody | Whether or not to add `dynamic-body` component automatically. | true | | ||
|
||
### Events | ||
|
||
These event are emitted on the grabbable as well as the hand that initiated the event. | ||
|
||
| Event | Description | | ||
|---------|----------------------------------------------------------------| | ||
| ------- | -------------------------------------------------------------- | | ||
| grab | Emitted when grabbed. | | ||
| usedown | Emitted when use-button is pressed while holding this object. | | ||
| useup | Emitted when use-button is released while holding this object. | | ||
| drop | Emitted when dropped. | | ||
|
||
### Methods | ||
|
||
`hand` parameter is on of `"head"`(default), `"left"` or `"right"`. | ||
|
||
| Method | Description | | ||
| ---------------- | ----------------------------------------------------- | | ||
| toggleGrab(hand) | Drop if holding somethind, attempt to grab otherwise. | | ||
| grab(hand) | Attempt to grab something. | | ||
| use(hand) | Shortly use grabbable. | | ||
| useDown(hand) | Start using grabbable. | | ||
| useUp(hand) | Stop using grabbable. | | ||
| drop(hand) | Drop grabbable. | | ||
| dropObject(el) | Drop specified grabbable if held. | |
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
a-tiledwalls.js | ||
=============== | ||
component for help making walls or floors with tiled textures. | ||
# a-tiledwalls.js | ||
|
||
Component for help making walls or floors with tiled textures. | ||
|
||
## thickness | ||
|
||
thickness | ||
---------- | ||
Add the `thickness` component to your wall to resize it according to `material.repeat`. | ||
The following will make a brick wall that is 10 long, 3 heigh and 0.25 thick. | ||
|
||
```html | ||
<a-box thickness="0.25" src="#bricks" material="repeat: 10 3" ></a-box> | ||
<a-box thickness="0.25" src="#bricks" material="repeat: 10 3"></a-box> | ||
``` | ||
|
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