1. Post #121
    Gold Member
    ralle105's Avatar
    October 2005
    4,626 Posts
    What is wrong here?
    Code:
    ] lua_run print(ents.FindByClass("star")[1]:GetPhysicsObject())
    > print(ents.FindByClass("star")[1]:GetPhysicsObject())...
    PhysObject
    ] lua_run print(ents.FindByClass("star")[1]:GetPhysicsObject():IsValid())
    > print(ents.FindByClass("star")[1]:GetPhysicsObject():IsValid())...
    true
    ] lua_run print(ents.FindByClass("star")[1]:GetPhysicsObject():GetConvexCount())
    > print(ents.FindByClass("star")[1]:GetPhysicsObject():GetConvexCount())...
    :1: attempt to call method 'GetConvexCount' (a nil value)
    And yeah the module is require'd.
    You need to require it in the "InitPostEntity" hook

  2. Post #122
    likes men
    Python1320's Avatar
    May 2007
    1,711 Posts
    Linux version here, just tested it with Ram: http://g.iriz.org/~srcds/modules/
    Reply With Quote Edit / Delete Reply Finland Show Events Friendly Friendly x 1 (list)

  3. Post #123
    Gold Member
    maurits150's Avatar
    February 2007
    1,803 Posts
    It still doesn't work, and I require'd it in the GM:InitPostEntity() function

    Edited:

    Nevermind, it works perfect. Thanks for your help.

  4. Post #124
    Gold Member
    maurits150's Avatar
    February 2007
    1,803 Posts
    Alright I still don't know what's wrong this time.
    Code:
    > print(ents.FindByClass("star")[1]:GetPhysicsObject():GetConvexMesh(0))...
    attempt to index a nil value

  5. Post #125
    Gold Member
    ralle105's Avatar
    October 2005
    4,626 Posts
    Alright I still don't know what's wrong this time.
    Code:
    > print(ents.FindByClass("star")[1]:GetPhysicsObject():GetConvexMesh(0))...
    attempt to index a nil value
    Haza told me it's most likely because the physics are represented by a sphere instead of a mesh in some models. Is it a round model?

  6. Post #126
    Gold Member
    maurits150's Avatar
    February 2007
    1,803 Posts
    Yes it's 100% round.

  7. Post #127
    Gold Member
    Skyfire12's Avatar
    August 2005
    154 Posts
    I suggested on the gmod moderator site (suggestion site) that this be made clientside. Hopefully it will help persuade Garry.

    Here is a link for you all to GO VOTE
    http://www.google.com/moderator/#15/...=2a287.42&v=24
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 3Lua King Lua King x 1 (list)

  8. Post #128
    Grocel's Avatar
    October 2008
    1,208 Posts
    I suggested on the gmod moderator site (suggestion site) that this be made clientside. Hopefully it will help persuade Garry.

    Here is a link for you all to GO VOTE
    http://www.google.com/moderator/#15/...=2a287.42&v=24
    It's not Garry's module it's Haza's one, Haza has to make it clientside, but it doesn't works for him because the clientside physics is different and seem to be uneditable. It needs to work clientside or Garry wont add it to gmod.

  9. Post #129
    Gold Member
    Treelor's Avatar
    February 2005
    2,056 Posts
    I was under the impression that without Garry's help, it would never be clientside.
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 2 (list)

  10. Post #130
    Kaizergidorah's Avatar
    September 2010
    40 Posts
    How do you open the Binary File? Please message me the answer, cause I'm gonna forget I posted this in about a half hour. >_<'
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 5 (list)

  11. Post #131
    Grocel's Avatar
    October 2008
    1,208 Posts
    It's nothing to open, it's some thing that comes in the lua/includes/modules folder. It will add some APIs to Garry's mod for developers.

  12. Post #132
    NickL's Avatar
    December 2009
    80 Posts
    Very nice!

  13. Post #133
    IrishGuy's Avatar
    April 2008
    76 Posts
    Is this project dead? Any update news?

  14. Post #134
    Gold Member
    Link00y's Avatar
    April 2006
    244 Posts
    Sorry to bump here.. however since a quite recent update the Linux version of http://g.iriz.org/~srcds/modules/ seems to not work anymore.. it shows "Could not get iPhysics collection" at start-up and that's unfortunately it :( . Can anyone confirm this.

    Edit: Well, I feel dumb now.. I reinstalled gmod on my server three times, three fresh installs.. after a restart of the complete server it worked.. absolutely sorry to bump this - great work you did here though.
    Reply With Quote Edit / Delete Reply Germany Show Events Informative Informative x 1 (list)

  15. Post #135
    Gold Member
    JoeSkylynx's Avatar
    October 2008
    10,972 Posts
    Holy shit, magical bump Link.

    What ever happened to this project? Is it still in the works aswell as Perma Poly Weld?

  16. Post #136

    July 2011
    2 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]
    yeah why the hell does it say the archive cannot be opened with the programes.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 4Dumb Dumb x 2 (list)

  17. Post #137
    Casual Bananas
    E X C L's Avatar
    February 2011
    1,709 Posts
    Could somebody make me a mac compile?
    I keep failing to do it.

  18. Post #138
    Casual Bananas
    E X C L's Avatar
    February 2011
    1,709 Posts
    Nevermind.

    Edited:

    Damn, it didn't auto merge.

  19. Post #139
    @iRzilla's Avatar
    December 2011
    52 Posts
    Has anybody been able to recreate this effect on a vehicle? I've been trying with a HL2 buggy using the following code, but rebuilding the convexs causes it to crash.

    if SERVER then
    	local ent = player.GetAll()[1]:GetEyeTrace().Entity
    	
    	local scale = 0.5
    	local scale_v = Vector(1, 1, 1) * scale
    	
    	if ( ent == nil or !ent:IsValid() ) then
    		return
    	end
    	
    	local phys = ent:GetPhysicsObject()
    	
    	if ( phys == nil or !phys:IsValid() ) then
    		return
    	end
    	
    	local mesh = {}
    
    	phys:EnableCollisions(false)
    	phys:EnableGravity(false)
    	phys:EnableMotion(false)
    	phys:Sleep()
    	
    	if !ent.DefaultMesh then
    		ent.DefaultMesh = {}
    			
    		for i=0, phys:GetConvexCount()-1 do
    			table.insert(ent.DefaultMesh, phys:GetConvexMesh(i))
    		end
    	end
    	
    	for _, me in pairs(ent.DefaultMesh) do
    		local mo = {}
    		for _, m in pairs(me) do
    			local m2 = {}
    			m2[1] = m[1] * scale_v
    			m2[2] = m[2] * scale_v
    			m2[3] = m[3] * scale_v
    			table.insert(mo, m2)
    		end
    		
    		table.insert(mesh, mo)
    	end
    	
    	local pos = phys:GetPos()
    	local ang = phys:GetAngle()
    	local mass = phys:GetMass() * scale
    	local damp = phys:GetDamping() * scale
    	local rotdamp = phys:GetRotDamping() * scale
    	
    	phys:RebuildFromConvexs( pos, ang, mass, damp, rotdamp, 0.5, 0.5, mesh )
    	ent:SetNetworkedFloat( "scale", scale ) -- won't need this cause we'll know our size clientside too.
    	
    	phys:EnableCollisions(true)
    	phys:EnableGravity(true)
    	phys:EnableMotion(true)
    	phys:Wake()
    	
    	print("Done!")
    end
    
    if CLIENT then
    	hook.Add("Think", "JUSTTEMP", function()
    		for _, v in pairs(ents.GetAll()) do
    			v.Scale = v:GetNWFloat("scale", 1)
    			v:SetModelScale( Vector(1, 1, 1) * v.Scale ) -- We need to call this in the Draw hook because it gets reset.
    		end
    	end)
    end
    
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Funny Funny x 1 (list)

  20. Post #140
    Bishop's Avatar
    April 2010
    32 Posts
    Old, old ass thread with good potential

    wonder if this would have been implemented if it was completed

    implimented to garrysmod i mean
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Dumb Dumb x 7Agree Agree x 1 (list)

  21. Post #141
    Gold Member
    thegrb93's Avatar
    June 2006
    1,364 Posts
    So I'm thinking about making a gamemode with this, but I'm concerned as to what will happen if people walk in a structure built with this since prediction isn't finished. Any ideas to its effects? jittery screen? delayed movement?

  22. Post #142
    Dennab
    December 2008
    275 Posts
    Sorry for bumping this- but was this module included in gm13? and if not, is it still compatible?

    and thirdly, it would be really interesting to get some tools (with ad2 support) rolling. Queryphys has just kind of sat on the backburner, it has massive potential.

    Especially for a project idea of scaling all models (and player) down to "increase" the size of maps.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 1 (list)

  23. Post #143
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    Was pretty much included yea, about the other stuff, not so much.