Maarten Baert's website

Game Maker / C++ projects

Home Model Creator ExtremePhysics Game Maker DLLs   Recent comments Search

Last modified: Mon, 6 Sep 2010
Refresh

Shape


ep_shape_create_box

ep_shape_create_box(world_id, body_id, w, h, x, y, rot, density)

Creates a new box shape.

Returns the id of the new shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • w: The width of the box.

  • h: The height of the box.

  • x: The x component of the position of the center of the box (local coordinates).

  • y: The y component of the position of the center of the box (local coordinates).

  • rot: The rotation of the box (local coordinates).

  • density: The density of the box.


ep_shape_create_circle

ep_shape_create_circle(world_id, body_id, r, x, y, rot, density)

Creates a new circle shape.

Returns the id of the new shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • r: The radius of the circle.

  • x: The x component of the position of the center of the circle (local coordinates).

  • y: The y component of the position of the center of the circle (local coordinates).

  • rot: The rotation of the circle (local coordinates).

  • density: The density of the circle.


ep_shape_create_polygon

ep_shape_create_polygon(world_id, body_id, polygon_id, x, y, rot, density)

Creates a new polygon shape.

Returns the id of the new shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • polygon_id: The id of the polygon.

  • x: The x component of the position of the center of the polygon (local coordinates).

  • y: The y component of the position of the center of the polygon (local coordinates).

  • rot: The rotation of the polygon (local coordinates).

  • density: The density of the circle.


ep_shape_destroy

ep_shape_destroy(world_id, body_id, shape_id)

Destroys the shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_exists

ep_shape_exists(world_id, body_id, shape_id)

Returns whether the shape with the given id exists.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_get_first_contact

ep_shape_get_first_contact(world_id, body_id, shape_id)

Returns the id of the first contact connected to this shape, or 0 if there are no contacts connected to this shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_get_last_contact

ep_shape_get_last_contact(world_id, body_id, shape_id)

Returns the id of the last contact connected to this shape, or 0 if there are no contacts connected to this shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_get_previous_contact

ep_shape_get_previous_contact(world_id, body_id, shape_id, contact_id)

Returns the id of the previous contact connected to this body, or 0 if there is no previous contact.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • contact_id: The id of the contact.


ep_shape_get_next_contact

ep_shape_get_next_contact(world_id, body_id, shape_id, contact_id)

Returns the id of the next contact connected to this body, or 0 if there is no next contact.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • contact_id: The id of the contact.


ep_shape_set_material

ep_shape_set_material(world_id, body_id, shape_id, restitution, friction, normalvelocity, tangentvelocity)

Changes the material of the shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • restitution: The coefficient of restitution.

  • friction: The coefficient of friction.

  • normalvelocity: The normal velocity of the surface. This can be used to make 'bouncy' materials.

  • tangentvelocity: The tangential velocity of the surface. This can be used to simulate moving surfaces, like conveyor belts.


ep_shape_set_collision

ep_shape_set_collision(world_id, body_id, shape_id, collidemask1, collidemask2, group)

Changes the collision settings of the shape.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • collidemask1: The first collision mask.

  • collidemask2: The second collision mask.

  • group: The group. Use 0 for no group.


ep_shape_collision_test_box

ep_shape_collision_test_box(world_id,body_id,shape_id,w,h,x,y,rot,contact_threshold)

Returns whether the shape collides with a 'virtual' box.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • w: The width of the box.

  • h: The height of the box.

  • x: The x coordinate of the box (world coordinates).

  • y: The y coordinate of the box (world coordinates).

  • rot: The rotation of the box (world coordinates).

  • contact_threshold: The contact threshold.


ep_shape_collision_test_line

ep_shape_collision_test_line(world_id,body_id,shape_id,x1,y1,x2,y2,contact_threshold)

Returns whether the shape collides with a 'virtual' line.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • x1: The x coordinate of the first point (world coordinates).

  • y1: The y coordinate of the first point (world coordinates).

  • x2: The x coordinate of the second point (world coordinates).

  • y2: The y coordinate of the second point (world coordinates).

  • contact_threshold: The contact threshold.


ep_shape_collision_test_circle

ep_shape_collision_test_circle(world_id,body_id,shape_id,r,x,y,contact_threshold)

Returns whether the shape collides with a 'virtual' circle.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • r: The radius of the circle.

  • x: The x coordinate of the circle (world coordinates).

  • y: The y coordinate of the circle (world coordinates).

  • contact_threshold: The contact threshold.


ep_shape_collision_test_polygon

ep_shape_collision_test_polygon(world_id,body_id,shape_id,polygon_id,x,y,rot,contact_threshold)

Returns whether the shape collides with a 'virtual' polygon.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • polygon_id: The id of the polygon.

  • x: The x coordinate of the polygon (world coordinates).

  • y: The x coordinate of the polygon (world coordinates).

  • rot: The rotation of the polygon (world coordinates).

  • contact_threshold: The contact threshold.


ep_shape_ray_cast

ep_shape_ray_cast(world_id,body_id,shape_id,x,y,vx,vy)

Calculates whether a 'virtual' ray intersects the shape.

Returns the distance to the point of intersection, or -1 if there is no intersection.

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • x: The x coordinate of the starting point of the ray.

  • y: The y coordinate of the starting point of the ray.

  • vx: The x component of the direction vector of the ray.

  • vy: The y component of the direction vector of the ray.


ep_shape_previous

ep_shape_previous(world_id, body_id, shape_id)

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

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_next

ep_shape_next(world_id, body_id, shape_id)

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

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.


ep_shape_set_uservar

ep_shape_set_uservar(world_id, body_id, shape_id, index, value)

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

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • index: The index (0-4).

  • value: The new value.


ep_shape_get_uservar

ep_shape_get_uservar(world_id, body_id, shape_id, index)

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

  • world_id: The id of the world.

  • body_id: The id of the body.

  • shape_id: The id of the shape.

  • index: The index (0-4).


Comments

There are no comments yet.

Write a comment