draw2DLine() should get line2d, not position2d dont u think?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

draw2DLine() should get line2d, not position2d dont u think?

Post by MasterGod »

Code: Select all

draw2DLine  (  const core::position2d< s32 > &  start,  
  const core::position2d< s32 > &  end,  
  SColor  color = SColor(255, 255, 255, 255) 

Code: Select all

irr::core::line2d< T >::line2d  (  T  xa,  
  T  ya,  
  T  xb,  
  T  yb 
 )  [inline] 
1. Why not sending draw2DLine(line2d X)?
2. Maybe change in line2d to position2d<T> a, position2d<T> b?

Is there a reason it isn't like this cause this looks to me much more simple.. :wink:

What do you think?

PS: Same thing should be with line3d and such IMO..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

I don't really think that would be more simple. The general public is used to defining points as

x, y

and defining a line as something that passes through to points.

Overall the decision to keep it as position2d makes for a more clear API.
TheQuestion = 2B || !2B
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I agree with mastergod on this one, doesnt draw2DLine have an overload for line2d?

In fact I propose we get rid of all of this "Position2D" "Dimension2D" nonesense and just use Vector2di for everything. They are the exact same thing after all and having them as seperate classes can make using them together inefficient and cumbersome. (What you wanna define operators to exchange between all three classes!?)

Anyway thats what I think, peaceout
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply