Maarten Baert's website

Game Maker / C++ projects

Home Model Creator ExtremePhysics Game Maker DLLs SimpleScreenRecorder AlterPCB Quadcopters   Recent comments Search

Last modified: Sat, 25 Sep 2010
Refresh

Polygon


ep_polygon_create

ep_polygon_create(world_id, vertex_count)

Creates a new polygon.

Returns the id of the new polygon.

  • world_id: The id of the world.

  • vertex_count: The number of vertices.


ep_polygon_destroy

ep_polygon_destroy(world_id, polygon_id)

Destroys the polygon. This will fail if the polygon is still in use.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_exists

ep_polygon_exists(world_id, polygon_id)

Returns whether the polygon with the given id exists.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_set_vertex

ep_polygon_set_vertex(world_id, polygon_id, index, x, y)

Sets the coordinates of the vertex with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the vertex (0 is the first index).

  • x: The x coordinate of the vertex.

  • y: The y coordinate of the vertex.


ep_polygon_initialize

ep_polygon_initialize(world_id, polygon_id)

Initializes the polygon. You have to do this before using the polygon. After initialization you can't change the vertices anymore.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_get_vertex_count

ep_polygon_get_vertex_count(world_id, polygon_id)

Returns the number of vertices.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_get_vertex_x

ep_polygon_get_vertex_x(world_id, polygon_id, index)

Returns the x coordinate of the vertex with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the vertex (0 is the first index).


ep_polygon_get_vertex_y

ep_polygon_get_vertex_y(world_id, polygon_id, index)

Returns the y coordinate of the vertex with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the vertex (0 is the first index).


ep_polygon_get_vertex_normal_x

ep_polygon_get_vertex_normal_x(world_id, polygon_id, index)

Returns the x component of the normal vector of the vertex with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the vertex (0 is the first index).


ep_polygon_get_vertex_normal_y

ep_polygon_get_vertex_normal_y(world_id, polygon_id, index)

Returns the y component of the normal vector of the vertex with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the vertex (0 is the first index).


ep_polygon_get_edge_length

ep_polygon_get_edge_length(world_id, polygon_id, index)

Returns the length of the edge with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index of the edge (e.g. 3 means the edge that connects vertex 3 and 4).


ep_polygon_previous

ep_polygon_previous(world_id, polygon_id)

Returns the id of the previous polygon, or 0 if there is no previous polygon.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_next

ep_polygon_next(world_id, polygon_id)

Returns the id of the next polygon, or 0 if there is no next polygon.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.


ep_polygon_set_uservar

ep_polygon_set_uservar(world_id, polygon_id, index, value)

Changes the value of the user variable with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index (0-4).

  • value: The new value.


ep_polygon_get_uservar

ep_polygon_get_uservar(world_id, polygon_id, index)

Returns the value of the user variable with the given index.

  • world_id: The id of the world.

  • polygon_id: The id of the polygon.

  • index: The index (0-4).


Comments

There are no comments yet.

Write a comment