• gm_queryphys
    142 replies, posted
  • Avatar of ralle105
  • [QUOTE=maurits150;24568477]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) [/code] And yeah the module is require'd.[/QUOTE] You need to require it in the "InitPostEntity" hook
  • Avatar of Python1320
  • Linux version here, just tested it with Ram: [url]http://g.iriz.org/~srcds/modules/[/url]
  • Avatar of maurits150
  • It still doesn't work, and I require'd it in the GM:InitPostEntity() function [editline]12:32AM[/editline] Nevermind, it works perfect. Thanks for your help.
  • Avatar of maurits150
  • 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 [/code]
  • Avatar of ralle105
  • [QUOTE=maurits150;24646442]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 [/code][/QUOTE] 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?
  • Avatar of Skyfire12
  • 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 [url]http://www.google.com/moderator/#15/e=2a287&t=2a287.42&v=24[/url]
  • Avatar of Grocel
  • [QUOTE=Skyfire12;24798058]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 [url]http://www.google.com/moderator/#15/e=2a287&t=2a287.42&v=24[/url][/QUOTE] 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.
  • Avatar of Treelor
  • I was under the impression that without Garry's help, it would never be clientside.
  • Avatar of Kaizergidorah
  • 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. >_<'
  • Avatar of Grocel
  • 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.
  • Avatar of Link00y
  • Sorry to bump here.. however since a quite recent update the Linux version of [url]http://g.iriz.org/~srcds/modules/[/url] 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.
  • Avatar of Joey Skylynx
  • Holy shit, magical bump Link. What ever happened to this project? Is it still in the works aswell as Perma Poly Weld?
  • [QUOTE=haza55;22406390][release][highlight]gm_queryphys[/highlight] This module is a way of getting the vertexes of a physics object. [/release] [release][highlight]Functions[/highlight] [lua] -- 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) [/lua] [/release] [release][highlight]Download[/highlight] [img]http://www.sourcemm.net/media/images/code.gif[/img] Source Code SVN Repo: [url]http://gmod-haza.googlecode.com/svn/trunk/gm_queryphys/[/url] [img]http://www.sourcemm.net/media/images/win32.gif[/img] Windows Binary: [url]http://gmod-haza.googlecode.com/svn/trunk/gm_queryphys/Release/gm_queryphys.dll[/url] [/release][/QUOTE] yeah why the hell does it say the archive cannot be opened with the programes.
  • Avatar of E X C L
  • Nevermind. [editline]26th November 2011[/editline] Damn, it didn't auto merge.
  • Avatar of @iRzilla
  • 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. [lua] 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 [/lua]
  • Avatar of Bishop
  • Old, old ass thread with good potential wonder if this would have been implemented if it was completed implimented to garrysmod i mean
  • Avatar of thegrb93
  • 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?
  • Avatar of space toe
  • 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.