javascript - PhysicsJs - how to remove a world behavior, "constant-acceration' after it has been added -
my behaviors on initialization added follows:
world.add([ physics.behavior('interactive', { el: renderer.el }), physics.behavior('constant-acceleration'), physics.behavior('body-impulse-response'), physics.behavior('sweep-prune'), edgebounce ]);
i'd to, @ later time, remove "constant-acceleration" behavior. read couple of posts said use remove() method i'm not getting happen using follows:
world.remove( physics.behavior('constant-acceleration') );
can advise how achieve removing specific behavior world after has been added?
the physics.behavior
docs indicate behavior
object returned when call physics.behavior
(because constructs new one). need keep reference behavior
object you'd call you've put world.add
array, pass reference world.remove
later. now, you're making new behavior
(separate 1 made first) , passing brand new object world.remove
, nothing.
Comments
Post a Comment