-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[simple-navmesh-constraint] create a separate repo and publish to npm #6
Comments
You can sponsor $10 to vincentfretin fully or partially to work on this feature. Find other work you can sponsor at https://github.com/c-frame/sponsorship |
The ground generated by the It works well with cursor-teleport component too, just be sure to disable and enable simple-navmesh-constraint between navigation transition. Code snippet below: AFRAME.registerComponent('character-controller', {
init() {
setTimeout(() => {
const rig = document.getElementById('rig');
rig.setAttribute(
'simple-navmesh-constraint',
'navmesh:.environmentGround,.environmentDressing;fall:10;height:0;exclude:.navmesh-hole;'
);
}, 2000);
},
events: {
'navigation-start': function () {
if (this.el.hasAttribute('simple-navmesh-constraint')) {
this.el.setAttribute('simple-navmesh-constraint', 'enabled', false);
}
},
'navigation-end': function () {
if (this.el.hasAttribute('simple-navmesh-constraint')) {
this.el.setAttribute('simple-navmesh-constraint', 'enabled', true);
}
},
},
}); <a-scene environment="preset: japan">
<a-entity
id="rig"
character-controller
cursor-teleport="cameraRig: #rig; cameraHead: #player; collisionEntities: .environmentGround; ignoreEntities: .clickable"
movement-controls="camera:#player"
>
<a-entity id="player" class="camera" camera position="0 1.6 0" look-controls>
</a-entity>
</a-entity>
</a-scene> |
With AdaRoseCannon/aframe-xr-boilerplate#27 the setTimeout 2s in my above comment to set simple-navmesh-constraint is not needed anymore. |
Latest version is <script src="https://cdn.jsdelivr.net/gh/AdaRoseCannon/aframe-xr-boilerplate@bca4792/simple-navmesh-constraint.js"></script> |
Create a separate repo in c-frame organization to host simple-navmesh-constraint component and publish it to npm.
See AdaRoseCannon/aframe-xr-boilerplate#13 (comment)
example:
https://glitch.com/edit/#!/aframe-ada-simple-navmesh-constraint---1-4-1
doc:
https://github.com/AdaRoseCannon/aframe-xr-boilerplate#simple-navmesh-constraintjs
The text was updated successfully, but these errors were encountered: