Attempt at AlignToVector

BlitzMax Forums/MiniB3D Module/Attempt at AlignToVector

SLotman(Posted 2010) [#1]
Here's my attempt - at finally implementing AlignToVector on miniB3D. For now, this routine doesn't implement the 'rate' parameter; can you guys test it out and see if it is working properly? Just changing vx,vy,vz and axis on the demo below it seems to work...




GNS(Posted 2010) [#2]
What version of mb3d are you using? My version (slightly modified small fixes version) doesn't have a Create() method for TMatrix nor does it have the Magnitude() function.


SLotman(Posted 2010) [#3]
Ooops, I forgot I altered TMatrix too: basicly I mixed it up with some functions from Warner's "fix" (not fixing it actually, but just adding more stuff) and some optimizations from my part (you can see copymemory being used on some functions)

Anyway, here's the code:



For testing reasons, you can just save it as "TMatrix-2.bmx" (as I have) and just change the include on minib3d.bmx - this way you get to keep the old one, and can actually test this one too :)


Robert Cummings(Posted 2010) [#4]
Is there a basic or C++ version of this as I would like to keep my minib3d pc and iphone versions compatible with each other.

I have a similar issue with aligning an entity to some normals:

http://www.blitzbasic.com/Community/posts.php?topic=92412


Any help or advice will be great!