Jump to content
  • Advertisement
Sign in to follow this  
mishal153

is this a bad design??

This topic is 5147 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a basic program to rotate a 3d cube. Now i have ended with a basic design where lots of things are public. I had to do so coz i wanted the classes to be usable for any mesh. Basically i have created classes where we can access vertex from the mesh class itself by using : mesh.polygon[n].vertex[n] does this sound like a poor design?? thanx guys

Share this post


Link to post
Share on other sites
Advertisement
Hi!

The idea of classes is to encapsulate the data and hide the implentation from the client programmer. If you need to only read the polygons/vertices and not change them, you can overload the []-operator.

Cheers,
Drag0n

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!