Posted By: 82RJZAE
Bounding Boxes Intersecting - 10/09/10 22:33
For some reason, my player can walk into another model's bounding box if I keep moving forward into its corner.
I am using a c_trace to determine the distance to the ground, and when the two bounding boxes intersect each other it returns a negative value. I have another code that brings the player up in the event he is trapped in the ground (when c_trace returns a negative value); however, in this case, it lets the player jump on top of the other model!

1. The bounding boxes do not intersect when colliding face to face.
2. The bounding boxes can intersect when colliding against a corner.
3. Continuing to move forward while intersecting the other bounding box allows the player to fly on top of that entity.
C_Trace Code:
C_Move Code:
How might I fix this? The player should not be able to fly on top of other models!
Thanks,
82RJZAE
I am using a c_trace to determine the distance to the ground, and when the two bounding boxes intersect each other it returns a negative value. I have another code that brings the player up in the event he is trapped in the ground (when c_trace returns a negative value); however, in this case, it lets the player jump on top of the other model!

1. The bounding boxes do not intersect when colliding face to face.
2. The bounding boxes can intersect when colliding against a corner.
3. Continuing to move forward while intersecting the other bounding box allows the player to fly on top of that entity.
C_Trace Code:
Code:
distance_to_ground = c_trace(my.x,vector(my.x,my.y,my.z-5000),
IGNORE_ME | IGNORE_PASSENTS | IGNORE_SPRITES | USE_BOX | ACTIVATE_SONAR);
C_Move Code:
Code:
c_move(me, player_dist, player_absdist, GLIDE | IGNORE_SPRITES | IGNORE_PASSABLE);
How might I fix this? The player should not be able to fly on top of other models!
Thanks,
82RJZAE