aframe-super-hands-component | one natural hand controller , pointer , and gaze | Game Engine library
kandi X-RAY | aframe-super-hands-component Summary
kandi X-RAY | aframe-super-hands-component Summary
The goal of super-hands is to make it easy to handle user input in Web VR by providing a high-level API that is consistent across all devices. Instead of dealing directly with controller button events, raycasters, and collision detection components, you setup your scene and components instead to respond to 'gestures' like hovering and grabbing.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aframe-super-hands-component
aframe-super-hands-component Key Features
aframe-super-hands-component Examples and Code Snippets
Community Discussions
Trending Discussions on aframe-super-hands-component
QUESTION
I am using the updated super-hands component in a-frame. I have replicated the basic example from the docs (see below).
...ANSWER
Answered 2018-Jul-27 at 16:42If you want the rotation without physics, you'll need to implement your own version of grabbable
that does the matrix math. It would go something like this:
QUESTION
I'm making an A-Frame project which will allow users to interact with math models. I'm using the aframe-super-hands-component
with aframe-physics-extras
for its nice "sleep" effect. To add a layer of control, I'm trying to make it so that the user can use a controller's joysticks to bring a model closer/farther away from the controller, similar to the Oculus Dash controls (https://youtu.be/sMjlM5vFSA0?t=1m55s).
However, when I try to update a model's position, as my model entities are defined as dynamic bodies, they don't move. I know that I can remove the dynamic-body
component, move the body, and then reattach dynamic-body
, but I want to avoid that as I'm planning to move models in tick
. Is there a way I can move a dynamic body without breaking dynamic-body
behavior?
Here's a link to an example which tries to update a box's position: https://codepen.io/kchen1250/pen/MBmRYo
...ANSWER
Answered 2018-Jul-24 at 15:29You can sync the position of the entity and the dynamic-body
using the dynamic-body
s method syncToPhysics()
QUESTION
I am trying to recreate a stripped back version of the superhands
/physics
a-frame demo here
All the grabbing/dragging/physics works well but I cannot get the droppable
box to fire the event on collision with the draggable
one.
Here is a fiddle with my code (with all the scripts its quite long) but please let me know if you would like me to copy the code here.
I'm sure I am missing something simple here but I can't see it, I feel like I have everything that the original example has but I can't get that event to fire, not even to log something to the console.
This is my first venture into physics and controllers so apologies if I'm making some rookie errors. I should mention that I am testing initially on desktop using mouse to drag, hoping that getting the basics working here will scale up to the headsets.
Advice much appreciated as ever.
...ANSWER
Answered 2018-May-02 at 17:50In your current config, you have only the grabbable box, but not the droppable target, visible for collision detection:
QUESTION
I'm trying to move an object (in this case a piece of bread), using super-hands, but the object isn't moving when grabbed. There is no interaction between the controllers and the object.
...ANSWER
Answered 2017-Dec-14 at 00:44Entities with dynamic bodies can only be moved through the physics system, so grabbable
handles the movement with a physics constraint
(assuming you have added a static-body
to the controller entity or allowed progressive-controls
to do it for you). However, a dynamic-body
with mass: 0
, as you have it, is immovable (it's actually treated as a static-body
by the physics engine).
If you want to keep the body from falling, set physics="gravity: 0
instead. To keep it from floating away, set damping values on the body component closer to 1.
QUESTION
I'm trying to recreate an electrical particle (Electrons, Neutrons, Protons) in A-Frame (Science). I'm using to represent a charged particle, and I'm using super-hands to move it around. I created a custom component that attracts or repel according to charges (Refresher: Opposite charges attract; similar charges repel).
Each sphere is floating (position="0 1 0"), and the user shall grab it and move it close to another sphere to see the attraction or repulsion effect.
So far, the attraction and repelling are working. My only caveat is that the overlaps whenever I drag it with super-hands to another
a-sphere
. I know this is the default behavior of all the elements. I've been trying to use aframe-physics-system to prevent elements from overlapping.
Since I need the a-sphere
to hover, I add the static-body
to them (I've noticed that this doesn't prevent overlapping). Whenever I try to grab them using the HTC Vive controller, it seems that the controller has some sort of collider that interacts with the static-body, pushing it around. If I manage to grab it, it starts spinning the sphere out of control (Probably because it's interacting with the Vive Controller), and it launches it away (Pretty funny, to be honest ).
I also tried setting the gravity to zero, but this poses a problem: it affects the whole scene (Can't have normal physics afterwards). In addition, whenever the sphere gets hit by another body, it will move indefinitely to the direction the force was applied to.
When I look at the examples from: https://wmurphyrd.github.io/aframe-super-hands-component/examples/physics/
I see that William uses dynamic-body. Unfortunately, that puts them into the ground.
Any ideas on how to tackle this problem? I just want to make the sphere non-overlappable and that the user is allowed to throw it while it's hovering.
Here's the code:
...ANSWER
Answered 2017-Nov-29 at 04:06You can solve the problem of the controller's physics body colliding with things and making them near impossible to grab using collision-filter
from aframe-physics-extras
:
QUESTION
In MathworldVR project (https://github.com/michaltakac/mathworldvr) I'm using aframe-super-hands-component
which fires 'hover-start'
and 'hover-end'
events when user hits/leaves the entity with VR hand controllers. Everything is working as expected.
But how can I call these events from within tests? I cannot simulate those with TestUtils
from react-dom/test-utils
when A-Frame entity is rendered with Enzyme
's shallow
, react-test-renderer
's renderer
or Jest, since it only can simulate traditional React events.
CalcButton component code:
...ANSWER
Answered 2017-Apr-17 at 18:15For actual browser testing, I would use Karma Test Runner. Check out aframe-react's test harness: https://github.com/aframevr/aframe-react/tree/master/tests/browser. There are React tests which test React rendering and React-level stuff, and browser tests which test full integration including events.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aframe-super-hands-component
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page