Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualServant of the Lord

Posted 27 March 2013 - 10:29 AM

Both Box2D and SFML are open source. Recompile one of them to use the other's vector.

Or, depending on how the two vectors are laid out, maybe it might be possible to cast them? I don't know whether that's safe or not, I typically avoid all except polymorphism casts and int casts, so my casting knowledge isn't great.
They both just have x and y floats and that's it (besides the functions). Can a reference to one be safely cast to a reference to the other?

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector2.php
http://www.learn-cocos2d.com/api-ref/2.0/Box2D/html/structb2_vec2.html

#2Servant of the Lord

Posted 27 March 2013 - 10:28 AM

Both Box2D and SFML are open source. Recompile one of them to use the other's vector.

Or, depending on how the two vectors are laid out, maybe it might be possible to cast them? I don't know whether that's safe or not, I typically avoid all except polymorphism casts and int casts.
They both just have x and y floats and that's it (besides the functions). Can a reference to one be safely cast to a reference to the other?

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector2.php
http://www.learn-cocos2d.com/api-ref/2.0/Box2D/html/structb2_vec2.html

#1Servant of the Lord

Posted 27 March 2013 - 10:28 AM

Both Box2D and SFML are open source. Recompile one of them to use the other's vector.

Or, depending on how the two vectors are laid out, maybe it might be possible to cast them? I don't know whether that's safe or not, I typically avoid all by dynamic casts or int casts.
They both just have x and y floats and that's it (besides the functions). Can a reference to one be safely cast to a reference to the other?

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector2.php
http://www.learn-cocos2d.com/api-ref/2.0/Box2D/html/structb2_vec2.html

PARTNERS