I have another problem…
I would love to get through this without complaining.
From: Panda3D Manual: Notes and caveats
This is what the Friction Coefficient Options section says…
setDynamicFrictionCoef
void PhysicsCollisionHandler::set_dynamic_friction_coef(float coef);
Undocumented function.
setStaticFrictionCoef
void PhysicsCollisionHandler::set_static_friction_coef(float coef);
Undocumented function.
Please, Please… Tell me, HOW am I supposed to figure this out on my own from the API and the manual when the examples appear to be incorrect or unfinished, the documentation is sketchy and refers to APIs that are undocumented?
EVERY PATH is closed, yet I am expected to do this on my own?
I’m a relatively experienced programmer that taught myself PERL, PHP and now Python but this is getting ridiculous.
Panda3D appears to be a very interesting and capable engine, but without documentation or because of people that chastise you for not reading non-existing documentation, it is hard on the border of ludicris. If Disney did not intend on this being a fully functional engine, why give it to us in the first place?
I really, really want to use it, but I have have spent two weeks of solid coding, reading, and absorbing, but I feel I am little further along than when I started…
I desperatly want to know about the physics engine, gravity, collisions and networking. There are mysterious methods riddled throughout the API that refer to functions I am really going to need to pull off this Multi Player Social Network I have visualized. I have limited resources so I ask, what profit is there in taking the mis-steps to code hundreds of routines that are already in the API, but undocumented when IF I had proper documentation, I could easily use those methods and focus my programming on the areas that ARE NOT covered in the API. It would be a much better use of my time.
BTW - just knowing the API is not good enough. There is nothing in there about how to put the literal 1,000’s of methods together.
Real programming manuals present material in groups and show how you use the various tools in combinations to achieve tasks. There are even groups of methods that would be far more effiecient than others in achieving various tasks, but the API doesnt tell any of this. Somebody that already KNOWS, has to impart that knowledge, or eventually, after the momentum is over, the project dies.
I really dont want that to happen with Panda. I would also like to contribute, but I dont have the technical knowlege to turn the API into meaningful information.
What started this was the various parts of the documentation that refer to each other without actually answering the question.
I have a surface and I have a player avatar that I drop onto the surface. I originally used the Ralph routines to detect the surface.getZ(), to properly land the avatar on the ground.
Now, I think I have gravity working, but the collision routines that worked so well before, seem to not work at all now. The avatar falls right through the floor.
The new docs on Physics (thanks Fixer!) refer to using PhysicsCollisionHandler instead of CollisionHandlerPusher… I guess this would be great … IF you knew what a CollisionHandlerPusher WAS or why you should or shouldnt be using it in the first place!!!
Like I said, I borrowed from Ralph, so my routines are…
self.ralphGroundRay = CollisionRay()
self.ralphGroundRay.setOrigin(0,0,1000)
self.ralphGroundRay.setDirection(Vec3(0,0,-1))
self.ralphGroundCol = CollisionNode('ralphRay')
self.ralphGroundCol.addSolid(self.ralphGroundRay)
self.ralphGroundCol.setFromCollideMask(BitMask32.bit(1))
self.ralphGroundCol.setIntoCollideMask(BitMask32.allOff())
self.ralphGroundColNp = self.ralph.attachNewNode(self.ralphGroundCol)
self.ralphGroundHandler = CollisionHandlerQueue()
self.cTrav.addCollider(self.ralphGroundColNp, self.ralphGroundHandler)
and further along…
# Adjust ralph's Z coordinate. If ralph's ray hit terrain,
# update his Z. If it hit anything else, or didn't hit anything, put
# him back where he was last frame.
entries = []
for i in range(self.ralphGroundHandler.getNumEntries()):
entry = self.ralphGroundHandler.getEntry(i)
entries.append(entry)
entries.sort(lambda x,y: cmp(y.getSurfacePoint(render).getZ(),x.getSurfacePoint(render).getZ()))
envZ = entries[0].getSurfacePoint(render).getZ()
ralphZ = self.ralph.getZ()
print ralphZ, envZ
if (len(entries)>0 and envZ-ralphZ<0.5 ):
pass
#self.ralph.setZ(envZ)
else:
self.ralph.setPos(startpos)
This code worked fine until I seem to have actually stumbled on working gravity… at least the avatar starts falling and falls through the floor … and keeps falling.
Also, within the API, I see
a lot as the description within the API. As much as I like and need to be reminded… im not sure that the appropriate section?