Panda3D Manual: Bullet QueriesBullet offers a bunch of different queries for retrieving information about collision objects. A common usecase is sensors needed by game logic components. For example to find out if the space in front of an NPC object is blocked by a solid obstacle, or to find out if an NPC can see some other object.
Ray TestRaycasting is to shoot a ray from one position (the from-position) to another position (the to-position). Both the from-position and the to-position have to be specified in global coordinates. The ray test methods will then return a result object which contains information about which objects the ray has hit. There are two different ray test method: The first method ( Example for closest hit: LPoint3f pFrom = LPoint3f(0,0,0); Example for all hits: LPoint3f pFrom = LPoint3f(0,0,0); Often users want to pick or select an object by clicking on it with the mouse. We can use the TODO Sweep TestThe sweep test is similar to the ray test. There are two differences: (1) The sweep test does not use an infinite thin ray, like the ray test, but checks for collisions with a convex shape which is "moved" along the from from-position to to-position. (2) The sweep test wants to have "from" and "to" specified as Example for sweep testing: TODO
Contact TestThere are two contact tests. One which checks if a collision objects is in contact with other collision objects, and another which checks for a pair of collision objects if they are in contact. Example for contact testing: TODO © Carnegie Mellon University 2010 |