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.
ray-input
Advanced tools
Cross platform VR input capabilities. For desktop, mobile, Cardboard, Daydream and Vive.
Readme
Ray Input is a JavaScript library that provides an input abstraction for interacting with 3D VR content in the browser. It supports a variety of environments: desktop, mobile, and VR. In VR mode, behavior depends on if there's a motion controller, and whether the controller has positional tracking in addition to orientation tracking. For a higher level description of the library, see sane defaults for VR input.
Ray.js depends on THREE.js. You register interactive objects with Ray.js and subscribe to events on those objects. Events include:
raydown
: an object is activated (eg. clicked)rayup
: an object is deactivated (eg. finger lifted)raycancel
: something stops activation (eg. you mouse-scroll to look around)rayover
: an object is selected (eg. hovered on, looked at)rayout
: an object is no longer selected (eg. blurred, looked away from)Get the module from npm:
npm install ray-input
Then, in your code, import the ES6 module:
import RayInput from 'ray-input'
You can also use require.js:
require('./ray-input')
Or you can use the script standalone, but you may need to use new RayInput.default()
:
<script src="build/ray.min.js"></script>
How to instantiate the input library:
// Here, camera is an instance of THREE.Camera,
// If second HTMLElement arg is provided, it will be addEventListener'ed.
var input = new RayInput(camera, renderer.domElement);
How to register objects that can be interacted with:
input.add(object);
// Register a callback whenever an object is acted on.
input.on('raydown', (opt_mesh) => {
// Called when an object was activated. If there is a selected object,
// opt_mesh is that object.
});
// Register a callback when an object is selected.
input.on('rayover', (mesh) => {
// Called when an object was selected.
});
How to unregister objects so that they can't be interacted with:
input.remove(object);
How to set basic attributes on the input system:.
// Sets the size of the input surface for ray casting. Generally this is
// the same as the renderer.domElement.
input.setSize(renderer.getSize());
// Update the input system in a game loop.
input.update();
Open to pull requests that allow customization. Ideas include:
rayout
, while the foreground gets a rayover
.FAQs
Cross platform VR input capabilities. For desktop, mobile, Cardboard, Daydream and Vive.
The npm package ray-input receives a total of 1 weekly downloads. As such, ray-input popularity was classified as not popular.
We found that ray-input demonstrated a not healthy version release cadence and project activity because the last version was released 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.