Has anyone fixed TurnEntity and RotateEntity?
BlitzMax Forums/MiniB3D Module/Has anyone fixed TurnEntity and RotateEntity?
| ||
Fixed with source code further down |
| ||
No, TurnEntity behaviour is still the same. As I said before, this requires a substantial rewrite due to TurnEntity using quaternions - it's not worth it right now. RotateEntity behaviour is exactly the same as Blitz3D. |
| ||
Hmm when using rotateentity I got the same results as turnentity, will check me code again :) |
| ||
Yes, TurnEntity works the same as RotateEntity in MiniB3D. RotateEntity in MiniB3D works the same as RotateEntity in Blitz3D. |
| ||
Ah right, I just wanted a Blitz3d turnentity routine :) Does anyone have a simple one I could use not very hot on quoterions etc, thanks in advance :) |
| ||
This threads may be useful to you: http://www.blitzbasic.com/Community/posts.php?topic=66809 http://www.blitzbasic.com/Community/posts.php?topic=68943 |
| ||
Thanks when I have a working TurnEntity function (that works like Blitz3d) I will post it :) |
| ||
Updated source code further down |
| ||
EdzUp: With global set to false, it seems to 'stick' when it pitches too far up or down. With global set to true, what you've written works like RotateEntity rather than TurnEntity. (edit: And because it bypasses so much of the normal functionality, it plays badly with the other Entity commands.) |
| ||
looks like alot of code for a turn entity function. maybe its just me though. |
| ||
Ninjacat basically its the same as the code provided by simonh im trying to work it into a usable turnentity function. After I have it working as it should I will try to fix the locking problem It would be nice if there was a proper TurnEntity function in Minib3d but im working with what I have. Plash this is also a demo the function is not much of the source code provided. |
| ||
EdzUp: I just want to say Thank You for doing this. Every time I looked at quats I got a headache... |
| ||
Plash: Are you volunteering to write a shorter one? :) EdzUp: I didn't mean to sound like I was criticising. Anyone who wants to tackle this is a saint in my book. :) I took a shot at it myself (with much head scratching and hair-pulling) but had mixed luck. I got the basic B3D functionality, so you could look and move in any direction and parented entities behaved correctly. But that broke PointEntity and EntityPitch and a dozen other things... I suspect that simon might be right, and it's not possible without effectively rewiting the entire engine to use quats. I could post my code if you'd like, but it might be more harm than help. |
| ||
EdzUp: On second thoughts! I had a second look at the 'global==false' part of your code. And... it does stick if you get within about 3 degrees of the north or south poles. But on the other hand... in a real life situation, 3 degrees is a pretty small target to hit. And in a fast-paced space action game, which is what I was originally trying to work this out for, you're probably moving more than 3 degrees per frame anyway. You'd bounce right over the 'pothole' without seeing it. This is videogames, not rocket science! So I might just nick what you've got there a run with it. Thank you, Ed, you really were a saint! :) |
| ||
Actually its simonh who should take the credit for this, I just packaged up his code that he posted elsewhere and im making a TurnEntity function out of it :) |
| ||
> Actually its simonh who should take the credit for this True, but I saw that code and still had no idea what to do, so thanks to both of you! |
| ||
Well I have no understanding of Quaternions TBH I just adjusted his code so its wrapped in a function (makes it easier to use and understand) :) |
| ||
Here is another version that should complete the function (still have a few bugs to fix but well its getting there). This one rotates with global flag true or false and should be like Blitz3d's function :). The source an example the actual function is a small segment of the source code. |