Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
minvr3.js
Advanced tools
Readme
This package provides communication bindings for MinVR3 in JavaScript. The biggest use case for JS MinVR3 bindings is communicating with web browsers, but other examples exist (Node.js servers, other apps written in React Native, custom JavaScript implementations like that used in Digistar planetarium software, etc.).
If you wish to communicate between Unity and a browser, you will need to install the MinVR3 WebSocket Plugin.
There are two parts to setting up communication between MinVR3 in Unity and the JavaScript client:
To get started on the Unity side, use the following steps in your Unity project:
HTTPListener
.HTTPListener
GameObject.web
. (we will create this directory later)0.0.0.0
to make the server
accessible to other computers on the network)To get started on the Browser side, use the following steps:
web
.web
folder, create a new file index.html
and paste the following contents:<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MinVR3 WebSocket Example</title>
</head>
<body>
This page is being served by Unity.
<script type="module">
// import the MinVR3.js browser script
import * as minvr3 from 'https://esm.run/minvr3.js@latest';
// connect to the websocket (await call returns after websocket connected)
const ws = await minvr3.connect(window.location.host);
// add a VR event listener
ws.onmessage = (msg) => {
console.log("got message from Unity: " + VREvent.fromJson(msg));
}
// send a VR event
let msg = new minvr3.VREventString('HelloEventName', 'Hello from the browser');
ws.send(msg.toJson());
// send another VR event
msg = new minvr3.VREventVector3('Position', new minvr3.Vector3(1, 2, 3));
ws.send(msg.toJson());
</script>
</body>
</html>
For more advanced usage such as sending/receiving VR events, please see the manual page "Remote Connections".
NPM module design inspired by https://adrianmanduc.medium.com/how-to-create-a-js-library-and-publish-it-to-npm-6e6351971984
To rebuild and publish the package, do:
npm install
npm run build
npm publish
FAQs
JavaScript companion for MinVR3
The npm package minvr3.js receives a total of 3 weekly downloads. As such, minvr3.js popularity was classified as not popular.
We found that minvr3.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.