Bullet+ OpenCL= AdvancedUnitPhySim?

Bullet+ OpenCL= AdvancedUnitPhySim?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Bullet+ OpenCL= AdvancedUnitPhySim?

Post by PicassoCT »

I m currently reading into bullet- and it seems it allready has opencl support, so part of advanced unit-physics can be "sourced out" onto the graphics card.

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.
Post Reply

Return to “Engine”