You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
I'm working on a VR keyboard component using physics collisions to trigger a key press.
declaretypeBodyShape=BodyProps&{type: ShapeType;};constshapes: Array<BodyShape>=[];// create trigger volumes for all the keysthis.keys.forEach(item=>{constsize=makeVector3(item.size);constprops: BoxProps={isTrigger: true,args: makeVector3([0.2,0.1,0.2]).multiply(size).toArray(),position: item.position,onCollide: (e: any)=>{console.warn('onCollideBegin',e);}}asBoxProps;shapes.push({ ...props,type: 'Box'}asBodyShape)})this.body=this.physicBody.useCompoundBody(()=>({position: this.position,rotation: this.rotation,shapes: shapes}));
When the app starts, I get the following error in the console
Uncaught DOMException: Failed to execute 'postMessage' on 'Worker': (e) => {
console.warn('onCollideBegin', e);
} could not be cloned.
at CannonWorkerAPI.postMessage (http://localhost:4200/vendor.js:1305:41)
at CannonWorkerAPI.addBodies (http://localhost:4200/vendor.js:608:10)
Does the underlying Cannon Worker support collision events in shape definitions within a compound body?
If not, they need removing from the shape type definitions to catch this mistake at build time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working on a VR keyboard component using physics collisions to trigger a key press.
When the app starts, I get the following error in the console
Does the underlying Cannon Worker support collision events in shape definitions within a compound body?
If not, they need removing from the shape type definitions to catch this mistake at build time.
Beta Was this translation helpful? Give feedback.
All reactions