Page 1 of 1

disable rigid body

Posted: Tue May 13, 2008 2:44 pm
by sueds
hello,

is there a way to disable the rigid body but keep the collision detection ? I mean a function to assign to a entity ?


cheers

Re: disable rigid body

Posted: Tue May 13, 2008 6:19 pm
by Norbo
If you want to disable the physically based movement but keep both detection and response, you can use (Entity).makeNonDynamic(). If you want to get rid of response but keep creating controllers when objects get close to each other, you can use (Entity).isTangible = false. While an object is intangible, it will not perform rigorous collision detection (such as identifying contact points and whether or not the objects are actually in collision). If you want to still perform these sorts of functions with this intangible 'detector' object, you could use the Toolbox.areObjectsColliding or Toolbox.getClosestPointsBetweenObjects methods with the detector's controllers' entities.

There may be a minor change with this in v0.6.0, I haven't quite decided yet. It would be nice if collision events were still dispatched when a collision occurred with a 'detector' entity so that you wouldn't have to use Toolbox.areObjectsColliding or Toolbox.getClosestPointsBetweenObjects to collect detailed information.