parent bug
BlitzMax Forums/MiniB3D Module/parent bug
| ||
if i load a ship model and parent it to a cube, then if i create a sprite (as a bullet) and try to parent it to the model or position it relative to the model it gets messed up as in all bullet sprites movement behave strangely, they all facce the same direction no martter what direction the ship[ is facing. this doesnt happen when the ship is not parented to a cube |
| ||
Code sample please. |
| ||
ok here you go.. http://www.mediafire.com/?ndyv1nmzjmw I made a download just to make sure it reproduces the bug |
| ||
did you take a look yet? |
| ||
Not yet, will take a look this weekend. Thanks for the sample. |
| ||
I can't see any problem with that - it seems to work as I would expect it to. Commenting out the EntityParent line doesn't seem to change anything. I need a better sample and/or description of what's going wrong exactly. |
| ||
if you play with it for a little while (turning the ship and firing bullets) youll notice that some bullets get stuck to the back of the ship, but this never happens if the line is commented out that parents the ship to the cube. EDIT- hmm the behaviour happens even when the line is commented out, do you know why? |
| ||
I see, your complaint is that perhaps the sprite view mode is out of whack when parented ? that there may be a bug where the parent is overriding sprite view behaviour? or what? |
| ||
when you shoot bullets before moving the ship they act normally, but when you turn the ship to face backwards the bullets face toward the ship and keep moving into the ship. (when you fire a bullet, the bullet should always be facing away from the ship obviously) You just have to play with it for a little while to see the bullets face toward the ship. You cant actually see what direction sprites are facing but I know they are moving into the ship because they seem to get stuck to the ship. |
| ||
Really can't see the problem with this. I turn the camera, shoot the bullets, and they always move away from the ship as expected, no matter how long I fire for. Are you using the latest versions of BlitzMax (1.30) and MiniB3D (0.52)? |
| ||
yeah, I will look at the demo again to make sure, Yep I double clicked the EXE and got some bullets to stick to the ship after 10 seconds. Also when I move the mouse to the side the ship rolls, but according to the source code the ship is supposed to turn left and right |
| ||
Here's a video of me testing it: Video As far as I can tell, no bullets get stuck or move in the wrong direction. Maybe you could post a video yourself? |
| ||
thanks for taking the time to make the video heres mine: http://www.youtube.com/watch?v=-S1jLNAzsPU I checked the version of minib3d and it was 0.52 i am using the SVN version of blitzmax but I dont think that makes any difference. Im not using threads or anything non-standard I compiled the code from the download unaltered, are you sure you didnt alter the code? One bullet gets stuck at the start and then several get stuck at the end |
| ||
"Also when I move the mouse to the side the ship rolls, but according to the source code the ship is supposed to turn left and right" Sounds like you're not sure of your own coding ability. Do you fully understand the code yourself or are you building off existing code from somewhere else? |
| ||
Well there's definitely a difference between our versions! Yes the code is unaltered - I even downloaded your zip again just to be sure. I suspect your minib3d version may be old or modified somehow - try redownloading minib3d V0.52 again, and make sure it fully replaces the old one in your BlitzMax mod dir. |
| ||
I tried it on a different computer and got the same bug again, after reinstalling the module. Rob: I just put turnentity 0,1,0 so that means it shouldnt roll I think a global rotation is being added to the ship instead of local rotation |
| ||
Compiled Exe Can you give this a go to make sure that this is not a system issue. It should work OK. I just put turnentity 0,1,0 so that means it shouldnt roll I can't see that line in your sample. Are you testing the same thing as me? TurnEntity works differently in minib3d to B3D - gimbal lock can occur. |
| ||
oh yeah I meant to say turnentity mx,my,0 roll is zero hmm, your exe doesnt seem to do the bug |
| ||
Use RotateEntity instead and it should work as expected (you'll have to increment the mx,my values yourself). Well if you have the same MiniB3D version as me, the only thing that is different is the BlitzMax version. Could you try a standard 1.30 install? You can install it alongside your current version. |
| ||
Have you tried this Jeremy? Would like to get to the bottom of this. |
| ||
ok I tried a fresh install in a different folder, fresh install of minib3d v 0.52 and it did the same error again (!) its a mystery |
| ||
does anyone else have the same issue ? |
| ||
THe problem could be caused by Tformpoint applying rotation to a matrix without using quaternions? |
| ||
There is still no problem as far as I can tell. I've tested this to death now so there's no point continuing this until you can provide a solid example of a bug. |