constraint.Elastic

From GMod Wiki

Revision as of 05:39, 2 March 2010 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax constraint.Elastic( Entity Ent1, Entity Ent2, Number Bone1, Number Bone2, Vector LPos1, Vector LPos2, Number constant, Number damping, Number rdamping, String material, Number width, Number stretchonly )
Where is this used?
Description:
Creates an elastic constraint.
Returns: Entity constraint, Entity rope
Part of Library: Constraint
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Constraint.Elastic]Constraint.Elastic [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionTaken from the Elastic tool in toolgun.
Used onNewerServer.png
Code
// Get client's CVars
local constant		= self:GetClientNumber( "constant" )
local damping		= self:GetClientNumber( "damping" )
local rdamping		= self:GetClientNumber( "rdamping" )
local material 		= self:GetClientInfo( "material" )
local width 		= self:GetClientNumber( "width" )
local stretchonly	= self:GetClientNumber( "stretch_only" )
 
// Get information we're about to use
local Ent1,  Ent2  = self:GetEnt(1),	 	self:GetEnt(2)
local Bone1, Bone2 = self:GetBone(1),	 	self:GetBone(2)
local LPos1, LPos2 = self:GetLocalPos(1),	self:GetLocalPos(2)
local constraint, rope = constraint.Elastic( Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, constant, damping, rdamping, material, width, stretchonly )
OutputN/A


Additional Notes

See Also

Stub.pngThis article is a stub.
You can help the GMod Wiki by expanding it.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox