Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No easy way to access components of Vector*i #1043

Closed
kPYKx7Ddw4n1aIKZ opened this issue Jan 11, 2019 · 5 comments
Closed

No easy way to access components of Vector*i #1043

kPYKx7Ddw4n1aIKZ opened this issue Jan 11, 2019 · 5 comments

Comments

@kPYKx7Ddw4n1aIKZ
Copy link
Contributor

System Information

  • Ogre Version: master/1.12.0
  • Operating System / Platform: Debian GNU/Linux 9 (stretch)

Detailled description

I tried to access the components of a Vector*i like this:
vec.x;vec.y;vec.z;vec.w

However this didn't work.
It seems to me that this is only implemented for Ogre::Real vectors:

Real x, y, z, w;

Is there another way or is this part just not implemented yet?

@paroj
Copy link
Member

paroj commented Jan 11, 2019

vec[0], vec[1] ..

@kPYKx7Ddw4n1aIKZ
Copy link
Contributor Author

kPYKx7Ddw4n1aIKZ commented Jan 16, 2019

Is it planned to support vec.x;vec.y;vec.z;vec.w access on vectors which are not Ogre::Real vectors or does one have to implement an own solution for this?

@paroj
Copy link
Member

paroj commented Jan 16, 2019

what is the issue with using vec[0] instead of vec.x? the issue with the xyzw scheme is that you cannot iterate over it and id does not scale beyond 4d - therefore I would rather limit its usage..

@kPYKx7Ddw4n1aIKZ
Copy link
Contributor Author

the issue with the xyzw scheme is that you cannot iterate over it and id does not scale beyond 4d

That sounds sensible.

what is the issue with using vec[0] instead of vec.x?

To be honest, this is related to the following: OGRECave/scape#28
Previously, the xyzw scheme has been used there with the int vector type.

@paroj
Copy link
Member

paroj commented Jan 17, 2019

I think you can make your usecase work by declaring

template <> struct _OgreExport VectorBase<4, int> ...

before instantiating a Vector4i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants