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

Author Topic: Helper classes  (Read 25108 times)

0 Members and 1 Guest are viewing this topic.

Kingdom of Fish

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Helper classes
« on: January 26, 2008, 11:18:05 pm »
How come SFML doesn't seem to use simple helper classes such as vectors and such (ok, i can't come up with any other but am sure there is)?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Helper classes
« Reply #1 on: January 27, 2008, 05:40:51 am »
You mean, mathematical classes ?
Laurent Gomila - SFML developer

Kingdom of Fish

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Helper classes
« Reply #2 on: January 27, 2008, 06:07:51 am »
Yeah, but I still haven't figured out more then the vector class... But maybe i'm just spoiled after having worked with ogre3d too much.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Helper classes
« Reply #3 on: January 27, 2008, 07:53:34 am »
Actually, Vector2 and Vector3 classes would be quite useful (for sprite position and scale, sound position, listener, ...). I just don't know where to put them, as I don't have a maths module, and as it would have to be accessible by both the graphics and sound modules.

Apart from that, I can't see any other helper class that would be useful at this point.
Laurent Gomila - SFML developer

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
Helper classes
« Reply #4 on: January 27, 2008, 10:49:19 am »
AABB2 could be usefull for sprites, but i think its all not a good idea, as this would force me and others who have their own Math libs, to add implicit cast operators between their and your classes, what makes code more complicated to understand.
And its not that much overhead to write "foo.move(x, y)" instead of foo.move(v)".

Btw you could easily add this by deriving from sfml and just adding a function which handles your vector class.

Dont bloat things. We dont want to see an FSML;)

jbadams

  • Newbie
  • *
  • Posts: 12
    • View Profile
Helper classes
« Reply #5 on: January 29, 2008, 09:01:10 am »
This is something best handled by an external library in my opinion, there are already plenty of other options out there for this functionality.

Kingdom of Fish

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Helper classes
« Reply #6 on: January 29, 2008, 12:04:04 pm »
Quote from: "jbadams"
This is something best handled by an external library in my opinion, there are already plenty of other options out there for this functionality.


Well, that adds to dependencies. And if the only required is Vector[1,2,3] AABB and such you get alot of stuff where little is required.

Lord Delvin

  • Jr. Member
  • **
  • Posts: 68
    • ICQ Messenger - 166781460
    • View Profile
Helper classes
« Reply #7 on: January 30, 2008, 09:19:23 am »
Quote from: "Kingdom of Fish"
Well, that adds to dependencies. And if the only required is Vector[1,2,3] AABB and such you get alot of stuff where little is required.

If you really only require these, then you could write them in less then two hours. Btw Vector1 is a really really bad idea as it is exactly double/float.

Kingdom of Fish

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Helper classes
« Reply #8 on: January 30, 2008, 12:45:35 pm »
Quote from: "Lord Delvin"
Quote from: "Kingdom of Fish"
Well, that adds to dependencies. And if the only required is Vector[1,2,3] AABB and such you get alot of stuff where little is required.

If you really only require these, then you could write them in less then two hours.


Yes i know but what i wish is the whole integration with SFML like Sprite::SetPosition(Vector2)

Quote from: "Lord Delvin"
Btw Vector1 is a really really bad idea as it is exactly double/float.

Yeah i know, was just being silly...

 

anything