Bug on raytest?
Posted: Sun Jun 04, 2017 7:32 pm
I have two main types of rigid bodies on my world: walls and objects.
Walls might collide with objects or with walls and both collide with attacks.
Walls use btBox2dShape for the collision shape and objects use btCompoundShape with a btConvex2dShape created from a btConvexHullShape as its only child shape.
These are set using collision masks and groups.
And when I perform a test using contactTest the collision masks and filters work as intended.
However when I perform a raytest, the ray will not hit the objects ever.
Any idea?
Here is my project: https://gitgud.io/LynxVania/LynxVania
Relevant code:
https://gitgud.io/LynxVania/LynxVania/b ... ck.cpp#L56 its where I set the collision flags for walls.
https://gitgud.io/LynxVania/LynxVania/b ... ck.cpp#L23 is where I create collision shape for walls.
https://gitgud.io/LynxVania/LynxVania/b ... wn.cpp#L22 its where I set collision flags for objects.
https://gitgud.io/LynxVania/LynxVania/b ... wn.cpp#L42 is where I create the collision shape for objects.
https://gitgud.io/LynxVania/LynxVania/b ... g.cpp#L711 is where I perform the raycast.
Note that walls might be set to use the collisiontype::dynamic and collide with walls instead of colliding with objects.
These dynamic walls can be hit with by the raycast if the condition described here is true https://gitgud.io/LynxVania/LynxVania/b ... g.cpp#L736
However the objects are NEVER hit. Maybe there is something up with the fact I use a compound shape and its 2d physics?
PS: I checked the depth, everything is at 0z.
Walls might collide with objects or with walls and both collide with attacks.
Walls use btBox2dShape for the collision shape and objects use btCompoundShape with a btConvex2dShape created from a btConvexHullShape as its only child shape.
These are set using collision masks and groups.
And when I perform a test using contactTest the collision masks and filters work as intended.
However when I perform a raytest, the ray will not hit the objects ever.
Any idea?
Here is my project: https://gitgud.io/LynxVania/LynxVania
Relevant code:
https://gitgud.io/LynxVania/LynxVania/b ... ck.cpp#L56 its where I set the collision flags for walls.
https://gitgud.io/LynxVania/LynxVania/b ... ck.cpp#L23 is where I create collision shape for walls.
https://gitgud.io/LynxVania/LynxVania/b ... wn.cpp#L22 its where I set collision flags for objects.
https://gitgud.io/LynxVania/LynxVania/b ... wn.cpp#L42 is where I create the collision shape for objects.
https://gitgud.io/LynxVania/LynxVania/b ... g.cpp#L711 is where I perform the raycast.
Note that walls might be set to use the collisiontype::dynamic and collide with walls instead of colliding with objects.
These dynamic walls can be hit with by the raycast if the condition described here is true https://gitgud.io/LynxVania/LynxVania/b ... g.cpp#L736
However the objects are NEVER hit. Maybe there is something up with the fact I use a compound shape and its 2d physics?
PS: I checked the depth, everything is at 0z.