CountCollisions and CollisionEntity Returns Null
BlitzMax Forums/MiniB3D Module/CountCollisions and CollisionEntity Returns Null
| ||
Although I find this given example to work on OpenB3D: http://www.blitzbasic.com/b3ddocs/command.php?name=collisions&ref=goto CountCollisions and CollisionEntity returns null when I add this to the code |
| ||
Seems to work fine on ubuntu, although ellipsoid-to-sphere causes the ball to sink. Are you checking after UpdateWorld? https://github.com/markcwm/openb3d.mod/blob/master/examples/blitz3d/Collisions.bmx |
| ||
Thanks munch, I have to check this in detail but seems to work ok now :D wow I think this is the simple and best example by far that used most of the collisions commands, this is just great! |
| ||
Hey munch, I got a question.. Is it really required that the Collisionscommand need to be inside the main loop? Just curious because this was not the case with my original b3d project or other implementation (which I didn't even noticed until know) but yeah with the example in the docs that I gave above it seems it does in some case. btw, I got the CountCollision worked either before or after UpdateWorld |
| ||
I'm still having problems with collisions on my custom code, I got this in orderEntityType .. Collisions .. While UpdateWorld KeyControls UpdateMeshes() RenderWorld Wend My CountCollisions command is inside UpdateMeshes() and it works with Blitz3D version. I don't know what's the difference since it was derived from it. My mesh declarations are inside a legacy Type variables conversion using Import Tool in MaxIDE. |
| ||
Yes, I think with Openb3d you need to call UpdateWorld after move/anim commands, this is one case where it's different to in Blitz3d. |
| ||
Hey munch, after some trials and testing I have managed to get it fixed with this setup:While DeltaTimeFix() PlayerControls() AI/GameLogicStuff() UpdateEntityMovement() UpdateWorld UpdateEntityMovement() RenderWorld 2D Stuff() Wend I'm using a timed delta to make it the same speed regardless of pc spec. Does it affect the setup above? I have to call UpdateEntityMovement (translate,rotate,move) twice, before and after updateworld just so the collision would finally work. |
| ||
this is not normal, you only have to turn move your entities once per loop, before detecting collisions, then you can reoriente reposition some entities depending on the collisions which have happened... But these are 2 different functions/procedures. |
| ||
Yes, I know that somehow but that applies to blitz3d only and do remember that openb3d just tries to simulate b3d features and not an exact copy (xyz on some commands are somehow different since it is opengl). Otherwise you'll be using that instead. ;-) Try working on OpenB3D and see it for yourself RemiD! :-) |
| ||
if you have to do that to make it works, it means that either your code has error(s) somewhere (maybe you have not put the functions to detect collisions/reposition at the correct place) or openb3d has error(s) somewhere... |