Entity.PhysicsFromMesh
From GMod Wiki
Function | |
Syntax | Entity:PhysicsFromMesh( Table :Mesh Vertexes vertexes ) |
Description: | |
Makes the physics object for an entity from a table of triangles. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.PhysicsFromMesh]Entity.PhysicsFromMesh [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Table Structure
Garry posted a small description of how to use this function (link available in notes section), but it is quite vague. Here is the best available interperation. The table given is otherwise known as a 'Mesh'. A mesh table stores the triangular faces of the model in tabular structure. Each triangle is a table with the three vector positions defined in clockwise order.
Additional Notes
- Each triangle is defined by 3 vectors, and be sure to define the triangle clockwise. The tables are defined like this:
table - 1 - pos - vector 2 - pos - vector 3 - pos - vector