source: java/client_3D/src/pl/vorg/mowa/core/graphics/GeometryGroup.java @ 66

Last change on this file since 66 was 66, checked in by Maciej Komosinski, 13 years ago

set 'eol-style' to 'native'

  • Property svn:eol-style set to native
File size: 876 bytes
Line 
1package pl.vorg.mowa.core.graphics;
2
3import java.util.ArrayList;
4
5import javax.media.opengl.GL;
6
7/**
8 * A 3d model, containing many 3d shapes.
9 *
10 * @author vorg
11 */
12public class GeometryGroup {
13        private ArrayList<Geometry> children = new ArrayList<Geometry>();
14        private BoundingBox boundingBox = new BoundingBox();
15
16        public ArrayList<Geometry> getChildren() {
17                return children;
18        }
19
20        public void setChildren(ArrayList<Geometry> value) {
21                this.children = value;
22        }
23       
24        public BoundingBox getBoundingBox() {
25                return boundingBox;
26        }
27       
28        public void display(GL gl) {
29                for(Geometry geometry : children) {
30                        geometry.display(gl);
31                }
32        }
33       
34        public void updateBoundingBox() {
35                boundingBox.empty();
36                for(Geometry geometry : children) {
37                        if (geometry.getBoundingBox().isEmpty()) {
38                                geometry.updateBoundingBox();
39                        }
40                        boundingBox.add(geometry.getBoundingBox());
41                }
42        }
43       
44}
Note: See TracBrowser for help on using the repository browser.