CGWorld_C::Intersect menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CGWorld_C::Intersect

    Hello. I'm curious if anyone would mind giving me a push in the right direction.

    I'm looking for suitable flags for CGWorld_C::Intersect.

    I have tried all of the flags WoW uses, however I have the feeling that the DWORD passed is used as bit flags, but only guessing because of the weird values passed to CGWorld_C::Intersect.

    I'm pretty tired now, so I'm going to head to bed. Thanks in advance.

    CGWorld_C::Intersect
  2. #2
    barthen's Avatar Contributor Authenticator enabled
    Reputation
    84
    Join Date
    Apr 2007
    Posts
    111
    Thanks G/R
    4/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you're looking for this:

    Code:
    enum CGWorldFrame::HIT_FILTER {
      HIT_TEST_NOTHING = 0x0,
      HIT_TEST_GROUND = 0x1,
      HIT_TEST_OBJECTS = 0x2,
      HIT_TEST_UNITS = 0x4,
      HIT_TEST_PLAYERS = 0x8,
      HIT_TEST_ME = 0x10,
      HIT_TEST_PARTY = 0x10000,
      HIT_TEST_FRIENDS = 0x20000,
      HIT_TEST_ENEMIES = 0x40000,
      HIT_TEST_LIVE = 0x100000,
      HIT_TEST_DEAD = 0x200000,
      HIT_TEST_ALL_OBJS_EXCEPT_ME = 0xe,
      HIT_TEST_ALL_OBJS = 0x1e,
      HIT_TEST_ALL_EXCEPT_ME = 0xf,
      HIT_TEST_ALL = 0x1f,
    };

    And the return value should be one of this:

    Code:
    enum CGWorldFrame::HIT_TYPE {
      HIT_NONE = 0x0,
      HIT_GROUND = 0x1,
      HIT_OBJECT = 0x2,
    };
    I hope that's what you need

  3. #3
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CGWorld_C::Intersect is just a proxy call for TraceLine

    Also, try 0x00100171 for the flags.

    Code:
           /// <summary>
            /// pOptional is apparently another WOWPOS pointer. But is always passed as 0.
            /// (WOWPOS according to WoWX, 0 according to... everyone else...)
            /// </summary>
            /// <param name="pEnd">The end Point.</param>
            /// <param name="pStart">The start Point.</param>
            /// <param name="pResult">The resulting intersection point.</param>
            /// <param name="pDistance">The distance to the intersection, if any. Pass a ref to a float == 1f</param>
            /// <param name="dwFlag">TraceLine flags.</param>
            /// <param name="pOptional">Pass 0!</param>
            /// <returns></returns>
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate CGWorldFrameHitType TraceLine(
                ref Point pEnd, ref Point pStart, ref Point pResult, ref float pDistance, uint dwFlag, uint pOptional);
    Keep in mind; you should never call TraceLine without increasing the Z val of you/your target by at least Me.Scale or Me.Target.Scale. Otherwise you'll intersect the ground where you stand. (Not the desired outcome)
    Last edited by Apoc; 08-20-2009 at 11:02 PM.

  4. #4
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by barthen View Post
    I think you're looking for this:

    Code:
    enum CGWorldFrame::HIT_FILTER {
      HIT_TEST_NOTHING = 0x0,
      HIT_TEST_GROUND = 0x1,
      HIT_TEST_OBJECTS = 0x2,
      HIT_TEST_UNITS = 0x4,
      HIT_TEST_PLAYERS = 0x8,
      HIT_TEST_ME = 0x10,
      HIT_TEST_PARTY = 0x10000,
      HIT_TEST_FRIENDS = 0x20000,
      HIT_TEST_ENEMIES = 0x40000,
      HIT_TEST_LIVE = 0x100000,
      HIT_TEST_DEAD = 0x200000,
      HIT_TEST_ALL_OBJS_EXCEPT_ME = 0xe,
      HIT_TEST_ALL_OBJS = 0x1e,
      HIT_TEST_ALL_EXCEPT_ME = 0xf,
      HIT_TEST_ALL = 0x1f,
    };

    And the return value should be one of this:

    Code:
    enum CGWorldFrame::HIT_TYPE {
      HIT_NONE = 0x0,
      HIT_GROUND = 0x1,
      HIT_OBJECT = 0x2,
    };
    I hope that's what you need
    Thanks a lot for this. Where did you go about finding it if you don't mind? Thanks again!

    Originally Posted by Apoc View Post
    CGWorld_C::Intersect is just a proxy call for TraceLine

    Also, try 0x00100171 for the flags.

    Code:
           /// <summary>
            /// pOptional is apparently another WOWPOS pointer. But is always passed as 0.
            /// (WOWPOS according to WoWX, 0 according to... everyone else...)
            /// </summary>
            /// <param name="pEnd">The end Point.</param>
            /// <param name="pStart">The start Point.</param>
            /// <param name="pResult">The resulting intersection point.</param>
            /// <param name="pDistance">The distance to the intersection, if any. Pass a ref to a float == 1f</param>
            /// <param name="dwFlag">TraceLine flags.</param>
            /// <param name="pOptional">Pass 0!</param>
            /// <returns></returns>
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate CGWorldFrameHitType TraceLine(
                ref Point pEnd, ref Point pStart, ref Point pResult, ref float pDistance, uint dwFlag, uint pOptional);
    Keep in mind; you should never call TraceLine without increasing the Z val of you/your target by at least Me.Scale or Me.Target.Scale. Otherwise you'll intersect the ground where you stand. (Not the desired outcome)
    Thanks for the scale info. Are spells checked from "eye position", because thats what it would be if scale was added?

    Thank you both again. Will rep you both.

  5. #5
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    CGWorld_C::Intersect is just a proxy call for TraceLine

    Also, try 0x00100171 for the flags.

    Code:
           /// <summary>
            /// pOptional is apparently another WOWPOS pointer. But is always passed as 0.
            /// (WOWPOS according to WoWX, 0 according to... everyone else...)
            /// </summary>
            /// <param name="pEnd">The end Point.</param>
            /// <param name="pStart">The start Point.</param>
            /// <param name="pResult">The resulting intersection point.</param>
            /// <param name="pDistance">The distance to the intersection, if any. Pass a ref to a float == 1f</param>
            /// <param name="dwFlag">TraceLine flags.</param>
            /// <param name="pOptional">Pass 0!</param>
            /// <returns></returns>
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate CGWorldFrameHitType TraceLine(
                ref Point pEnd, ref Point pStart, ref Point pResult, ref float pDistance, uint dwFlag, uint pOptional);
    Keep in mind; you should never call TraceLine without increasing the Z val of you/your target by at least Me.Scale or Me.Target.Scale. Otherwise you'll intersect the ground where you stand. (Not the desired outcome)
    Pretty sure you should be using Me.Height not Me.Scale. Me.Height is your actual collision height, the one that's used in collision checks, using Me.Scale (assuming that you havn't named Me.Height incorrectly) would cause incorrect results in certain situations.

  6. #6
    zzgw's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    31
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man, how did you manage to RE it so far to understand the flags? Or is it mostly from the old exe with debugging symbols?

  7. #7
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by zzgw View Post
    Man, how did you manage to RE it so far to understand the flags? Or is it mostly from the old exe with debugging symbols?
    Pretty doubtful. My money is on Mangos or alike

  8. #8
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ramey View Post
    Pretty doubtful. My money is on Mangos or alike

    My money is on the alpha client.

  9. #9
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post

    My money is on the alpha client.
    Now that I think about it you're probably right, but the flags weren't what I was looking for.

    EDIT: Just realised that Apoc had mentioned what I actually needed, but I found it on my own. Thanks Apoc, too bad I didn't pay any attention.
    Last edited by ramey; 08-21-2009 at 10:41 AM.

  10. #10
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apoc knows of what he speaks. I had some real problems with Traceline recently, and 0x100171 is the magic number (although that wasn't my problem).
    Don't believe everything you think.

  11. #11
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    Apoc knows of what he speaks. I had some real problems with Traceline recently, and 0x100171 is the magic number (although that wasn't my problem).
    Apoc fails.

    He had problems with it too originally and I told him to use that flag because he was using a completely different one. He then claimed that the flag I sent him didn't work. A week or so later I asked him if he resolved it and he said "yeah I got it working with this flag '0x100171'". Which was the same ****ing flag I sent him to begin with. >_>

    Then naturally he said it wasn't, so I dug up chat logs and I was right.

    In short: Apoc fails at calling Intersect.

  12. #12
    ggg898's Avatar Member
    Reputation
    10
    Join Date
    Jan 2009
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had problems with traceline too, never got it to work before so I forgot about it, so many thanks for the info and flag values in this thread (though I cant say I understand how 0x100171 is constructed from the bit values in the previous posts...)

    One question though, is there an easy way to find the height of the characters Cypher is mentioning in the previous post (Me.Height) or or do you have to parse m2 model or something?

  13. #13
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ggg898 View Post
    I had problems with traceline too, never got it to work before so I forgot about it, so many thanks for the info and flag values in this thread (though I cant say I understand how 0x100171 is constructed from the bit values in the previous posts...)

    One question though, is there an easy way to find the height of the characters Cypher is mentioning in the previous post (Me.Height) or or do you have to parse m2 model or something?
    It's stored in the player structure. (Obviously it has to be stored somewhere easy to get to as it's used in collision tests and what-not)

    It's not all that difficult to find if you realize that your collision height changes when certain things happen.

    I'll leave it as an exercise to you as to work out when these changes occur, and how to reproduce them to track down the offset.

  14. #14
    ggg898's Avatar Member
    Reputation
    10
    Join Date
    Jan 2009
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fair enough, thanks.

  15. #15
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Pretty sure you should be using Me.Height not Me.Scale. Me.Height is your actual collision height, the one that's used in collision checks, using Me.Scale (assuming that you havn't named Me.Height incorrectly) would cause incorrect results in certain situations.
    I typically use Me.Scale as it gives enough of a 'boost' to the Z axis to give good LoS results. However, Me.Height would probably be more effective (and less buggy at that). You could even just hard-code it to be +1.3-2.0f to the Z and still be pretty much fine.

Page 1 of 2 12 LastLast

Similar Threads

  1. [FIXED] CWorld::Intersect / Raycasting in 1.12
    By Valediction in forum WoW Memory Editing
    Replies: 7
    Last Post: 06-29-2017, 09:47 PM
  2. TraceLine/Intersection - Collision detection with height limit
    By Frosttall in forum WoW Memory Editing
    Replies: 3
    Last Post: 05-26-2012, 07:11 AM
  3. [3.3.3.11723] CGWorld_C::Intersect parameters?
    By eLaps in forum WoW Memory Editing
    Replies: 5
    Last Post: 05-13-2010, 09:17 AM
  4. Swamp of Sorrows : Blasted Lands intersection
    By Razmataz in forum World of Warcraft Exploration
    Replies: 12
    Last Post: 06-05-2007, 01:16 PM
All times are GMT -5. The time now is 10:08 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search