Is it possible to convert irr::core::vector3d< T > to another data type, such as char?
I would like to be able to pass the node position, which is a irr::core::vector3df, to the buff argument of the send() function see Here
It says that I need to "A pointer to a buffer containing the data to be transmitted." so I passed it the pointer address, like this &position and it still said it cant convert to char.
any ideas?
Thanks,
Pete
Convert irr::core::vector3d< T > to another data type?
Convert irr::core::vector3d< T > to another data type?
Ein knowledge seeker
Re: Convert irr::core::vector3d< T > to another data t
Ein wrote:Is it possible to convert irr::core::vector3d< T > to another data type, such as char?
Not truly convert, but you can just reinterpret the pointer to it and send it as a generic binary data. Try something like this:Ein wrote:It says that I need to "A pointer to a buffer containing the data to be transmitted." so I passed it the pointer address, like this &position and it still said it cant convert to char.
Code: Select all
vector3df aaa(1, 2, 3);
c8* vectorData = reinterpret_cast<c8*>(&aaa);EDIT: @Travis: Yes, you are of course right, just forgot to mention.
Last edited by RedDragCZ on Sun Aug 16, 2009 1:58 pm, edited 1 time in total.