3D vehicle simulator in which vechicle's configuration as a whole (articulated body) , is represented by a 'vector' of generalised coordinates. so concepts like usual position and orientation of main body and wheels is all defined by the generalised coordinates.Using Lagrangian dynamics, theese coordinates are evolving in time in a realistic manner according to F=ma but as if there were also all constraint forces concretasing the presence of joints: hinge, prismatic, rigid connection, etc. all derivatives are done with finite differences, so it's all simple. in 3 videos I explain all the mechanics and its simulation up to this simple but pow method.Pure Lagrangian mechanics until now has not been used much or at all,in simulation videogames,but i decided to try it because it was promising, very simple compared to the fnal results, and there was not much docu on its use in simulation games: this lack was completed now.
will com also a non-GL version
- articulated body simulation using pure Lagrangian dynamics implemented in a way feasible for computer-simulation.
- very short and simple sourcecode, because the very Lagrangian method is very simple to use.
- it is easyest to extend to simulation of other articulated mechansms featuring only holonomic constraints; thus making this the beginning of a long series of simulation games
- extremely good performance... since no constraint forces are calculated, the computational heavyness of each simulation step is proportiaonal to the square of the number of degrees-of-freedom (a.k.a. "DOF") of the mechanical system to be simulated
- the simple plane-only version will be kept available separately always, for dydactical and/or documentation-related purposes
- I shall make soon available also a version which does 3D graphics form zero, and using only SDL library alone, to display resulting pixels: some evolution of the calssic "terep 2" game to a game based on a more 'advanced' simulation method that does not require to approximate car's dynamics at all ( or almost at all)
- practically no approximation in vehicle's dynamics, and wheels do rotate also visually.
- there are subversions with hilly terrain with trees, both car and truck. In principle it can handle also multi-trailer truck setups. I shall make a version when one can attach more trailers or just pull as many 'things' as he wants (like trunks) or so... pull-wires can be simulated with grat speed and stability... Well... after all what's better for simulating also lifter-trucks, than the Lagrangian metod? I shall make subversion for each of the 'subdisciplines' or trucking and rally-ing.
- I have experimented recently with a way to include also highways (moreover, they would be editable) so that this will be able to be modernised remake of STUNTS optimised for high speeds, also with trucks. But without making the game heavy of transforming the soucecode in a huge brick.
- although I did not bother about implemnting collisions with objects around - at least something lik terrain-limiting walls - , but in some subversin i will include it... in the main point could be to simulate the collision of wheels with small object around, like rocks, or trucks scattered around. the lagrangian method thanks is strong in articulated bodies, so the poin in this would be in that the 'transmission' of a hit felt by a wheel is simulated accurately causing the hit to cause the whole system to 'vibrate' or however we wan to call it.
- internal view available, and for the external view, there is possibility to zoom all particulars: the articulations are well visualised in the game so there is a point in this. it is also possible to ge off the car to walk around and see all well.
If any suggestions, leave a comment.