A-Frame static-body on a-entity
up vote
0
down vote
favorite
I am trying out on aframe physics
I can apply static-body properties on a shape object:
<a-sphere color="red" width="2" height="2" depth="2" position="2 1 -5" rotation="45 0 0" static-body></a-sphere>
But not on a a-entity object, i am still able to move through the object:
<a-entity static-body obj-model="obj:models/lamp_mesh.obj;mtl:images/lamp_mesh.mtl" rotation="0 90 0" position="5.46 0 0" animation></a-entity>
Is it only possible to apply the static/dynamic properties on a shape object?
Or i have done something wrong somewhere
I seen many tutorials of physics on shape object but none on a-entity object.
Please advice.
Thanks in advance.
html aframe
add a comment |
up vote
0
down vote
favorite
I am trying out on aframe physics
I can apply static-body properties on a shape object:
<a-sphere color="red" width="2" height="2" depth="2" position="2 1 -5" rotation="45 0 0" static-body></a-sphere>
But not on a a-entity object, i am still able to move through the object:
<a-entity static-body obj-model="obj:models/lamp_mesh.obj;mtl:images/lamp_mesh.mtl" rotation="0 90 0" position="5.46 0 0" animation></a-entity>
Is it only possible to apply the static/dynamic properties on a shape object?
Or i have done something wrong somewhere
I seen many tutorials of physics on shape object but none on a-entity object.
Please advice.
Thanks in advance.
html aframe
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying out on aframe physics
I can apply static-body properties on a shape object:
<a-sphere color="red" width="2" height="2" depth="2" position="2 1 -5" rotation="45 0 0" static-body></a-sphere>
But not on a a-entity object, i am still able to move through the object:
<a-entity static-body obj-model="obj:models/lamp_mesh.obj;mtl:images/lamp_mesh.mtl" rotation="0 90 0" position="5.46 0 0" animation></a-entity>
Is it only possible to apply the static/dynamic properties on a shape object?
Or i have done something wrong somewhere
I seen many tutorials of physics on shape object but none on a-entity object.
Please advice.
Thanks in advance.
html aframe
I am trying out on aframe physics
I can apply static-body properties on a shape object:
<a-sphere color="red" width="2" height="2" depth="2" position="2 1 -5" rotation="45 0 0" static-body></a-sphere>
But not on a a-entity object, i am still able to move through the object:
<a-entity static-body obj-model="obj:models/lamp_mesh.obj;mtl:images/lamp_mesh.mtl" rotation="0 90 0" position="5.46 0 0" animation></a-entity>
Is it only possible to apply the static/dynamic properties on a shape object?
Or i have done something wrong somewhere
I seen many tutorials of physics on shape object but none on a-entity object.
Please advice.
Thanks in advance.
html aframe
html aframe
edited Nov 10 at 10:24
asked Nov 10 at 8:07
TYC
7618
7618
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
There should be no issues with using static-body
with any <a-entity>
elements.
Here you have a link, where i use it with a <a-entity>
with a gltf model.
There is a useful flag debug: true
for the physics
component:
<a-scene physics="debug: true">
If you don't see a wireframe around your object, then its possible there is no physics body attached to it.
Make sure your model is loaded properly, check the wireframe around it, if there is none, you can:
1) Convert your .obj
model to the web standard .gltf
(official converter here)
2) Create the physics
bodies manually. From the docs:
<a-entity gltf-model="src: mug.glb"
body="type: dynamic; mass: 5; shape: none;"
shape__main="shape: cylinder;
height: 0.36;
radiusTop: 0.24;
radiusBottom: 0.24;"
shape__handle="shape: box;
halfExtents: 0.15 0.18 0.04;
offset: 0.4 0 0;">
</a-entity>
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener formodel-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.
– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions ofaframe-extras
andaframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (sinceaframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.
– Piotr Adam Milewski
Nov 11 at 12:12
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
There should be no issues with using static-body
with any <a-entity>
elements.
Here you have a link, where i use it with a <a-entity>
with a gltf model.
There is a useful flag debug: true
for the physics
component:
<a-scene physics="debug: true">
If you don't see a wireframe around your object, then its possible there is no physics body attached to it.
Make sure your model is loaded properly, check the wireframe around it, if there is none, you can:
1) Convert your .obj
model to the web standard .gltf
(official converter here)
2) Create the physics
bodies manually. From the docs:
<a-entity gltf-model="src: mug.glb"
body="type: dynamic; mass: 5; shape: none;"
shape__main="shape: cylinder;
height: 0.36;
radiusTop: 0.24;
radiusBottom: 0.24;"
shape__handle="shape: box;
halfExtents: 0.15 0.18 0.04;
offset: 0.4 0 0;">
</a-entity>
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener formodel-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.
– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions ofaframe-extras
andaframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (sinceaframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.
– Piotr Adam Milewski
Nov 11 at 12:12
add a comment |
up vote
1
down vote
accepted
There should be no issues with using static-body
with any <a-entity>
elements.
Here you have a link, where i use it with a <a-entity>
with a gltf model.
There is a useful flag debug: true
for the physics
component:
<a-scene physics="debug: true">
If you don't see a wireframe around your object, then its possible there is no physics body attached to it.
Make sure your model is loaded properly, check the wireframe around it, if there is none, you can:
1) Convert your .obj
model to the web standard .gltf
(official converter here)
2) Create the physics
bodies manually. From the docs:
<a-entity gltf-model="src: mug.glb"
body="type: dynamic; mass: 5; shape: none;"
shape__main="shape: cylinder;
height: 0.36;
radiusTop: 0.24;
radiusBottom: 0.24;"
shape__handle="shape: box;
halfExtents: 0.15 0.18 0.04;
offset: 0.4 0 0;">
</a-entity>
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener formodel-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.
– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions ofaframe-extras
andaframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (sinceaframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.
– Piotr Adam Milewski
Nov 11 at 12:12
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
There should be no issues with using static-body
with any <a-entity>
elements.
Here you have a link, where i use it with a <a-entity>
with a gltf model.
There is a useful flag debug: true
for the physics
component:
<a-scene physics="debug: true">
If you don't see a wireframe around your object, then its possible there is no physics body attached to it.
Make sure your model is loaded properly, check the wireframe around it, if there is none, you can:
1) Convert your .obj
model to the web standard .gltf
(official converter here)
2) Create the physics
bodies manually. From the docs:
<a-entity gltf-model="src: mug.glb"
body="type: dynamic; mass: 5; shape: none;"
shape__main="shape: cylinder;
height: 0.36;
radiusTop: 0.24;
radiusBottom: 0.24;"
shape__handle="shape: box;
halfExtents: 0.15 0.18 0.04;
offset: 0.4 0 0;">
</a-entity>
There should be no issues with using static-body
with any <a-entity>
elements.
Here you have a link, where i use it with a <a-entity>
with a gltf model.
There is a useful flag debug: true
for the physics
component:
<a-scene physics="debug: true">
If you don't see a wireframe around your object, then its possible there is no physics body attached to it.
Make sure your model is loaded properly, check the wireframe around it, if there is none, you can:
1) Convert your .obj
model to the web standard .gltf
(official converter here)
2) Create the physics
bodies manually. From the docs:
<a-entity gltf-model="src: mug.glb"
body="type: dynamic; mass: 5; shape: none;"
shape__main="shape: cylinder;
height: 0.36;
radiusTop: 0.24;
radiusBottom: 0.24;"
shape__handle="shape: box;
halfExtents: 0.15 0.18 0.04;
offset: 0.4 0 0;">
</a-entity>
edited Nov 11 at 8:03
answered Nov 10 at 13:40
Piotr Adam Milewski
4,89721025
4,89721025
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener formodel-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.
– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions ofaframe-extras
andaframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (sinceaframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.
– Piotr Adam Milewski
Nov 11 at 12:12
add a comment |
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener formodel-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.
– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions ofaframe-extras
andaframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (sinceaframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.
– Piotr Adam Milewski
Nov 11 at 12:12
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
the example in your link, camera still seems to be able to go through both gltf-model and the a-entity, i am guessing that the camera need to have something like a static-body properties?
– TYC
Nov 11 at 11:45
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener for
model-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.– Piotr Adam Milewski
Nov 11 at 11:52
The spheres should bounce off the head models aframe-model-physics.glitch.me. I've added a listener for
model-loaded
, so they won't fall until the heads are present. I didn't attach any kind of body to the camera.– Piotr Adam Milewski
Nov 11 at 11:52
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
is it possible to make the camera unable to "go through" either the sphere or the head?
– TYC
Nov 11 at 11:56
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
oh yes, i was missing out the kinematic-body properties. Thanks for the help again
– TYC
Nov 11 at 12:10
It was simple with previous versions of
aframe-extras
and aframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (since aframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.– Piotr Adam Milewski
Nov 11 at 12:12
It was simple with previous versions of
aframe-extras
and aframe-physics
, check out this anwser, yet preventing the camera from moving through obstacles is not in the creators intention (since aframe
is created for VR). If you attach a static body, to the camera, all dynamic bodies will bounce off, but you will still move through other static bodies. The easiest way to bounce off the camera accelerating it a bit in the opposite direction than the wall.– Piotr Adam Milewski
Nov 11 at 12:12
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237145%2fa-frame-static-body-on-a-entity%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password