By: Nobody/Anonymous
- nobody |
You asked for comments
on Darkbasic so here is my assessment of DBPro:- |
By: Martin Baker - martinbaker |
Giles, |
By: Nobody/Anonymous
- nobody |
Hi Martin,
This is a bit of a 'depends' question. Darkbasic does have a simple collision system built in, most people have found it inadequate however and this has led to various 'plugins' becoming available.
For instance I was, initially, looking at your website in order to work out how to 'reflect' (actually rebound) a ball from a plane at any angle, in order to get the best possible collision detection I am using a 3rd party plug in called 'NGCollision' (NG = Nuclear Glory) which cost me about £8.50. As well as giving me superb collision detection and automatically patrolling the object boundaries (no pass through) it also passes back extra information such as the normal of the plane I hit and the coordinates of each of the corners of the plane. Armed with this data and the reflection matrix from your site reflection was then relatively simple.
So that gets me part way there, but I still have to write the physics parts myself.
However while trying to work out how to do a true rotate around the global axes in DBPro (DBPro`s rotate commands work on Euler angles) I came across a free DBPro library called EZRotate, which allows both Local axes and global axes rotations to be applied to an object, I noticed that the same coder has created a DBPro 'wrapper' for the Tokamak physics libraries. I have downloaded this but have not had time to do anymore than look at the Tokamak demos (if you have not seen this yet go to http://www.tokamakphysics.com/ - the demos are quite impressive).
So the short answer is 'Yes, you can do realistic physics in DBPro, but you need extra libraries'.
Another point worth mentioning is that DBPro has a bunch of commands to work with vectors and martices. These are sadly quite poorly documented, when I tried creating the reflection matrix from your site I was able to get the correct numbers for your example, but got odd numbers when I tried any source coords not on an axes (IE with more than one coord <> zero). It could simply be that I was setting up the matrix incorrectly; I ended up just re-writing the matrix as a long equation, as it worked fine that way.
Sorry for the long answer, hope this helps.
Regards,
Giles
By: Nobody/Anonymous
- nobody |
Since my last message I have had time to try out the Tokamak library in DBPro and have to say it is excellent, not least because it is free (makes me feel a bit of a berk for buying NGCollision as Tokamak has a great collision system built in).
Having set up 'objects' (actually collision boxes/spheres/capsules and terrain
type meshes) a single call to tokamak then updates all positions and angles
and I just have to read off the changes and apply them to the visible objects.
Everything is adjustable, gravity, friction, damping (angular and linear) etc
and you can apply forces directly to the objects.
Regards,
Giles