[Plib-users] sgCoord question...
Brought to you by:
sjbaker
From: Cameron B. <ko...@da...> - 2005-11-21 06:51:59
|
An sgCoord has xyz and hpr which seems to make it perfect for holding a 'center of view' position + view rotations. But if I hit the 'forward 1 unit' key I need to rotate (1,0,0) by hpr and then add it to xyz. Is there a shortcut to do that that I have missed? Ie, something like sgCoordxyzAddVec3(sgCoord *pos, sgVec3 *delta ) Currently Im doing: void GR::move(int forw,int side) { sgVec3 d; sgMat4 m; d[1]=float(forw); d[0]=float(side); d[2]=0.0f; sgMakeIdentMat4(m); sgMakeRotMat4(m,camera_point); sgXformPnt3(d,m); sgAddVec3(camera_pos,d); } but that feels ugly... -- / `Rev Dr' cam at darkqueen.org Roleplaying, virtual goth \ < http://darkqueen.org Poly, *nix, Python, C/C++, genetics, ATM > \ [+61 3] 9809 1523[h] skeptic, Evil GM(tm). Sysadmin for hire / ---------- Random Quote ---------- What we see depends on mainly what we look for. -- John Lubbock |