From: <nik...@cl...> - 2001-08-05 15:38:19
|
juste pour vous tenir au courant des modifs que j'ai fait ces derniers te= mps : - moteur de particules quasi-fini, reste =E0 =E9crire d'autres m=E9thodes d'int=E9gration plus robustes - class OR_Cloth finie : pbm d'instabilit=E9 quand les ressorts sont trop raides. - j'ai cr=E9e une class factory (OR_ClassFactory). en gros : * les classes qui peuvent en b=E9n=E9ficier sont celles qui h=E9riten= t de OR_Serializable * elles doivent d=E9finir "static OR_Serializable& CreateInstance()" = pour cr=E9e une instance de la classe ainsi que "OR_String GetClassName" pour chopper le nom de la clas= se. * ceci dit, j'ai fait une macro qui fait tout tout seul : OR_DEFINE_SERIALIZATION(nom_de_la_classe) * par exemple, maintenant, plus besoin de faire des switch(type_de_l_objet_import=E9) de la mort, il suffit d'utiliser pour l'import [...] OR_Serializable* pObj=3DNULL; OR_SERIALIZE_IMPORT(file, pObj); // appelle la class factory pour cr=E9er la bonne classe d=E9riv=E9e, et lance l'import pour l'export [...] OR_SERIALIZE_EXPORT(file, pObj); // exporte le nom de = la classe de l'objet, puis l'objet * creation d'exceptions (classe de base OR_Exception_ABC, exception a= vec message : OR_MsgException), et cr=E9ation d'un OR_ExcptionHandler. pour catcher des exception, on peut (doit) utiliser : OR_CATCH_EXCEPTION( matrix.Invert() ); // succeptible de lancer une exception si la matrice est non inversible. gabriel |