CreateColCuboid: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function creates a collision | This function creates a collision polygon. See [http://en.wikipedia.org/wiki/Polygon Wikipedia] for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it somewhere within the polygon. It should be noted this shape is '''2D'''. You should be at least 3+ bound points set. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
colshape | colshape createColPolygon ( float fX, float fY, float fX1, float fX2, float fX3, ... ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''fX:''' The X position of the collision | *'''fX:''' The X position of the collision polygon's dummy point | ||
*'''fY:''' The Y position of the collision | *'''fY:''' The Y position of the collision polygon's dummy point | ||
*''' | *'''fX1:''' The 1st position of the collision polygon's bound point | ||
*''' | *'''fX2:''' The 2st position of the collision polygon's bound point | ||
*''' | *'''fX3:''' The 3st position of the collision polygon's bound point | ||
===Returns=== | ===Returns=== | ||
Line 21: | Line 20: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
To Do. | |||
</section> | </section> | ||
==See Also== | ==See Also== | ||
{{Collision shape functions}} | {{Collision shape functions}} |
Revision as of 18:03, 29 December 2008
This function creates a collision polygon. See Wikipedia for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it somewhere within the polygon. It should be noted this shape is 2D. You should be at least 3+ bound points set.
Syntax
colshape createColPolygon ( float fX, float fY, float fX1, float fX2, float fX3, ... )
Required Arguments
- fX: The X position of the collision polygon's dummy point
- fY: The Y position of the collision polygon's dummy point
- fX1: The 1st position of the collision polygon's bound point
- fX2: The 2st position of the collision polygon's bound point
- fX3: The 3st position of the collision polygon's bound point
Returns
Returns a colshape element if successful, false if invalid arguments were passed to the function.
Example
Click to collapse [-]
ServerTo Do.
See Also
- addColPolygonPoint
- createColCircle
- createColCuboid
- createColPolygon
- createColRectangle
- createColSphere
- createColTube
- getColPolygonHeight
- getColPolygonPoints
- getColPolygonPointPosition
- getColShapeType
- getColShapeRadius
- getColShapeSize
- getElementColShape
- getElementsWithinColShape
- isElementWithinColShape
- isInsideColShape
- removeColPolygonPoint
- setColPolygonHeight
- setColPolygonPointPosition
- setColShapeRadius
- setColShapeSize