Yes it is more efficient. Here are a set of useful functions i created a while back, in DBPro for one of my engines.
Quote: "`Returns the correct x position, for the specified offset
function offsetGetXPosition(angleX as float, angleY as float, angleZ as float, xOff as float, yOff as float, zOff as float)
sx as float : sy as float : sz as float
cx as float : cy as float : cz as float
xPos as float : yPos as float : zPos as float
sx = sin(angleX) : cx = cos(angleX)
sy = sin(angleY) : cy = cos(angleY)
sz = sin(angleZ) : cz = cos(angleZ)
xPos = xOff*(cy*cz) + yOff*(sx*sy*cz-cx*sz) + zOff*(cx*sy*cz+sx*sz)
endfunction xPos
`Returns the correct y position, for the specified offset
function offsetGetYPosition(angleX as float, angleY as float, angleZ as float, xOff as float, yOff as float, zOff as float)
sx as float : sy as float : sz as float
cx as float : cy as float : cz as float
xPos as float : yPos as float : zPos as float
sx = sin(angleX) : cx = cos(angleX)
sy = sin(angleY) : cy = cos(angleY)
sz = sin(angleZ) : cz = cos(angleZ)
yPos = xOff*(cy*sz) + yOff*(cx*cz+sx*sy*sz) + zOff*(cx*sy*sz-sx*cz)
endfunction yPos
`Returns the correct z position, for the specified offset
function offsetGetZPosition(angleX as float, angleY as float, angleZ as float, xOff as float, yOff as float, zOff as float)
sx as float : sy as float : sz as float
cx as float : cy as float : cz as float
xPos as float : yPos as float : zPos as float
sx = sin(angleX) : cx = cos(angleX)
sy = sin(angleY) : cy = cos(angleY)
sz = sin(angleZ) : cz = cos(angleZ)
zPos = xOff*(-1*sy) + yOff*(sx*cy) + zOff*(cx*cy)
endfunction zPos"
Get the x y and z offset positions, from those commands. Then add the parent object's position, to the offset values returned from those functions. Then rotate the child object, to the angle of the parent object. And there you go, it should be correctly offset.
Hope this helps
-General Reed
CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb