If you want to contribute to the forum discussions, please Register or Login.
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
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!
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.
DigitalRune is a trademark of Garstenauer Information Technology OG.
Garstenauer Information Technology OG Weingartenstrasse 35, 4452 Ternberg Austria (EUROPE) office@digitalrune.com