VertexAttribute.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // David Eberly, Geometric Tools, Redmond WA 98052
  2. // Copyright (c) 1998-2020
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // https://www.boost.org/LICENSE_1_0.txt
  5. // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
  6. // Version: 4.0.2019.08.13
  7. #pragma once
  8. #include <string>
  9. namespace WwiseGTE
  10. {
  11. struct VertexAttribute
  12. {
  13. VertexAttribute(std::string inSemantic = "", void* inSource = nullptr, size_t inStride = 0)
  14. :
  15. semantic(inSemantic),
  16. source(inSource),
  17. stride(inStride)
  18. {
  19. }
  20. // The 'semantic' string allows you to query for a specific vertex
  21. // attribute and use the 'source' and 'stride' to access the data
  22. // of the attribute. For example, you might use the semantics
  23. // "position" (px,py,pz), "normal" (nx,ny,nz), "tcoord" (texture
  24. // coordinates (u,v)), "dpdu" (derivative of position with respect
  25. // to u), or "dpdv" (derivative of position with respect to v) for
  26. // mesh vertices.
  27. //
  28. // The source pointer must be 4-byte aligned. The stride must be
  29. // positive and a multiple of 4. The pointer alignment constraint is
  30. // guaranteed on 32-bit and 64-bit architectures. The stride constraint
  31. // is reasonable given that (usually) geometric attributes are usually
  32. // arrays of 'float' or 'double'.
  33. std::string semantic;
  34. void* source;
  35. size_t stride;
  36. };
  37. }