LWJGL
August 30, 2014, 13:12:39 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [BUG] in Matrix4f.translate  (Read 1732 times)
mattssp
Newbie
*
Posts: 1


« on: March 12, 2011, 12:08:07 »

Hi,

if I'm not totally wrong, translate should load dest with the values from src first.

/**
566    * Translate the source matrix and stash the result in the destination matrix
567    * @param vec The vector to translate by
568    * @param src The source matrix
569    * @param dest The destination matrix or null if a new matrix is to be created
570    * @return The translated matrix
571    */
572    public static Matrix4f translate(Vector3f vec, Matrix4f src, Matrix4f dest) {
573    if (dest == null)
574    dest = new Matrix4f();
575    
576    dest.m30 += src.m00 * vec.x + src.m10 * vec.y + src.m20 * vec.z;
577    dest.m31 += src.m01 * vec.x + src.m11 * vec.y + src.m21 * vec.z;
578    dest.m32 += src.m02 * vec.x + src.m12 * vec.y + src.m22 * vec.z;
579    dest.m33 += src.m03 * vec.x + src.m13 * vec.y + src.m23 * vec.z;
580    
581    return dest;
582    }

Regards,
Matthias
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!