Garry's Mod Wiki

Revision Difference

Entity:PhysicsFromMesh#518315

<function name="PhysicsFromMesh" parent="Entity" type="classfunc"> <description> Initializes the physics mesh of the entity from a triangle soup defined by a table of vertices. The resulting mesh is hollow, may contain holes, and always has a volume of 0. While this is very useful for static geometry such as terrain displacements, it is advised to use <page>Entity:PhysicsInitConvex</page> or <page>Entity:PhysicsInitMultiConvex</page> for moving solid objects instead. <page>Entity:EnableCustomCollisions</page> needs to be called if you want players to collide with the entity correctly. </description> <realm>Shared</realm> <args> <arg name="vertices" type="table">A table consisting of &lt;page&gt;MeshVertex&lt;/page&gt; (only the `pos` element is taken into account). Every 3 vertices define a triangle in the physics mesh.</arg> <arg name="vertices" type="table">A table consisting of <page>MeshVertex</page> (only the `pos` element is taken into account). Every 3 vertices define a triangle in the physics mesh.</arg> </args> <rets> <ret name="" type="boolean">Returns true on success, nil otherwise.</ret> </rets> </function>