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.
vr_controls
Advanced tools
Readme
This package utilize loading, selection gamepads models for current vr device, positioning them relative head.
Typescript ready.
Install package: npm i vr_controls
Include models in your bundle:
webpack
, you should copy models directory somewhere in your destination directory.custom copy plugin
, instead of CopyWebpackPlugin
, because, the 2nd one has some problems when copying gltf`s .bin file.
...
plugins: [
...
{
apply: (cmplr) => {
cmplr.hooks.afterEmit.tap("MyCopyPlug", (cmpln) => {
let from = path.join(__dirname, "node_modules", "vr_controls", "lib", "gamepad");
let to = path.join(__dirname, "dist", "models", "gamepad");
let files = fs.readdirSync(from);
for (let i = 0; i < files.length; i++) {
fs.copyFileSync(
path.join(from, files[i]),
path.join(to, files[i]));
}
console.log("custom copy applied");
})
}
},
...
]
In this case, files from gamepad
folder will be copied into __dirname/dist/models/gamepad
, where dist
-- is my destination folder.VRModelsLoader
-- Utility for vr models loading and parse them.VRControls
-- Gets native gamepads and serialzie its into handy wrappersVRGamepadData
-- Handy native gamepad data wrapper, serialize data into three.js typesVRManager
-- Utility for enter/exit vr events, detect current vr mode, current device detectionVRBodyDefault
-- basic implementation of vr body, that automatically handle 3dof and 6 dof gamepads. If there is 3dof gamepads -- Body will pose them with virtual arm. If 6dof - will pose them as it is.GamepadModelsNames
-- dictionary for gamepads models names.HMDsNames
-- dictionary for known head mounted devices.You can use package in default
and custom
way.
In any case, first of all, you should initialize VRManager, and pass the gamepad model path (in dist folder) into VRModelsLoader
.
VRManager.Init(YourRenderer);
VRModelsLoader.ModelsGLTFUrl = "models/gamepad";
...
In the example above, this path specified, because webpack
will copy models in this(models/gamepad
) folder, and my dist looks like this:
Example of default way:
Body
will automatically pose gamepads, depends on their DOF.
let body = new VRBodyDefault();
yourUpdateLoop(() => {
body.UpdateGamepadsData(Renderer.vr.getStandingMatrix());
body.UpdatePose(MainScene, HeadObject);
});
The body.Hands[]
contains instances of Object3D, that used as posing points. Gamepads 3d models snaps on them.
It is safe, to replace them with body.ReplaceHand(...)
, on your own objects at the run time.
Hands[0]
- left hand; Hands[1]
- right hand
Custom way:
...description in progress
FAQs
This package utilize loading, selection gamepads models for current vr device, positioning them relative head. Typescript ready. ### Supported devices: 1. Lenovo DayDream 2. Oculus Rift 3. Oculus Go 4. Oculus Quest 5. Gear VR 6. HTC Vive 7. Win
The npm package vr_controls receives a total of 1 weekly downloads. As such, vr_controls popularity was classified as not popular.
We found that vr_controls 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.