Not logged in
Register | Login

Menu:

Game Maker Extensions Menu:

av. 10/10 | Who rated

Credit to Gamer3D

Downloads: 1154

Tags:

Get a refer button for this extension!

BBcode

html [example]
download
[download]

DynamX Engine

Posted by Gamer3D on December 18, 2007

A stable 2D rigid-body physics engine. Later updates will include speed increases and error fixes.

  

» Add a Screenshot


Functions:

physics_step(time)

Advances the simulation by time (in seconds).

physics_polygon_add()

Adds a shape to the simulation and returns the handle.

Returns The handle of the polygon

physics_polygon_add_vertex(handle, x, y)

Adds a point to the shape.

physics_polygon_get_area(handle)

Returns the area of the shape.

Returns The area of the polygon

physics_polygon_remove(handle)

Destroys the polygon, freeing the memory.

physics_set_default_gravity(xgravity, ygravity)

Sets the default gravity for objects.

physics_object_add(polygon)

Adds an object to the simulation and returns the handle.

Returns The handle of the object

physics_object_apply_impulse(handle, x, y, impulsex, impulsey)

Applies an impulse to the object. This function is mainly experimental.

physics_object_set_position(handle, x, y)

Sets the position of the object

physics_object_get_position_x(handle)

Returns the object's X position.

Returns The object's X position

physics_object_get_position_y(handle)

Returns the object's Y position.

Returns The object's Y position

physics_object_set_velocity(handle, hspeed, vspeed)

Sets the object's velocity vector (in units per second).

physics_object_get_velocity_x(handle)

Returns the object's horizontal velocity.

Returns The object's horizontal velocity

physics_object_get_velocity_y(handle)

Returns the object's vertical velocity.

Returns The object's vertical velocity

physics_object_set_orientation(handle, angle)

Sets the object's orientation in radians.

physics_object_get_orientation(handle)

Returns the object's orientation in radians.

Returns The object's orientation

physics_object_set_angular_velocity(handle, angular_velocity)

Sets the object's angular velocity (speed of rotation) in radians per second.

physics_object_get_angular_velocity(handle)

Returns the object's angular velocity (speed of rotation) in radians per second.

Returns The object's angular velocity

physics_object_set_density(handle, density)

Sets the density of the object.

physics_object_get_mass(handle)

Returns the mass of the object.

Returns The object's mass

physics_object_set_anchored(handle, anchored)

Sets whether the object is anchored (fixed in one position).

physics_object_set_gravity(handle, xgravity, ygravity)

Sets the gravity of the object.

physics_object_set_friction(handle, friction)

Sets the friction of the object.

physics_object_set_elasticity(handle, elasticity)

Sets the elasticity (bounciness) of the object.

physics_object_last_collision(handle)

Returns the handle of the last object that this object has collided with.

Returns The handle of the last object collided with

physics_object_remove(handle)

Removes the object from the simulation.

physics_object_body_count()

Returns the number of objects being simulated.

Returns The number of simulated objects





You not logged on! It is recommended you logon before commenting so we can tell who you are!

Comments:

2:38pm, 9 Jan 2008
Schyler

This is actually alright.
When I added my own object though it froze when they went on top of each other.

Not sure about using it in a game.

7:08pm, 9 Jan 2008
Gamer3D

Hmm... I didn't think it even could freeze. I had designed it without the possibility of an infinite loop...