Data types for TVectors

Good day! Small question about TVectors - is it class only for Single type, as I understand?
Can I use it for Integer or something else? Or better way is make new class liake TVector, but for another data type?

Yes, there are vectors for multiple data types (not all though). See Castle Game Engine: CastleVectors

TVector2Byte
TVector3Byte
TVector4Byte
TVector2Integer
TVector3Integer
TVector4Integer
TVector2Cardinal
TVector3Cardinal
TVector4Cardinal
TVector2SmallInt
TVector4Pointer

But if that’s not enough you can of course define your own structure to handle, e.g. TVector3Int64 or TVector2Extended.

1 Like

And, adding to the list Eugene did, also Double-based vectors:

TVector2Double
TVector3Double
TVector4Double

There are also matrix types for both Single (no suffix) and Double (“Double”) suffix.

1 Like