Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lubb

[java] Objects of Objects

This topic is 5677 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

So I''m imagining I''ll write a raytracer/caster/3-D drafting program in Java, because if I used C++ or VB it wouldn''t be very difficult. SO over time, at a casual pace, I am figuring the layout of it all. I want to use a group as the entire scene to be rendered, and I want to be able to have solid-models as well as (sub) groups in groups. .... In C++ or VB I''d have just used a variable list to hold objects with next and last "pointers" for each. This would seem to be possible in JAva of course, but I am wondering if there is some specific way in Java to do this? I can search Google, but don''t know the term to look for...? ~

Share this post


Link to post
Share on other sites
Advertisement
Take a look at the Java Collection class. It provides containers like Maps, Lists, and iterators. However, it isn''t as powerful as the STL.

Share this post


Link to post
Share on other sites
Java actually has something a lot more powerful than STL when it comes to handling hierarchical object structures for 3D graphics (scenegraphs). It is called Java3D.

I do not understand why you would use a linked list in C++ though when it seems like you need a tree structure (since you mention groups and subgroups).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can implement your linked list/tree in java more easily than in C scince every object in java is always passed by reference (like a pointer) and scince all objects are inplicitly decended from class Object. so:

private Object nextObject;
private Object prevObject;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!