Demos  

     

Car parking game based on Box2DFlashAS3 physics engine

in

A simple car parking game powered by Box2D physics engine.

Rolling balls -- new progresses of RigidAPE

in

Since last release of RigidParticle, I've been working on it's restructuring.
And now there's finally some new progress I can share with you.

These are the major updates:

  • Hit point detection has been moved to CollisionDetector. I think that makes more sense to me.
  • Collision resolve of rigid body have been moved to a new class -- RigidCollisionResolver. And the collision resolve and rotation calculation has been completely rewritten. In the last demo, The RigidParticle is just "looks like" a rigid body, but now, it is a real rigid body.
  • RigidParticle has been removed. And there's 3 new classes -- RigidItem, RigidRectangle and RigidCircle -- taking its place. RigidItem is the root of all rigid bodies in this new framework, It provides common operations for all kinds of rigid bodies. RigidRectangle is just like the original RigidParticle, It simulates a rigid body in rectangle shape. RigidCircle is new, It simulates a circular rigid body. Maybe you think a circular object doesn't need to be a rigid body, You will see from this demo, a particle can never do that...

Flash 3D engine with "obj" file support

in


This 3D engine can load models in a standard "obj" file, and display it in real 3D.
Many 3D tools can export "obj" file format. I'm using SketchUp pro.
My 3D car simulation application was based on this engine.

Originally it was an open source 3D engine writen in AS1.0, I found it years ago, then I rewrote it in 2.0, and added some new feature to it. Different from other 3D engines use pixels graphics to draw polygons, This 3D engine use vector graphics to display polygons. This method is suitable for flash player 7, since it doesn't have bitmap abillity. And it's more good looking, because vector graphics are naturally anti-aliased by the player.
For flash player 8 or later, a pixel engine is a better choice.

The hidden surface removal is buggy, because most hidden surface removal method are not designed for vector graphics. So I took a shortcut. Although it's a buggy method, but you still can get perfect result if you spend some time refine your model. Load the model house.obj, you can see the engine is working very well on this model.

3D Car simulation

in


This is the 3D version of Car dynamics experiment.
They share the same rigid body engine (The rigid body engine uses 3D vectors), only this one is displayed in 3D.

Car dynamics experiment

in

This application simulates movements of a car.
There's a special physics system in this application. It's based on particles but you can use several particles to form a rigid body.
Every particle has its mass, and when they were formed into a rigid body, the system calculates the center of gravity and moment of inertia for the rigid body. When a force was applyed to a particle, the physics system calculates acceleration and rotational acceleration for the whole rigid body and make it move.
To simulate the car, I used 4 particles (one for each wheel) to form the car rigid body. Thrusts and frictions were applyed to these wheels.
The friction calculation is special. Since wheels have direction. In the same direction of their rotation, they are free to move. But on the perpendicular direction of their rotation, they tends to stop the movement (Actually it's this friction that makes the car turns).

RigidParticle for APE -- IT'S WORKING!!!

in

This is an extension of RectangleParticle class for APE engine.
It added angular velocity and caculates the rotation movements for a RectangleParticle when collision happens. The particle now acts like a real box.
Here is the sample:
No constraint were used in this sample, all objects are particle.

Updated on 9/23:
Rewrote the hitpoint finding method, No more sudden spinning now...
Press UP key to add more boxes to the scene. you can see it's power.

the source code is here.

Syndicate content