Mixing Unmanaged C ++ with F # for Physics: Is It Worth It?

I'm going to start writing a 3D game in unmanaged C ++ using the DirectX SDK. This will be due to a lot of physics and mathematics, although I can not predict how difficult it will be (I do not know if I will parallelize it, for example). I thought because of F # the incredibly amazing unit of measure of the function , and the fact that it functions and therefore perfectly parallelizes, that I could write an F # library to perform mathematical calculations of the game. But:

  • I do not understand C ++ without paying attention to managed code. I do not know how this could be.
  • I don’t know how big the recession is that one has to face and manage a managed DLL for every mathematically significant calculation (at least one physical equation must be run during an iteration of the game).
  • I'm not sure that unit gain and easy parallelization are worth it. I mean, if it's just math, it's still easy to stream in C ++ (there are actually no side effects, and if I remember that purethe C ++ keyword probably prohibits side effects or that something else?) - and I’ll assume that I could do without units if I’m really careful (I know that I will use only metric units).

Is it worth it? Is mixed managed and unmanaged code common practice? What about games? Will this be a bottleneck? Will my drawing code be horrific and confusing? If you opened the VC ++ project and saw this, then what would your face look like ( :) :( D:etc.)

+5
source share
1 answer

. , , , , .

, , F # . , , XNAMath ( DXSDK) .

(PhysX, Bullet ..), , , , . , .

+5

All Articles