CMatrix:Copy
The Copy method copies an existing CMatrix into the current one. The current CMatrix does not need to be empty before copying. For a new matrix, an easier alternative to using Copy is to use the new constructor, passing it the CMatrix to be copied.
CMatrix:Copy( CMatrix2 ) where |
CMatrix2 is an existing CMatrix object.
The following script duplicates the CMatrix M into a new CMatrix M2:
|
-- create a CMatrix |
|
-- set member 2, 44 |
|
-- set member 50, 20 |
|
-- set member 120, 2 |
|
-- create an empty CMatrix Mnew |
|
-- copy Mold into the current object |
|
-- result: N= 3,3 |