I have been digging through the source code for the engine,
I have not seen anything I could really do easily except this,
during a compound parent, in CcdPhysicsController.cpp the command to set a compound body is
this is where one would apply the ability to
A. AutoCompute new center of mass
B. accept a new input of a vector offset to set the new center of mass,
Any ideas about the cleanest implementation of this?
different behaviors setParent(‘object’,True,) should do?
also, I think a callback is in order, for deleting the child of a compound object to initiate a recompute of the compound?
It’s nice that you want to start coding new features for the BGE, but the code first of all is in dire need of a major re-organization and cleanup.
Get the code to a more maintainable state and it’s less likely that your new stuff will break existing features. It will be a big task, but a moratorium on new features until this is done will ultimately be of great benefit (if it gets done that is).
Yeah, but I need to get my feet wet,
I noticed that when you parent to nearest object and use the end object actuator to end the object which is parented to the nearest object.That it does not always parent.Try to improve on that.That was something someone coded for me.I think it was monster.I was thinking of using that for a mine craft type game.The cubes would be static.It did work a little but it did not work real good.
this is actually for compound objects, (Rigid body assemblies)
and it would not be so frustrating in the game engine, if I could get the ID of the child shape from a raycast,
Assembly -> adds ‘Tmesh’ flag (each material represents a different ‘Jack’ for compound object creation) and sets[‘Component’](the object that created it)
the flag does ‘own.worldPosition=own[‘Component’].worldPosition’ every frame, however I may make a list based manager that does this instead…
So, this allows for an compound assemblies children jacks to be exposed. it also allows for removing children via a ray,
however it’s damn buggy,
I have found it’s great for assembling, but when you start breaking off pieces, they don’t always leave…
solution ? spawn all pieces back in new -> make new assembly + removed item
I am going to need to re-write it again, (it was a hack on a hack on a hack)
object[‘Parent’] = object it was to be stuck to
object[‘children’] = all objects that were to be stuck to it
object[‘Root’] = the compound object all other objects actually stick to (center of mass)
(again it’s a pain but I don’t know of any other way)