PhysObj.GetMassCenter

From GMod Wiki

Jump to: navigation, search
Function
Syntax PhysObj.GetMassCenter( )
Where is this used?
Description:
Returns the center of gravity local the the entity.
Returns: Vector
Part of Library: PhysObj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.GetMassCenter]PhysObj.GetMassCenter [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFind the center of gravity of an entity.
Used onNewerShared.png
Code
//We will be pretending the entity's mass center is Vector(3,3,3).
local phys = Ent:GetPhysicsObject()
if phys and phys:IsValid() then
 print(phys:GetMassCenter())
end
OutputShould be Vector(3, 3, 3)


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox