File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
reaction_components/prototypes Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11// base code used by grabbable for physics interactions
22module . exports = {
33 schema : {
4- usePhysics : { default : 'ifavailable' }
4+ usePhysics : { default : 'ifavailable' } ,
5+ constraintComponentName : { default : 'constraint' }
56 } ,
67 physicsInit : function ( ) {
78 this . constraints = new Map ( )
@@ -19,7 +20,7 @@ module.exports = {
1920 if ( this . data . usePhysics !== 'never' && this . el . body &&
2021 evt . detail . hand . body && ! this . constraints . has ( evt . detail . hand ) ) {
2122 const newConId = Math . random ( ) . toString ( 36 ) . substr ( 2 , 9 )
22- this . el . setAttribute ( 'constraint__ ' + newConId , {
23+ this . el . setAttribute ( this . data . constraintComponentName + '__ ' + newConId , {
2324 target : evt . detail . hand
2425 } )
2526 this . constraints . set ( evt . detail . hand , newConId )
@@ -32,7 +33,7 @@ module.exports = {
3233 physicsEnd : function ( evt ) {
3334 let constraintId = this . constraints . get ( evt . detail . hand )
3435 if ( constraintId ) {
35- this . el . removeAttribute ( 'constraint__ ' + constraintId )
36+ this . el . removeAttribute ( this . data . constraintComponentName + '__ ' + constraintId )
3637 this . constraints . delete ( evt . detail . hand )
3738 }
3839 } ,
You can’t perform that action at this time.
0 commit comments