HomeHomeGeneralGeneralGeneralGeneralQuestion on digitalrune physicsQuestion on digitalrune physics
Previous
 
Next
New Post
1/22/2012 12:13 PM
 

Hi, my name is Fabio and i have a question. I can use digitalrune physics for simulate a physics engine 2d? I can disable axis z?


thanks

 
New Post
1/22/2012 5:50 PM
 

Hi Fabio :)

Yes, because you may use any physic engine independently from how you represent the scende (2d or 3d).

for example, you may have a sphere.. than apply an impulse to it.

from the graphic point of view, just take x and z (not Y, the Y is the "up" axis) of the Vector3F position of the sphere, and use them in a Vector2 to draw a texture with a spritebatch.

 
New Post
1/22/2012 6:34 PM
 
Magic73 wrote:

Hi Fabio :)

Yes, because you may use any physic engine independently from how you represent the scende (2d or 3d).

for example, you may have a sphere.. than apply an impulse to it.

from the graphic point of view, just take x and z (not Y, the Y is the "up" axis) of the Vector3F position of the sphere, and use them in a Vector2 to draw a texture with a spritebatch.

 thank you!

 
New Post
1/23/2012 8:55 AM
 

The RigidBody class has flags which let you disable rotations about certain axes (e.g, RigidBody.LockRotationX). And you can use constraints like a PointOnPlaneConstraint  to keep all movement in the 2D plane.

As Magic73 explained, it is possible to use a 3D engine for 2D but I'd like to add: A 3D physics engine is more complex than a 2D engine and it has to do additional work to keep objects in a 2D plane. A dedicated 2D engine (e.g. Farseer or another Box2D clone) would be far more efficient for pure 2D games.

 
Previous
 
Next
HomeHomeGeneralGeneralGeneralGeneralQuestion on digitalrune physicsQuestion on digitalrune physics