Tag Info

16

2D Farseer is based on box2d but has lot of its own improvements and innovations. Box2Dx & Box2D.Xna are both ports of box 2D i think theres a port of chipmunk physics out there, but i cant find the link 3D JigLib one of the earliest 3d physics engines for xna, been used quite a bit Jitter Quite a new engine, but more per formant than JigLib ...

15

Solving this problem requires adjusting position and possibly velocity. Rigid body physics engines have a solver that march objects forward in time using Newton's laws of motion while also solving non-penetration constraints and friction. These engines can compute the right combination of linear and angular motion to create plausible trajectories. If you ...

14

While I recommend against rolling your own physics engine for anything other than the experience of doing it (just realize you probably should throw it away when you're done -- it's really hard to get all the edgecases and numeric limit/stability issues sorted out, and your time may be much better used by contributing to an existing engine), here are a few ...

13

Here's the basic steps you'll need to folow: First create a world object (i.e. btDiscreteDynamicsWorld) to drive your physics simulation. You should already have a class such as GameObject that perhaps stores a model along with its bounding box and position/orientation in the world. Replace the position/orientation information with an instance of a physics ...

10

How to start an Architecture/Design Task: With pen and paper. Get yourself a large sheet of paper and start drawing out the components and items that will exist within your engine. What properties each entity will need so that you can model the physical interaction. You'll need to figure out what entities your code will have to deal with, which entity has ...

10

You don't need a physics engine for this because the calculations required are extremely simple! All you have to do is to apply some gravity to your player's vertical velocity, and he will automatically follow an arc when jumping. For a detailed explanation of how it works, including a demo that runs in the browser, read the following answer: http://...

10

Spatial division is always O(N^2) in worst case and that is what complexity in informatics is about. However there are algorithms that work in linear time O(N). All of them are based on some kind of sweep line. Basically you need to have your objects sorted by one coordinate. Let's say X. If you perform the sort every time before collision detection, the ...

9

Here is how I learned to write a physics engine, its all free and highly recommendable: David Baraff's papers particulary An Introduction to Physically Based Modeling Brian Vincent Mirtich's Thesis Impulse-based Dynamic Simulation of Rigid Body Systems Kacic/Bullock "A practical dynamics system" SIGRAPH 2003, EDIT: Link added. Those papers were ...

8

First, I recommend using a free, open-source physics library like Box2D and just focusing on the aspects of your game that make it unique! If you insist on re-inventing the wheel, read on... note all physics engines are approximations, and while the method I outline below will be more accurate than your current model, Box2D's results will be far more ...

8

No. Collision detection is not always O(N^2). For instance, say we have a 100x100 space with objects with size 10x10. We could divide this space in cells of 10x10 with a grid. Each object can be in up to 4 grid cells (it could fit right in a block or be "between" cells). We could keep a list of objects in each cell. We only need to check for collisions in ...

7

This question is pretty much 'what is a game engine'. Game engines are whatever software is needed to make a game, and there is no accepted checklist of what needs to be in such an engine for it to qualify. That said, any simulation-style game will essentially do three things: acquire input, perform simulation, and present output. For input you need to ...

7

I was going to suggest that this is a hard problem because the usual formulations based on using Green's Theorem to convert volume integrals into surface integrals don't apply, and so you actually do have to provide a tetrahedral decomposition of your figure - but it turns out that that's not correct. As long as your shape is of uniform density (which is an ...

7

As far what physics engines do, I wrote an apparently decent post here: How does a collision engine work? A game engine is software that is intended to make it easy to develop a game without needing to invest in a great deal of additional technology. In other words, it implements all the basic technologies of games like graphics, physics, networking, input,...

7

Nowadays, more game engines adopts a component design (e.g. Unity, Unreal). In this kind of design, a GameObject is composed of a list of components. In your situation, there can be a MeshComponent and a PhysicalComponent, both attaching to a single game object. For simplicity, you can put a world transform variable to the GameObject. During update phrase, ...

6

Here's how you might do it: Approximating movement Every physics object needs these vectors: Position: Where the object is. Speed: How its position is changing. Acceleration: How its speed is changing. So, intuitively, you need to do this sort of thing every frame to every physics object a: a.speed += a.acceleration a.position += a.speed Pitfalls:...

6

I've used Farseer for XNA and it worked great. Comes with lots of example code as well so you can see it in action and has pretty good documentation.

6

Here is another such tutorial, which might help you: http://content.gpwiki.org/index.php/OpenGL:Tutorials:Basic_Bones_System It's very thorough, and I even used it once to produce an animation engine. The theory is very good and it should be easily understood for you to use it in AS3.

6

The keywords you're looking for are "support points" and "manifold". Erin Catto has written an excellent 2D physics engine. He regularly presents at GDC. You should be able to find some of his slides where he explains collision manifolds. The first version of his physics engine only supported box shapes to simply calculating the support points. Which is ...

6

I'm not entirely sure that you understand what the article means by a fixed timestep. requestAnimationFrame is defined as: Tells the browser that you wish to perform an animation; this requests that the browser schedule a repaint of the window for the next animation frame. The amount of time that passes between each invocation of the function varies ...

5

For a 3D physics library, BEPU physics has just recently became free for both commercial and non-commerical use.

5

There's no such thing as best physics engine. It heavily depends on what you need. Take Box2D as an Example: It is a fully featured 2D Physics Engine, originally developed in C++ and ported to ActionScript. It is great for realistic 2D physics simulation, including gravity, forces, friction, continuous collision detection and much more. An Engine like Box2D ...

5

Is it really efficient to load all your objects in the physical or collision world just to test them for intersection? Yes it is efficient... for the programmer. There are lots of physics engines around and it's far easier to just use one - than to strip one down, or implement raycasting yourself. Talking about code (in fairly rough terms): You've got ...

5

As you already suggested, you have to take the mass of the objects into account to calculate the change of velocity caused by the impulse. Namely, divide the impulse by the mass for each object. You can find this and much more information in this paper "Impulse-based Dynamic Simulation of Rigid Body Systems" from Brian Vincent Mirtich. Page 60 shows it in ...

5

You should be able have you character go up slopes without a 3rd party tool. You can attach the character controller(download it off the asset store, its free) and then you can change the angle that the character is allowed to move over (I have my player able to climb up to a 50' angle, be sure the re-angle the character though). The 2D Toolkit is ...

5

Use the same time steps every time. My physics engine is set to use 33 ms time steps, and I can produce the exact same simulations that way (assuming I use the same machine.) If I use different time steps, even 1 ms more, the game will slowly diverge. You can do this with this basic loop: void update( long timeMS ) { _accumulatedTime += timeMS; ...

Only top voted, non community-wiki answers of a minimum length are eligible