aframe-physics-system | Physics system for A-Frame VR , built on CANNON.js | Augmented Reality library
kandi X-RAY | aframe-physics-system Summary
kandi X-RAY | aframe-physics-system Summary
Physics system for A-Frame VR, built on CANNON.js.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Construct a Body .
- Creates a new Driver
- Constructs a new world .
- Add two points
- Creates a Cylinder .
- Base class for broadcast phase .
- Creates a new Polygon object .
- Construct a new height field .
- Creates a new lock constraint between two bodies together .
- Computes the intersection in a point in the polygon
aframe-physics-system Key Features
aframe-physics-system Examples and Code Snippets
Community Discussions
Trending Discussions on aframe-physics-system
QUESTION
I started making a game using Aframe 1.2.0 and Ammo.js because CANNON.js support may be deprecated in the future.
I have a very simple starting point - a static box - a dynamic sphere - click the sphere to fire - it should be bouncing off the box, but it just goes right through it. I've tried putting the shoot function into a component, but the same thing happens.
Glitch here -> https://descriptive-truthful-sneezeweed.glitch.me
...ANSWER
Answered 2021-Sep-24 at 14:07It seems the error is caused by the sphere having only the ammo-shape
component, without the body. If both are attached on click, then it's working as expected:
QUESTION
I'm trying to implement "bullet and target collision" problem and create an explosion when collision occurs. I managed to do it using aframe-physics-system
which was working good: the explosion was rendering at the exact point of the collision and in the exact time. Now I decided to get rid of the physics system as I don't need such overhead - my only goal is to render an explosion.
I tried to use box.containsPoint
as well as Raycaster
:
ANSWER
Answered 2021-Sep-16 at 17:19This is a common problem when trying to recreate the calculations of a physics engine. Since your bullet is too small and sometimes travels beyond the wall in between frames, I see two options:
- On frame
x+1
you could calculate how much distance has been traveled since framex
, and use that as the size of the bullet. If the plane is crossed in the distance travelled betweenx -> x1
, then you know you've had a collision. - If collision points don't move, you could use a
THREE.Raycaster
and calculate the point of collision pre-emptively, so you'll know where the bullet will hit before that point is reached:
QUESTION
I am creating a scene using A-frame (https://aframe.io) and I'm wondering how I can set the physics in my scene to variable using the A-frame physics component. What should happen is the physics inside my scene should be set to the value of my variabled called x. How can this be done?
Code to my scene: https://jsfiddle.net/AidanYoung/1cmgLkrp/2/ Code to the physics component: https://github.com/n5ro/aframe-physics-system
Now currently the physics in my scene is set using the tag and it's current set to -10. I want to change the physics to equal the variable x. Here is the part of my code where the physics is set:
ANSWER
Answered 2021-Jul-26 at 01:28You can set the gravity in the physics's driver
Set vertical gravity
QUESTION
I have asked this question before but I didn't ask it in the best way. I am trying to create a plinko-style aframe world with a ball that will have it's position reset to the starting position when clicked. I would like to have a button do this but clicking the ball will work. Here is the html I am working with:
...ANSWER
Answered 2021-Feb-09 at 08:02You need to synchronize the physics engine with the updated position. The dynamic-body
component has a syncToPhysics()
function:
QUESTION
The problem:
I want to make a ball the user can throw. With my current implementation, physics work but I cannot lift the ball. However, if I delete the "dynamic-body" I can grab the ball exactly as I am supposed to, and move it around. Heck, I tried changing it to "static-body" and it still works. The problem seems to be whenever I mix grabbable and dynamic-body. I know it should be possible in an older version, as I was using this tutorial: https://www.youtube.com/watch?v=SKYfYd3pk4I
However, he is using progressive-controls which are not available in the newest super-hands package, I don't know if that changes anything. Is there anything I am doing wrong here?
Here are my snippits of code that could affect the result:
My A-Frame packages:
...ANSWER
Answered 2020-Nov-19 at 03:10Thanks to this: https://github.com/bryik/aframe-ball-throw/blob/master/index.html
I found the culprit. I needed to add the static-body to my hand-entities, so that collision could be detected. No idea why collision was detected without them before though.
Modified code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aframe-physics-system
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