Entity/GetConstrainedPhysObjects

From Garry's Mod
Jump to: navigation, search
 Entity:GetConstrainedPhysObjects( )

Contents

Description

Returns the two entities physobjects involved in a constraint ent, or no value if the entity is not a constraint.

Returns

PhysObj

phys1

Returns

PhysObj

phys2

Examples

Example

From gmsave/constraints.lua

function gmsave.ConstraintSave( ent )
 local t = {}
 t.EntOne, t.EntTwo = ent:GetConstrainedEntities()
 local PhysA, PhysB = ent:GetConstrainedPhysObjects()
 
 t.BoneOne = GetPhysicsObjectNum( t.EntOne, PhysA )
 t.BoneTwo = GetPhysicsObjectNum( t.EntTwo, PhysB )
 t.EntOne = gmsave.EntityEncode( t.EntOne )
 t.EntTwo = gmsave.EntityEncode( t.EntTwo )
 return t
end


Personal tools
Navigation