MDX and collision menu

User Tag List

Results 1 to 7 of 7
  1. #1
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    MDX and collision

    Hi folks,
    currently working on geometry parsing. ADT and WMO seem to be quite simple. Getting the collision data (=> bounding vertices) from MDX was not that hard too, but I've noticed that doors as well as characters do have those bounding vertices (which ofc makes sense!)... but how does the client knows which mdx objects can collide with eachother?
    e.g. how does the client knows that a tauren can pass "through" a nightelv on a big mount or the cooking campfire, but not through a closed door? Is there a flag which I've just missed or can I expect that all mdx files defined inside a WMO are used for collision?

    Thanks for help!
    Last edited by xalcon; 02-06-2013 at 12:40 PM.
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

    MDX and collision
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Check out CGGameObject_C::IsSolidCollidable - 0x0044A820 (5.1.0.16357 x86 [rebased])

  3. #3
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The model of your character is a simple cylinder.

    Here is some code:

    Code:
            /// <summary>
            /// Collision Height
            /// </summary>
            public float UnitHeight
            {
                get
                {
                    return WowMem.Read<float>(MovementFields + MemEnums.MovementsFields.UnitHeightOffset);
                }
            }
    
            /// <summary>
            /// Collision Radius
            /// </summary>
            public float UnitRadius
            {
                get
                {
                    return WowMem.Read<float>(MovementFields + MemEnums.MovementsFields.UnitRadiusOffset);
                }
            }
    
            private uint MovementFields
            {
                get { return WowMem.Read<uint>(BaseAddress + MemEnums.MovementsFields.MovementField); }
            }
    Offsets:
    Code:
    internal enum MovementsFields : uint
            {
                MovementField = 0xE4,
                UnitHeightOffset = 0xD0,
                UnitRadiusOffset = 0xCC
            }
    Enjoy

  4. #4
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Frosttall View Post
    The model of your character is a simple cylinder.
    [...]
    Enjoy
    Well, that didn't helped really much :P I know how to check if something is colliding. What I don't know is, how to find out if something is collidable.

    @Jadd:
    I think that could help. Does anyone knows what data is passed to the method? It looks like some kind of flag *not that good with asm*
    It seems, when the param does not contain 0x8000, it's not collidable... otherwise, some data at [[this+0xD8]+0x2D] is checked to be > 0
    What kind of data can I find at [this+0x21C]? My structs from my older projects aren't that big... maybe I have an idea, but it will take some time to check it.
    Anyway, thanks for your help!
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  5. #5
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by xalcon View Post
    Well, that didn't helped really much :P I know how to check if something is colliding. What I don't know is, how to find out if something is collidable.

    @Jadd:
    I think that could help. Does anyone knows what data is passed to the method? It looks like some kind of flag *not that good with asm*
    It seems, when the param does not contain 0x8000, it's not collidable... otherwise, some data at [[this+0xD8]+0x2D] is checked to be > 0
    What kind of data can I find at [this+0x21C]? My structs from my older projects aren't that big... maybe I have an idea, but it will take some time to check it.
    Anyway, thanks for your help!
    The signature for the function is:
    Code:
    __thiscall DWORD_PTR CGGameObject_C__IsSolidCollidable( CGGameObject_C* pObject, UINT16 wCollisionFlags )
    It seems that [[obj+0xD8]+0x2D] is true/false (1 byte) and determines whether it is collidable. The flag parameter (2 bytes) is called with 0x8000 flag depending on how ObjectCollisionProc, the parent function, calls it. If 0x8000 is specified then it will skip the [[obj+0xD8]+0x2D] true/false check and simply return [obj+0x21C].

    I assume [obj+0x21C] contains some kind of collision data but I have not looked.

    To test collision, I would suggest one of these:
    1. Read: IsCollidable = [[obj+0xD8]+0x2D]
    2. Call: IsCollidable = CGGameObject_C__IsSolidCollidable( pObject, 0x8000 ) != 0;

    Edit: Sorry if this is hard to understand, I have been awake all night.
    Last edited by Jadd; 02-06-2013 at 04:01 PM.

  6. #6
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No, it's not hard, just not really what I was looking for But I think it might help, will try it out when I have some spare time.
    +rep for clarifcation
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  7. #7
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is for 5.4.2:17688

    Code:
    result = *(_BYTE *)(GameObjectAddress + 0x224);
    if the object is collidable it will be 1 else it will be 0. If you write the value to zero, you can go trought the object ^.^


    Sorry for pumping such an old thread.

Similar Threads

  1. Looking for a working fly and collision hack please.
    By neilneil123 in forum World of Warcraft General
    Replies: 1
    Last Post: 09-01-2011, 09:19 AM
  2. Water and Mdx Problem.
    By BanzBoyz77 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-13-2010, 02:08 PM
  3. [Guide] Converting M2, MDL and MDX
    By Gorge in forum WoW ME Tools & Guides
    Replies: 5
    Last Post: 10-10-2007, 12:26 PM
  4. 8 World of Warcraft Guide Packs (Gold, Profs and Skills)
    By Matt in forum World of Warcraft Guides
    Replies: 17
    Last Post: 09-23-2006, 10:53 AM
  5. WoWGlider and GALB Botting Locations
    By Matt in forum World of Warcraft Bots and Programs
    Replies: 14
    Last Post: 04-11-2006, 08:01 PM
All times are GMT -5. The time now is 06:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search