Still, as jK allready said- it may not sync if it uses cpu-native math functions such as sin and cosine etc.
So basically in order to sync, one would have to replace the usage of this functions in opencl with springs native cpu-independent replacements?
Code: Select all
Init:
-> HeightmapToBullet()
-> BasicForcesToBullet()
Cycle:
->Somewhere in Simtown, after the Unitmovements are all calculated through,
but before movectrl is applied and the engine wants to close shop and draw the scene
-> AddNewUnitsToPhySim()
->AddnewForcesToPhySim()
->BulletMagic:
---------------------------
CalcForces()
ApplyForces()
DetectCollissions()
ApplyDampeners()
SetFinalPosObjs()
---------------------------
resulting in new Movements, Turns using SyncedOpenCL (needs all Units)
->Set the resulting Positions,Turns via MoveControll if so specified in NewUnitsToPhySime
->Set Hitsphere as close to the physim unit as possible //avoid Ragdolled Units getting hit but may result in force-ping-pong
-> ???
->PROFIT
In a ideal outcome, this should work, without rewritting the traditional enginephysics, and thus
busting a dozen games who might depend on them.