Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How do I represent a mathematical 2D Vector in SFML C++?  (Read 1346 times)

0 Members and 1 Guest are viewing this topic.

DarthBuzzKill

  • Newbie
  • *
  • Posts: 7
    • View Profile
How do I represent a mathematical 2D Vector in SFML C++?
« 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.

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: How do I represent a mathematical 2D Vector in SFML C++?
« Reply #1 on: November 19, 2014, 06:48:26 pm »
You make your own or use something like Thor.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: How do I represent a mathematical 2D Vector in SFML C++?
« Reply #2 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 to provide even more operations such as dot product.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: