Subversion Repositories gelsvn

Rev

Rev 601 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 601 Rev 622
Line 16... Line 16...
16
#include "IndexedFaceSet.h"
16
#include "IndexedFaceSet.h"
17
#include "Material.h"
17
#include "Material.h"
18
 
18
 
19
namespace Geometry
19
namespace Geometry
20
{
20
{
21
 
-
 
22
 
-
 
23
	/** \brief A Triangle Mesh struct. 
21
  /** \brief A Triangle Mesh struct. 
24
 
22
 
25
	    This struct contains three indexed face sets, one for geometry,
23
      This struct contains three indexed face sets, one for geometry,
26
			textures, and normals. It also contains a vector of materials and a
24
      textures, and normals. It also contains a vector of materials and a
27
			vector of texture maps.
25
      vector of texture maps.
Line 71... Line 69...
71
 
69
 
72
		/// Get a bounding sphere for the model.
70
    /// Get a bounding sphere for the model.
73
		bool get_bsphere(CGLA::Vec3f& c, float& r) const;
71
    bool get_bsphere(CGLA::Vec3f& c, float& r) const;
74
 
72
 
75
		/// Returns true if at least one normal has been defined.
73
    /// Returns true if at least one normal has been defined.
76
		bool has_normals() const 
-
 
77
		{
-
 
78
			return normals.no_faces()>0;
74
    bool has_normals() const { return normals.no_faces() > 0; }
79
		}
-
 
80
		
75
 
81
		/// Find a material from its name
76
    /// Find a material from its name
82
		int find_material(const std::string&) const;
77
    int find_material(const std::string&) const;
83
 
78
 
84
		/// Compute normals for the mesh. Does not check if there are normals.
79
    /// Compute normals for the mesh. Does not check if there are normals.
Line 86... Line 81...
86
 
81
 
87
    /// Compute areas for all faces and total surface area.
82
    /// Compute areas for all faces and total surface area.
88
    void compute_areas();
83
    void compute_areas();
89
 
84
 
90
    /// Apply a transformation matrix to the mesh
85
    /// Apply a transformation matrix to the mesh
91
    void transform(CGLA::Mat4x4f m);
86
    void transform(const CGLA::Mat4x4f& m);
92
	};
-
 
93
 
87
 
-
 
88
    /// Apply a transformation matrix to the texture coordinates
-
 
89
    void tex_transform(const CGLA::Mat4x4f& m);
94
 
90
 
-
 
91
    /// Apply a transformation matrix to the texture coordinates associated with a particular material
-
 
92
    void tex_transform(const CGLA::Mat4x4f& m, const std::string& material);
-
 
93
  };
95
}
94
}
96
#endif
95
#endif