예제 #1
0
 /// Copy-construct from another matrix.
 public Matrix3x4(Matrix3x4 matrix)
 {
     m00_ = matrix.m00_;
     m01_ = matrix.m01_;
     m02_ = matrix.m02_;
     m03_ = matrix.m03_;
     m10_ = matrix.m10_;
     m11_ = matrix.m11_;
     m12_ = matrix.m12_;
     m13_ = matrix.m13_;
     m20_ = matrix.m20_;
     m21_ = matrix.m21_;
     m22_ = matrix.m22_;
     m23_ = matrix.m23_;
 }
예제 #2
0
 /// Assign from another matrix.
 public Matrix3x4 Set(Matrix3x4 rhs)
 {
     m00_ = rhs.m00_;
     m01_ = rhs.m01_;
     m02_ = rhs.m02_;
     m03_ = rhs.m03_;
     m10_ = rhs.m10_;
     m11_ = rhs.m11_;
     m12_ = rhs.m12_;
     m13_ = rhs.m13_;
     m20_ = rhs.m20_;
     m21_ = rhs.m21_;
     m22_ = rhs.m22_;
     m23_ = rhs.m23_;
     return this;
 }
예제 #3
0
 /// Test for equality with another matrix with epsilon.
 public bool Equals(Matrix3x4 rhs)
 {
     return true;
 }
예제 #4
0
        /// Return inverse.
        public Matrix3x4 Inverse()
        {
            float det = m00_ * m11_ * m22_ +
                m10_ * m21_ * m02_ +
                m20_ * m01_ * m12_ -
                m20_ * m11_ * m02_ -
                m10_ * m01_ * m22_ -
                m00_ * m21_ * m12_;

            float invDet = 1.0f / det;
            Matrix3x4 ret = new Matrix3x4();

            ret.m00_ = (m11_ * m22_ - m21_ * m12_) * invDet;
            ret.m01_ = -(m01_ * m22_ - m21_ * m02_) * invDet;
            ret.m02_ = (m01_ * m12_ - m11_ * m02_) * invDet;
            ret.m03_ = -(m03_ * ret.m00_ + m13_ * ret.m01_ + m23_ * ret.m02_);
            ret.m10_ = -(m10_ * m22_ - m20_ * m12_) * invDet;
            ret.m11_ = (m00_ * m22_ - m20_ * m02_) * invDet;
            ret.m12_ = -(m00_ * m12_ - m10_ * m02_) * invDet;
            ret.m13_ = -(m03_ * ret.m10_ + m13_ * ret.m11_ + m23_ * ret.m12_);
            ret.m20_ = (m10_ * m21_ - m20_ * m11_) * invDet;
            ret.m21_ = -(m00_ * m21_ - m20_ * m01_) * invDet;
            ret.m22_ = (m00_ * m11_ - m10_ * m01_) * invDet;
            ret.m23_ = -(m03_ * ret.m20_ + m13_ * ret.m21_ + m23_ * ret.m22_);

            return ret;
        }
예제 #5
0
 /// Test for equality with another matrix with epsilon.
 public bool Equals(Matrix3x4 rhs)
 {
     return(true);
 }