CMatrix:Empty
The Empty method deletes all members of the matrix but does not delete the CMatrix object.
CMatrix:Empty() |
This deletes all matrix members without deleting the CMatrix object itself. If you delete the CMatrix, the object is set to nil and cannot be used again without creating a new instance using new. By calling Empty, the existing CMatrix can be used to Set new members, and so forth.
The following script fragment sets 3 members in a new CMatrix M, then deletes all members of M:
|
-- create a CMatrix |
|
-- set member |
|
-- set member |
|
-- set member |
|
-- result: Members = 3 |
|
-- empty the matrix |
|
-- result: Members = 0 |
|
-- if finished with M, clean up memory |