SFML community forums

Help => General => Topic started by: DarthBuzzKill on November 19, 2014, 06:43:36 pm

Title: How do I represent a mathematical 2D Vector in SFML C++?
Post by: DarthBuzzKill on November 19, 2014, 06:43:36 pm
Newbie question I know, but how do I do this in SFML? Since SF::Vectors are not mathematical vectors, just placeholders for multiple parameters.
Title: Re: How do I represent a mathematical 2D Vector in SFML C++?
Post by: Gambit on November 19, 2014, 06:48:26 pm
You make your own or use something like Thor.
Title: Re: How do I represent a mathematical 2D Vector in SFML C++?
Post by: Nexus on November 19, 2014, 06:50:24 pm
sf::Vector2f is one possible C++ representation of a mathematical vector: it provides a variety of mathematical operations like addition or scaling. It's possible to define free functions (http://www.bromeon.ch/libraries/thor/v2.0/doc/_vector_algebra2_d_8hpp.html) to provide even more operations such as dot product.