What Is It?
a-entity position to the 'last known good' position after any simple AABB collision.
Will only work for axis-aligned entities (such as simple walls).
What's It Good For?
If attached to a
camera, will prevent walking through walls using WASD controls and/or physically
moving in a room-scale environment. For the latter, the world will appear to 'push back' against the
What Isn't It Good For?
Collision detection uses simple (but fast) AABB collision detection. So will only work for simple axis
aligned primitives (such as
a-box used as walls). Also the positional reset is a
bit janky, and it doesn't implement 'wall sliding' when using WASD controls.
Who Should Use It?
Anyone looking for a quick and dirty solution to stopping people walking through walls in environments where they shouldn't really be going anywhere near the walls in the first place. For example, it's not good for a First Person Shooter where people try to hug the walls (because it doesn't implement 'wall sliding'). But it's fine for an art gallery viewing application.
How Do I Use It?
Add to an
a-entity. For example:
<a-entity camera reset-on-collision="with: .wall"/>