QueryPhys

From GMod Wiki

Revision as of 08:15, 30 April 2011 by Seikatsusentō (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Third-party Library - gm_queryphys.dll
Name Queryphys
Description:
A method of getting the vertexes of a physics object.
Download gm_queryphys.dll
Source gm_queryphy svn
Author haza55

Functions

Library Function
SyntaxGetConvexCount( PhysObj )
Description:
Returns the number of convexs.
Returns:Number of convexs
Library Function
SyntaxGetConvexMesh(convexIndex)( PhysObj )
Description:
Returns a table of triangles.
Returns:Table of Triangles.
Library Function
SyntaxRebuildFromConvexs( Vector position,Angle Angle,Integer mass,Number damping,Number rotDamping,Number inertia,Number rotInertiaLimit,Table convexes )
Description:
Rebuilds a PhysObj with the provided convexes.
Returns:PhysObj with the provided convexes
DescriptionComplete use of the module.
Used onNewerClient.png Client
Code
 
    local ent = Ply:GetEyeTrace().Entity 
	local physObj = ent:GetPhysicsObject() 
 
	physObj:EnableCollisions(false)
 
	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)  
 
Outputrebuild of the target object


Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox