Artur Mandas

Artur Mandas

  • NA
  • 8
  • 396

Wrapping similar Vector structs

Mar 9 2020 10:34 AM
Hi,

I have a problem concerning structures consistency in a project containing many external libs. Namely, I need a consistent representation of Vector3 and Vector2 structs. Some of the libs are using System.Numerics namespace for vector representation, others have their own implementations. They differ in member fields, ie. some have axis letters uppercase, while I would like to have lowercase properties like x,y,z. My goal is to have one uber struct for my application, while minimizing the need for modification of the external libs. I lack experience on how to approach it in elegant way. Should I create a sort of a wrapper? How to make it smart?

Thanks in advance

Answers (1)