1. Post #1
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    [release]gm_queryphys

    This module is a way of getting the vertexes of a physics object.
    [/release]

    [release]Functions

    -- Returns the number of convexs.
    PhysObj:GetConvexCount()
    
    -- Returns a table of triangles.
    PhysObj:GetConvexMesh(convexIndex)
    
    -- Rebuilds a PhysObj with the provided convexes.
    PhysObj:RebuildFromConvexs(position, angle, mass, damping, rotDamping, inertia, rotInertiaLimit, convexes)
    
    [/release]

    [release]Download

    Source Code SVN Repo: http://gmod-haza.googlecode.com/svn/trunk/gm_queryphys/

    Windows Binary: http://gmod-haza.googlecode.com/svn/..._queryphys.dll
    [/release]
    Reply With Quote Edit / Delete Reply Australia Show Events Useful x 38Lua King x 6Dumb x 2Informative x 1Friendly x 1Bad Spelling x 1 (list)

  2. Post #2
    Gold Member
    bobthe2lol's Avatar
    July 2007
    1,370 Posts
    Awesome!!!
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 8 (list)

  3. Post #3
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,205 Posts
    Fucking awsome! now i can complete my bullet physics in source project!    or probbably not...   
    Reply With Quote Edit / Delete Reply Sweden Show Events Bad Spelling Bad Spelling x 6Funny Funny x 3Informative Informative x 1Zing Zing x 1 (list)

  4. Post #4
    Gold Member
    maurits150's Avatar
    February 2007
    1,803 Posts
    Fucking epic!
    Reply With Quote Edit / Delete Reply Netherlands Show Events Agree Agree x 1 (list)

  5. Post #5
    Grocel's Avatar
    October 2008
    1,208 Posts
    Will this get shipped with gmod?
    You posted about it in the gmod update threat.
    Reply With Quote Edit / Delete Reply Germany Show Events Bad Spelling Bad Spelling x 5Dumb Dumb x 3 (list)

  6. Post #6
    CapsAdmin's Avatar
    August 2005
    3,926 Posts
    You can use this with entity:PhysicsFromMesh(table) ?
    Reply With Quote Edit / Delete Reply Norway Show Events Disagree Disagree x 1 (list)

  7. Post #7
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    Should work.

    Edited:

    I think as long as the object doesn't already have a physics object, you should be fine.
    Reply With Quote Edit / Delete Reply Australia Show Events Informative Informative x 1 (list)

  8. Post #8
    Dennab
    May 2009
    47 Posts
    Hey, I tried to use the phys:GetConvexCount() but crashed with the reason "Lua Error Dump!". Here is my code...

    Code:
    local physmeta = FindMetaTable( "PhysObj" )
    		
    if physmeta and physmeta.GetConvexMesh and physmeta.GetConvexCount then
        local phys = ent:GetPhysicsObject()
    		
        if IsValid( phys ) then
            local count = phys:GetConvexCount()
            print( count )
        end
    end
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 1 (list)

  9. Post #9
    Amic's Avatar
    July 2008
    1,552 Posts
    -snip-
    Reply With Quote Edit / Delete Reply Poland Show Events Dumb Dumb x 13Agree Agree x 1 (list)

  10. Post #10
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    Well I hit a roadblock. The triangle's vertices are not coming out in the correct order. Thus the collision model's planes all have incorrect normals. And there is nothing I can really do about it...

    Edit: Hurrr, Fixed. I'm a retard.

    Edited:

    Well I have a permanent weld tool working.
    Reply With Quote Edit / Delete Reply Australia Show Events Useful Useful x 1Lua King Lua King x 1 (list)

  11. Post #11
    Box collector
    haza55's Avatar
    October 2005
    545 Posts

  12. Post #12
    Gold Member
    FluD's Avatar
    February 2006
    1,133 Posts
    update smartsnap!!!
    Reply With Quote Edit / Delete Reply Latvia Show Events Agree Agree x 2Dumb Dumb x 1 (list)

  13. Post #13
    Gold Member
    ralle105's Avatar
    October 2005
    4,627 Posts
    Me likey!:buddy:

    Edited:

    When Using :GetConvexMesh(0) on the head bone of humans (10) you get this error
    Code:
    attempt to index a nil value

  14. Post #14
    Gold Member
    dvondrake's Avatar
    August 2006
    2,329 Posts
    Any plans for a Linux binary?
    Reply With Quote Edit / Delete Reply United States Show Events Artistic Artistic x 2 (list)

  15. Post #15
    tomato3017's Avatar
    April 2007
    116 Posts
    Is clientside prediction going to be written?

  16. Post #16
    Gold Member
    Mooee's Avatar
    June 2008
    1,131 Posts
    I'm sorry, but my lack of knowlege (when it comes to modules) forces me to ask: where's the proper place to put these files?

  17. Post #17
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    place the .dll into garrysmod/garrysmod/lua/includes/modules/

    Clientside is coming.
    Reply With Quote Edit / Delete Reply Australia Show Events Informative Informative x 2 (list)

  18. Post #18
    Gold Member
    Kung Fu Jew's Avatar
    November 2006
    5,681 Posts
    Say I throw this on my server. All clients reap the benefits while on it?

    e.g. this tool will work without each client having to get it: http://www.garrysmod.org/downloads/?a=view&id=101535

  19. Post #19
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,205 Posts
    Yes, but probbably there will be messed up prediction etc

  20. Post #20
    Gold Member
    Mooee's Avatar
    June 2008
    1,131 Posts
    1. Thank you very much, I now know how to install the physics module as well.
    2. Damn you norton! (It just deleted the file because it deamed unsafe.)

  21. Post #21
    Ask Me About My VW Beetle Fetish
    Ldesu's Avatar
    March 2008
    9,736 Posts
    norton!
    Well there's your problem
    Reply With Quote Edit / Delete Reply Norway Show Events Agree Agree x 19Informative Informative x 1 (list)

  22. Post #22
    Grocel's Avatar
    October 2008
    1,208 Posts
    1. Thank you very much, I now know how to install the physics module as well.
    2. Damn you norton! (It just deleted the file because it deamed unsafe.)
    I have Norten Internet Security 2010 and it doesn't say it's unsafe, it's an error in your Internet Security. ;)
    Reply With Quote Edit / Delete Reply Germany Show Events Dumb Dumb x 9Funny Funny x 1 (list)

  23. Post #23
    Gold Member
    bobthe2lol's Avatar
    July 2007
    1,370 Posts
    Wow these people with norton. Its the most bloated, worst antivirus sofware ever. Use avast or nod32 or w/e
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 15Dumb Dumb x 1Informative Informative x 1 (list)

  24. Post #24
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,205 Posts
    Norton? I stopped using that when it removed both shell32.dll and hal.dll becuse they was "unsafe"
    Reply With Quote Edit / Delete Reply Sweden Show Events Funny Funny x 23Dumb Dumb x 1Informative Informative x 1Winner Winner x 1 (list)

  25. Post #25
    Ask Me About My VW Beetle Fetish
    Ldesu's Avatar
    March 2008
    9,736 Posts
    A friend of mine had Norton and he switched anti virus when Norton told him explorer.exe was a virus
    Reply With Quote Edit / Delete Reply Norway Show Events Funny Funny x 20Agree Agree x 1Optimistic Optimistic x 1 (list)

  26. Post #26
    aleksandervii's Avatar
    December 2009
    24 Posts
    Where do i put the files? I mean all of them...
    Reply With Quote Edit / Delete Reply Norway Show Events Dumb Dumb x 1 (list)

  27. Post #27
    |King Flawless|'s Avatar
    February 2010
    712 Posts
    A friend of mine had Norton and he switched anti virus when Norton told him explorer.exe was a virus
    Sounds like he was infected with a rootkit
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 10Disagree Disagree x 2Funny Funny x 1 (list)

  28. Post #28
    I wasted a dollar on a stupid title.
    nikomo's Avatar
    September 2007
    16,649 Posts
    Sounds like he was infected with a rootkit
    No, it sounds like a virus replaced explorer with its own version.
    Norton can't detect rootkits for shit.
    Reply With Quote Edit / Delete Reply Finland Show Events Agree Agree x 2Funny Funny x 1 (list)

  29. Post #29
    Gold Member
    ralle105's Avatar
    October 2005
    4,627 Posts
    Where do i put the files? I mean all of them...
    You should only download one file, the windows binary (dll) and you should put it in lua/includes/modules
    Reply With Quote Edit / Delete Reply Sweden Show Events Useful Useful x 2 (list)

  30. Post #30
    foxcock
    Bletotum's Avatar
    June 2008
    6,873 Posts
    Lets not take this thread in the direction of antivirus wars, take it to this link instead. Also read it's OP, useful.

    http://www.facepunch.com/showthread.php?t=948262

  31. Post #31
    RP-01's Avatar
    December 2008
    84 Posts
    Really nice work!
    Is it possible to implement a function to clip single bones? It would be really useful for goremods and such. :V

  32. Post #32
    Gold Member
    Robbis_1's Avatar
    July 2005
    344 Posts
    This is great, but does anybody have a clue why it always crashes for me?
    I tried something so simple like getting the convexes and then setting them again, but it crashes. And I'm trying it on props.
    	local ent = Ply:GetEyeTrace().Entity
    	local physObj = ent:GetPhysicsObject()
    	
    	physObj:EnableCollisions(false) -- I thought it was going to prevent the crash, but apparently not
    	local convexes = physObj:GetConvexMesh(0)
    	physObj:RebuildFromConvexs(physObj:GetPos(), physObj:GetAngle(), physObj:GetMass(), physObj:GetDamping(), physObj:GetRotDamping(), 1, 1, convexes)
    	physObj:EnableCollisions(true)
    
    Reply With Quote Edit / Delete Reply Sweden Show Events Disagree Disagree x 1 (list)

  33. Post #33
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    local ent = Ply:GetEyeTrace().Entity  
    local physObj = ent:GetPhysicsObject()  
      
    physObj:EnableCollisions(false) -- I thought it was going to prevent the crash, but apparently not
    
    local convexes = physObj:GetConvexMesh(0)
    
    physObj:RebuildFromConvexs(physObj:GetPos(), physObj:GetAngle(), physObj:GetMass(), physObj:GetDamping(), physObj:GetRotDamping(), 1, 1, {convexes})
    
    physObj = ent:GetPhysicsObject()
    physObj:EnableCollisions(true)  
    

  34. Post #34
    Gold Member
    Robbis_1's Avatar
    July 2005
    344 Posts
    Aah, the previous physobject becomes invalid so I need to fetch the new one I just created... And the convex table is a table of convexes for each bone. Thanks a lot, it works now!

  35. Post #35
    Box collector
    haza55's Avatar
    October 2005
    545 Posts
    No, bones are more than one PhysObj

    A PhysObj can have more than one Convex, Each Convex is literally a convex shape made up of triangles. To make something concave, you need to use more than one convex.

  36. Post #36
    Gold Member
    Robbis_1's Avatar
    July 2005
    344 Posts
    Ah, that's making more sense.

    Edited:

    Any idea what's causing the "slidyness" when you try to jump on it as a player? It works fine for props vs props, but player vs props is weird. This is in SP, but maybe it's related to prediction in some way?

  37. Post #37
    Grocel's Avatar
    October 2008
    1,208 Posts
    Ah, that's making more sense.

    Edited:

    Any idea what's causing the "slidyness" when you try to jump on it as a player? It works fine for props vs props, but player vs props is weird. This is in SP, but maybe it's related to prediction in some way?
    That the reason why Haza is working on a client-side part of this module.

  38. Post #38
    Gold Member
    Zenreon117's Avatar
    April 2008
    5,108 Posts
    how do I install this?
    Reply With Quote Edit / Delete Reply Canada Show Events Dumb Dumb x 6 (list)

  39. Post #39
    MegaDeath's Avatar
    August 2007
    93 Posts
    Best module ever, Garry needs to incorporate this like he did Jinto's code :D
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  40. Post #40
    nemomurder22's Avatar
    June 2010
    162 Posts
    How do we install this? There are multiple files and no info.txt so... Maybe Steam>Steamapps>garrysmod folder 1?


    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 19Bad Reading Bad Reading x 3Funny Funny x 1 (list)