2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
7 /****************************************/
8 /*** Dependency Relationship Matrices ***/
9 /****************************************/
11 #include "DepRelMatrix.hpp"
14 unsigned long DepRelMatrixT::GlobalIDCount
=0;
17 DepRelMatrixT::DepRelMatrixT()
24 DepRelMatrixT::DepRelMatrixT(const DepRelMatrixT
& Other
)
25 : Matrix(Other
.Matrix
),
34 InverseMatrixT::InverseMatrixT(DepRelMatrixT
* Source
)
40 void InverseMatrixT::SetSourceMatrix(DepRelMatrixT
* Source
)
46 void InverseMatrixT::Update()
48 // First make recursively sure that the source matrix is up-to-date.
51 // Now see if updating the source actually aged (changed) it.
52 if (m_Source
->Age
> Age
)
54 Matrix
=m_Source
->Matrix
.GetInverse();
62 ProductMatrixT::ProductMatrixT(DepRelMatrixT
& A
, DepRelMatrixT
& B
)
68 void ProductMatrixT::Update()
70 // First make recursively sure that the sources are up-to-date.
74 // Now see if updating them actually aged (changed) them.
75 if (m_A
.Age
+m_B
.Age
> Age
)
77 Matrix
=m_A
.Matrix
*m_B
.Matrix
;