CreateColPolygon: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
colshape createColPolygon ( float fX, float fY, float fX1, float fX2, float fX3, ... ) | colshape createColPolygon ( float fX, float fY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, ... ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 11: | Line 11: | ||
*'''fX:''' The X position of the collision polygon's dummy point | *'''fX:''' The X position of the collision polygon's dummy point | ||
*'''fY:''' The Y 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 | *'''fX1:''' The 1st X position of the collision polygon's bound point | ||
*'''fX2:''' The | *'''fY1:''' The 1st Y position of the collision polygon's bound point | ||
*'''fX3:''' The | *'''fX2:''' The 2nd X position of the collision polygon's bound point | ||
*'''fY2:''' The 2nd Y position of the collision polygon's bound point | |||
*'''fX3:''' The 3rd X position of the collision polygon's bound point | |||
*'''fY3:''' The 3rd Y position of the collision polygon's bound point | |||
*'''...''' From the 3rd position you can have as many points as you require to create the colshape. | *'''...''' From the 3rd position you can have as many points as you require to create the colshape. | ||
Revision as of 14:20, 30 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. There should be at least 3 bound points set.
Syntax
colshape createColPolygon ( float fX, float fY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, ... )
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 X position of the collision polygon's bound point
- fY1: The 1st Y position of the collision polygon's bound point
- fX2: The 2nd X position of the collision polygon's bound point
- fY2: The 2nd Y position of the collision polygon's bound point
- fX3: The 3rd X position of the collision polygon's bound point
- fY3: The 3rd Y position of the collision polygon's bound point
- ... From the 3rd position you can have as many points as you require to create the colshape.
Returns
Returns a colshape element if successful, false if invalid arguments were passed to the function.
Example
Click to collapse [-]
Server--To Do.
Click to collapse [-]
Client--To 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