Yes I did
Originally Posted by publius
But I've just discovered in most circumstances that the C++ dll doesn't speed things up at all, and on some computers it actually slows it down. So I retract my claim of 6x faster that I made above. (One of the biggest hassels of programming is assuming that something will behave on other computers the same way it behaves in my computer.) The only way to see for yourself is to temporarily re-name codeoptomizer.dll and compare the speed of a simulation to its speed using codepotomizer.dll. If you re-compile it using a different compiler, you can probably guage the relative difference between your compiled version and the .NET compiled version.
Originally Posted by tony873004
If it helps you, here's the VB code that calls the .dll.
This declares it. This snipet of code is only executed once:
And this calls it. This code is executed once per iteration.
Private Declare Function RunLoop Lib "CodeOptomizer.dll" (ByVal NumObjects As Long, _
ByRef ObjMass As Double, ByRef objx As Double, ByRef objy As Double, _
ByRef objz As Double, ByRef objvx As Double, ByRef objvy As Double, _
ByRef objvz As Double, ByRef objsize As Double, _
ByRef CollisionObjectA As Long, ByRef CollisionObjectB As Long) As Integer
Also, if you make a change to codeoptomizer.dll, either by replacing it with a different version, or by renaming it as to hide it, you must exit Gravity Simulator and start again as it only reads it in once at the beginning of the program, and won't recognize your change.
xxx = RunLoop(objects, ObjMass(0), objx(0), objy(0), objz(0), objvx(0), objvy(0), objvz(0), objsize(0), CollisionObjectA(0), CollisionObjectB(0))