]> Dogcows Code - chaz/yoink/blob - src/Scene.hh
reformatting
[chaz/yoink] / src / Scene.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _SCENE_HH_
13 #define _SCENE_HH_
14
15 #include <list>
16 #include <string>
17
18 #include <boost/shared_ptr.hpp>
19
20 #include <Moof/Cullable.hh>
21 #include <Moof/Drawable.hh>
22 #include <Moof/Resource.hh>
23 #include <Moof/Script.hh>
24
25
26 class Character;
27
28
29 class Scene;
30 typedef boost::shared_ptr<Scene> SceneP;
31
32 class Scene : public Mf::Cullable, public Mf::Drawable, public Mf::Resource
33 {
34 class Impl;
35 boost::shared_ptr<Impl> mImpl;
36
37 public:
38
39 explicit Scene(const std::string& name);
40
41 static SceneP alloc(const std::string& name)
42 {
43 return SceneP(new Scene(name));
44 }
45
46 Mf::Script::Result load(Mf::Script& script);
47
48 void draw(Mf::Scalar alpha) const;
49 void drawIfVisible(Mf::Scalar alpha, const Mf::Frustum& frustum) const;
50
51 Mf::Scalar getZCoord(const Mf::Vector2& position) const;
52
53 bool castRay(const Mf::Ray<2>& ray,
54 std::list<Mf::Ray<2>::Intersection>& hits) const;
55 bool checkForCollision(Character& character);
56
57 static std::string getPath(const std::string& name);
58 };
59
60
61 #endif // _SCENE_HH_
62
This page took 0.038489 seconds and 5 git commands to generate.