Skip to content

Commit

Permalink
fix + update
Browse files Browse the repository at this point in the history
  • Loading branch information
NotBlue-Dev authored Jun 24, 2022
1 parent 4097bdc commit 0e2f746
Show file tree
Hide file tree
Showing 11 changed files with 3,381 additions and 1,995 deletions.
82 changes: 48 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
# Echo-VR-Haptics
Library : https://github.com/NotBlue-Dev/EchoVR-Lib

## About the project ?

Echo VR Haptics is an API based project, allowing you to use bhaptics products with echo arena

## Compatibility

Curently :
- X40
- X16
- Arms
- Face

## Event Feedback

- STUNNED
- GOAL
- GRAB
- HIT WALL
- BLOCKING
- HEARTBEAT
- POWER HAND
- BOOST

## How to install
https://www.youtube.com/watch?v=zLLdhn2b9l0&t=43s

## How it look like

![a](https://user-images.githubusercontent.com/64601123/130320688-c6943cdc-195a-4459-bc36-0e028be847ac.PNG)

![b](https://user-images.githubusercontent.com/64601123/130320687-1a3108f9-eab3-4ca2-9ae2-8f4204202c16.PNG)
# Echo-VR-Haptics

## What is that ?

Echo VR Haptics is an API based project, allowing you to use bhaptics products with echo arena

## Compatibility

Curently :
- X40
- X16

Coming soon :
- Arms
- Face

## Event Feedback

- STUNNED
- GOAL
- GRAB
- HIT WALL
- BLOCKING
- HEARTBEAT

Coming Soon :

- BREAK
- BOOST

## Issues

Your bhaptics player is running but it's saying it's not ?
- Restart the app

## Custom tact Files

go to ```resources/app/assets/```
Then you can change tact files but you need to keep the same name !!

## How to install
https://www.youtube.com/watch?v=zLLdhn2b9l0&t=43s

## How it look like

![a](https://user-images.githubusercontent.com/64601123/130320688-c6943cdc-195a-4459-bc36-0e028be847ac.PNG)

![b](https://user-images.githubusercontent.com/64601123/130320687-1a3108f9-eab3-4ca2-9ae2-8f4204202c16.PNG)
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ip":"localhost","effects":{"other":{"stunnedHead":{"intensity":1,"duration":1,"enable":true,"lock":false},"grabHand":{"intensity":1,"duration":1,"enable":true},"wallHead":{"intensity":1,"duration":1,"enable":true,"lock":false},"stunHand":{"intensity":1,"duration":1,"enable":true},"shieldHead":{"intensity":1,"duration":1,"enable":true,"lock":false},"shieldHand":{"intensity":1,"duration":1,"enable":false,"lock":false},"stunned":{"intensity":1,"duration":1,"enable":true,"lock":false}},"global":{"goal":{"intensity":1,"duration":1,"enable":true},"wall":{"intensity":1,"duration":1,"enable":true},"grab":{"intensity":1,"duration":1,"enable":true},"shield":{"intensity":1,"duration":1,"enable":true},"stun":{"intensity":1,"duration":1,"enable":true,"lock":false},"heart":{"intensity":1,"duration":1,"enable":true},"boost":{"intensity":1,"duration":1,"enable":true,"lock":false},"stunned":{"intensity":1,"duration":1,"enable":true,"lock":false},"powerHand":{"intensity":1,"duration":1,"enable":true,"lock":false}}}}
137 changes: 69 additions & 68 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
const { app, BrowserWindow, ipcMain } = require('electron')

const echo = require('./lib/index')

require('dotenv').config()
const dev = (process.env.NODE_ENV === 'development')

const start = (webContents) => {
const sendEvent = (channel, args) => {
if ((typeof webContents.send) === 'function') {
webContents.send(channel, args)
} else {
console.log('can not send event')
}
}

const listenEvent = (channel, callable) => {
ipcMain.on(channel, function (event, arg) {
callable(arg, event)
})
}

const player = new echo.TactPlayer(
new echo.BHapticsTactJsAdapter(),
new echo.IpFinder(),
new echo.ConfigLoader(__dirname),
sendEvent,
listenEvent
)
player.launch()
}

const createWindow = () => {
const mainWindow = new BrowserWindow({
width:685,
height:850,
resizable:false,
minimizable : false,
maximizable : false,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
},
frame:false,
title:'haptic',
})
mainWindow.loadFile('./view/main/index.html')
.then(() => {
dev && mainWindow.webContents.openDevTools()
start(mainWindow.webContents)
})
.catch((err) => console.error(err))
}

app.allowRendererProcessReuse = false;

app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
BrowserWindow.getAllWindows().length === 0 && createWindow()
})
})

app.on('window-all-closed', function () {
process.platform !== 'darwin' && app.quit()
})
const { app, BrowserWindow, ipcMain } = require('electron')

const echo = require('echomodlib')


require('dotenv').config()
const dev = (process.env.NODE_ENV === 'development')

const start = (webContents) => {
const sendEvent = (channel, args) => {
if ((typeof webContents.send) === 'function') {
webContents.send(channel, args)
} else {
console.log('can not send event')
}
}

const listenEvent = (channel, callable) => {
ipcMain.on(channel, function (event, arg) {
callable(arg, event)
})
}

const player = new echo.TactPlayer(
new echo.BHapticsTactJsAdapter(),
new echo.IpFinder(),
new echo.ConfigLoader(__dirname),
sendEvent,
listenEvent
)
player.launch()
}

const createWindow = () => {
const mainWindow = new BrowserWindow({
width:685,
height:850,
resizable:false,
minimizable : false,
maximizable : false,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
},
frame:false,
title:'haptic',
})
mainWindow.loadFile('./view/main/index.html')
.then(() => {
dev && mainWindow.webContents.openDevTools()
start(mainWindow.webContents)
})
.catch((err) => console.error(err))
}

app.allowRendererProcessReuse = false;

app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
BrowserWindow.getAllWindows().length === 0 && createWindow()
})
})

app.on('window-all-closed', function () {
process.platform !== 'darwin' && app.quit()
})
Loading

0 comments on commit 0e2f746

Please sign in to comment.