Collision problems...Ray works but Segment does not

Hey everyone. Was hoping you can help me out. I’m having a little problem with my CollisionSegment colliding with everything O.o; Heres a image of what it looks like. I do disable it after I shoot, but for testing reason I left it on. As you can see, it’s testing everything it can when it should probablly just be testing what it hits or closes to.

Heres the code ish~ If you need more information, I can get more. Um, the collision evniron is made from the octtree scrip with bit 0 and 3, the CollisionSegment has bit 3 and other players have bit 3. Player has bits 0-2

#Collision ray for our Weapon.
#Check who we hit.
base.cTrav.addCollider(self.pickerNP, base.handler)
base.cTrav.addCollider(self.pickerNP, base.handlerQueue)
self.pickerRay.setFromLens(base.camNode, self.mpos.getX(), self.mpos.getY())
if base.handlerQueue.getNumEntries() > 0:
  if not self.pickedObj.isEmpty():
    if str(self.pickedObj.getParent().getParent().getName()) in self.userlist:
      if self.userlist[str(self.pickedObj.getParent().getParent().getName())].getDistance(self.anp) <= self.BullitMaxDis:
        #print self.userlist[str(self.pickedObj.getParent().getParent().getName())].getPos()
        #print self.pickedObj.getParent().getParent().getName()
        self.OtherPlayersName = str(self.pickedObj.getParent().getParent().getName())

It’s just a question of bounding volumes. The showCollisions() function lights up in yellow all surfaces whose bounding volume is intersecting the segment’s bounding volume.

The bounding volume of a segment is, by default, the sphere that encloses the segment, which might be quite large for a long segment. The bounding volume of a ray is, on the other hand, the infinite line that matches the ray (but in both directions). If the ray is a better fit for your bounding volume, then just use a ray instead of a long segment (you can always check the point of collision and discard something too far away if you like). Or, I believe you can use a segment, and reset the bounding volume to be a BoundingLine by hand.