X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fmesh.hh;h=26accec43e1410b295797c6dbda017f7ac9b9faf;hp=0fbc3cc5b303a526f6aa99f0b19ec075fadeb6e8;hb=574af38ed616d1adfa5e6ce35f67cda1f707f89d;hpb=6c9943707d4f33035830eba0587a61a34eaecbc2 diff --git a/src/moof/mesh.hh b/src/moof/mesh.hh index 0fbc3cc..26accec 100644 --- a/src/moof/mesh.hh +++ b/src/moof/mesh.hh @@ -1,13 +1,11 @@ -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +/*] Copyright (c) 2009-2011, Charles McGarvey [***************************** **] All rights reserved. * -* vi:ts=4 sw=4 tw=75 -* * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * -**************************************************************************/ +*****************************************************************************/ #ifndef _MOOF_MESH_HH_ #define _MOOF_MESH_HH_ @@ -34,9 +32,9 @@ namespace moof { +// forward declarations class script; - class mesh : public boost::noncopyable, public entity { public: @@ -45,23 +43,19 @@ public: void draw(scalar alpha = SCALAR(0.0)) const; - struct material { material(const std::string& id) : name(id) {} - + scalar shininess; std::string name; - - vector4 diffuse; vector4 ambient; + vector4 diffuse; vector4 emissive; vector4 specular; - scalar shininess; }; - void set_material(int index) const; void set_material(const material& material) const; @@ -71,7 +65,6 @@ public: std::vector triangles_uv; }; - class object; typedef boost::shared_ptr object_ptr; typedef boost::weak_ptr object_weakptr; @@ -87,33 +80,31 @@ public: return object_ptr(new object(m)); } - void draw(scalar alpha = SCALAR(0.0), bool recurse = true) const; - + void + draw(scalar alpha = SCALAR(0.0), bool recurse = true) const; - const moof::mesh& mesh; + const moof::mesh& mesh; - std::string name; - std::string data; - std::string url; + std::string name; + std::string data; + std::string url; - image_handle texture; - vector2 texrep; + image_handle texture; + vector2 texrep; - std::vector verts; - std::vector faces; + std::vector verts; + std::vector faces; - std::vector kids; - std::map kids_byname; - object_weakptr parent; + std::vector kids; + std::map kids_byname; + object_weakptr parent; }; - object_ptr operator [] (unsigned index) const { return objects_[index]; } - /** * Import script bindings for the mesh class. * \param The script. @@ -121,7 +112,6 @@ public: */ static void import(script& script, const std::string& nspace = ""); - private: void import(std::istream& stream);