aframe-physics-system icon indicating copy to clipboard operation
aframe-physics-system copied to clipboard

Doesn't listen for all types of geometry loading?

Open cwervo opened this issue 6 years ago • 2 comments

While I was playing around with Kevin's text-geometry component I noticed that adding the physics component from HTML on the page or from the inspector on an entity that already had text-geometry, it loads physics, but doing it programmatically, like say:

var newText = document.createElement('a-entity')
newText.setAttribute('text-geometry', 'value', "foo")
newText.setAttribute('dynamic-body', 'shape', 'box')
this.el.sceneEl.appendChild(newText)

the physics never loads -- the best indication I have is that no debug wireframe appears and the elements don't seem to get pushed in the sim tree in the physics system. Per my @donmccurdy's discussion in the Slack, probably need to listen for different type of attaching geometry?

Glitch for example ("dog?" falls because it's initialized at page load, but the text generated when you click doesn't get simulated behavior event though it has a valid dynamic-body attribute)

cwervo avatar Aug 18 '17 06:08 cwervo

Was wanting to explore the combination of these libraries again, and I'd be happy to go hunt down the fix if you @donmccurdy could hazard a guess as to where the bug is/what the fix might look like? Thanks!

cwervo avatar Sep 24 '17 08:09 cwervo

Thanks for filing this, and sorry for the delay — there are two underlying issues.

(1) physics should be listening for object3dset, which I'll fix shortly. (2) https://github.com/ngokevin/kframe/issues/105

donmccurdy avatar Oct 14 '17 21:10 donmccurdy