HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: LOS blocked by bounding box?  (Read 438 times)

Thazager

  • General Accounts
  • *
  • Posts: 1128
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
LOS blocked by bounding box?
« on: Jan 12, 18, 07:43:17 PM »

I have been trying to use the standard raycast to check a hit, but it seems to be hitting the target's bounding box, and gives a result of blocked LOS. I added a debug draw line to show it in the game.

When a wall is in the way, it finds it and marks as "blocked", it finds crates too, but it also finds the bounding box of the target (not sure why - its not a mesh), but gives a result of blocked.

When checking the mesh name for any of the blocked targets, it wont show a value.

Below, the wall blocks the LOS. The red arrow points at the target, using a red line from the player attacking with ranged attack. The green lines are at the point of intersection with the wall. The words in console (of editor) show LOS blocked, and intercept point, the target location, and the meshname = no name.



Below, we have another attack by the player, this time nothing is between the target and player, but the intercept shows at the bounding box, as does the console show the intercept point, the target location, and the meshname (again no name).



Add:
Currently, the attack still takes place, the LOS is being tested and just printing out a result.
« Last Edit: Jan 12, 18, 07:45:27 PM by Thazager »
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: LOS blocked by bounding box?
« Reply #1 on: Jan 15, 18, 03:27:40 PM »

Quote
I have been trying to use the standard raycast to check a hit, but it seems to be hitting the target's bounding box

the Raycast functions determine the hit by a collision with the bounding box of a character,  but on static objects , will use the visible mesh (such as passing through a door or window to hit something on the inside/outside).  Likely due to the dynamic nature of the the characters vs the static mesh of other models.  the Engine automatically builds a static physx mesh for every static object placed in the game, and the client knows the exact shape of the object by this.  The same isnt true for characters as the shape constantly changes due to animation, so the bounding box is used for them.

Quote
When checking the mesh name for any of the blocked targets, it wont show a value.

The raycast functions don't return a meshname (either they once did or were perhaps intended to in the future, but they don't as of now).   They only return the nodeRef of the object hit, and the point of intersection.

Hope that helps some.