@ElmMesh.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class ElmMesh : ElmData
  4. {
  5. Pose transform;
  6. UID obj_id,
  7. skel_id,
  8. phys_id,
  9. body_id, // if this is a cloth then 'body_id' points to the body mesh ELM_MESH that this cloth can be applied to
  10. draw_group_id;
  11. Mems<UID> mtrl_ids; // materials used by this mesh
  12. Box box; // this should not be synced (it is set according to mesh data), set as invalid when mesh is empty
  13. TimeStamp file_time, body_time, draw_group_time, transform_time;
  14. // get
  15. bool equal(C ElmMesh &src)C;
  16. bool newer(C ElmMesh &src)C;
  17. virtual bool mayContain(C UID &id)C override;
  18. virtual void clearLinked()override;
  19. flt posScale ()C;
  20. flt vtxDupPosEps()C;
  21. bool canHaveCustomTransform()C; // meshes which have body assigned, can't have custom transform
  22. // operations
  23. virtual void newData()override;
  24. void fromMtrl(C Mesh &mesh);
  25. void from(C Mesh &game_mesh); // game version of mesh must be passed here
  26. uint undo(C ElmMesh &src);
  27. uint sync(C ElmMesh &src);
  28. bool syncFile(C ElmMesh &src);
  29. // io
  30. virtual bool save(File &f)C override;
  31. virtual bool load(File &f)override;
  32. virtual void save(MemPtr<TextNode> nodes)C override;
  33. virtual void load(C MemPtr<TextNode> &nodes)override;
  34. public:
  35. ElmMesh();
  36. };
  37. /******************************************************************************/
  38. /******************************************************************************/
  39. /******************************************************************************/