SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct WorldTransform{
  2.     fmat4 matrix;
  3. };
  4. struct LocalTransform{
  5.     fmat4 matrix;
  6. }
  7. struct Parent{
  8.     ecs::Entity entity;
  9. }
  10. const int Geometry = 1234 // whatever, must be unique
  11.  
  12.     // ...
  13.    
  14. ecs::Archetype geometryArchetype;
  15. geometryArchetype.add<WorldTransform>();
  16. geometryArchetype.add<LocalTransform>();
  17. geometryArchetype.add<Parent>();
  18. geometryArchetype.addTag(Geometry);
  19.  
  20. // more on the ecsCommands later
  21. auto geom = ecsCommands->createEntity(geometryArchetype);
  22.  
  23. WorldTransform& tr = geom.getComponent<WorldTransform>();
  24. math::setTranslation(tr.matrix, fvec3(1.0f, 1.0f, 1.0f));
  25.  
  26.      // ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top