Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus trace ray gets stuck on invisible vobs/bboxes #28

Closed
szapp opened this issue Aug 22, 2016 · 4 comments
Closed

Focus trace ray gets stuck on invisible vobs/bboxes #28

szapp opened this issue Aug 22, 2016 · 4 comments

Comments

@szapp
Copy link
Owner

szapp commented Aug 22, 2016

For displaying focus information a trace ray is shot detecting bounding boxes (necessary to detect npcs which are otherwise ignored by trace rays). However, the bounding boxes of (invisible) vobs get in the way, and block the trace ray.

Possible Fix

To fix this, shoot a trace ray without bbox detection if there is no focus npc. In the other case shoot a bbox detecting trace ray. If in the second case the found vob is not an oCNpc, ignore the close range and take the distance of the first trace ray or (to be more conservative with performance) set it to the maximum distance.

The focus collection should be set to stricter angles for this to work better.

Alternative

Shoot a bbox trace ray but also set the ignore vobs flag. What will happen?

@szapp
Copy link
Owner Author

szapp commented Sep 1, 2016

New idea

Check how 0x733A10 (7551504) void __thiscall oCNpc::CollectFocusVob(int) does it.

@szapp
Copy link
Owner Author

szapp commented Sep 1, 2016

Also check what 0x732F40 (7548736) int __thiscall oCNpc::FocusCheckBBox(zCVob const * int int float float &) does.

@szapp
Copy link
Owner Author

szapp commented Sep 1, 2016

New Idea

DOES NOT WORK: oCNpc::IsNpcBetweenMeAndTarget is for close range npc fighting

Shoot trace ray without bbox detection.

  1. If there is a collected focus npc, perform an action similar to 0x67C7D0 (6801360) int __thiscall oCNpc::IsNpcBetweenMeAndTarget(zCVob *) (but instead of the hero take the camera and instead of a zCVob do it with a zVEC3 position). If an npc is in the way, it will most likely be the focus npc (how to make sure?). Take the distance to the focus npc.
    Since oCNpc::IsNpcBetweenMeAndTarget might not be easy or performance light to fully rewrite in deadalus, the camera vob could be casted as oCNpc and a dummy or fake vob can be used as target vob. It is only important to assure there is any npc in between - it does not matter if it is the focus npc.
  2. If there is no valid focus npc, take the distance to the trace ray intersection.

Done.

@szapp
Copy link
Owner Author

szapp commented Oct 13, 2016

Fix #28 complete focus collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant