2 This file is part of the 3dengfx, realtime visualization system.
4 Copyright (c) 2004, 2005 John Tsiombikas <nuclear@siggraph.org>
6 3dengfx is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 3dengfx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with 3dengfx; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "gfx/curves.hpp"
38 int lcount, max_lights;
40 std::list<Camera *> cameras;
41 TargetCamera *cubic_cam[6];
42 std::list<Object*> objects;
43 std::list<ShadowVolume> static_shadow_volumes;
44 std::list<Curve*> curves;
45 std::list<ParticleSystem*> psys;
48 const Camera *active_camera;
55 float near_fog_range, far_fog_range;
58 mutable bool first_render;
59 mutable unsigned long frame_count;
60 mutable unsigned long poly_count;
61 unsigned long scene_poly_count;
64 void place_cube_camera(const Vector3 &pos);
65 bool render_all_cube_maps(unsigned long msec = XFORM_LOCAL_PRS) const;
72 void set_poly_count(unsigned long pcount);
73 unsigned long get_poly_count() const;
74 unsigned long get_frame_poly_count() const;
76 void add_camera(Camera *cam);
77 void add_light(Light *light);
78 void add_object(Object *obj);
79 void add_static_shadow_volume(TriMesh *mesh, const Light *light);
80 void add_curve(Curve *curve);
81 void add_particle_sys(ParticleSystem *p);
83 void add_skycube(scalar_t size, Texture *cubemap);
85 bool remove_light(const Light *light);
86 bool remove_object(const Object *obj);
87 bool remove_particle_sys(const ParticleSystem *p);
89 Camera *get_camera(const char *name);
90 Light *get_light(const char *name);
91 Object *get_object(const char *name);
92 Curve *get_curve(const char *name);
93 ParticleSystem *get_particle_sys(const char *name);
95 XFormNode *get_node(const char *name);
97 std::list<Object*> *get_object_list();
98 std::list<Camera*> *get_camera_list();
100 void set_active_camera(const Camera *cam);
101 Camera *get_active_camera() const;
103 void set_shadows(bool enable);
104 void set_halo_drawing(bool enable);
105 void set_halo_size(float size);
106 void set_ambient_light(Color ambient);
107 Color get_ambient_light() const;
108 void set_fog(bool enable, Color fog_color = Color(0l), float near_fog = 0.0f, float far_fog = 1000.0f);
109 void set_auto_clear(bool enable);
110 void set_background(const Color &bg);
111 void set_frustum_culling(bool enable);
114 void setup_lights(unsigned long msec = XFORM_LOCAL_PRS) const;
116 void render(unsigned long msec = XFORM_LOCAL_PRS) const;
117 void render_objects(unsigned long msec = XFORM_LOCAL_PRS) const;
118 void render_particles(unsigned long msec = XFORM_LOCAL_PRS) const;
119 void render_svol(int lidx, unsigned long msec = XFORM_LOCAL_PRS) const;
120 void render_cube_map(Object *obj, unsigned long msec = XFORM_LOCAL_PRS) const;
122 void render_sequence(unsigned long start, unsigned long end, int fps = 30, const char *out_dir = "frames");
125 #endif // _3DSCENE_HPP_