summaryrefslogtreecommitdiffstats
path: root/scene/resources/surface_tool.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-05-14 01:22:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-05-14 01:22:15 -0300
commitb324ff7ea584676fcc3292808d7e7ea609982f8e (patch)
treeb80e9aa0b8f2926a398e25ef904f6229cb3e28dd /scene/resources/surface_tool.h
parent45a509282e912d85c46b40974a2deb926be5be42 (diff)
downloadredot-engine-b324ff7ea584676fcc3292808d7e7ea609982f8e.tar.gz
A bit of everything:
-IMA-ADPCM support for samples, this means that sound effects can be compressed and use 4 timess less RAM. -New 3D import workflow based on Wavefront OBJ. Import single objects as mesh resources instead of full scenes. Many people prefers to work this way. Just like the rest of the imported resources, these are updated in realtime if modified externally. -Mesh resources now support naming surfaces. This helps reimporting to identify which user-created materials must be kept. -Several fixes and improvements to SurfaceTool. -Anti Aliasing added to WorldEnvironment effects (using FXAA) -2D Physics bodies (RigidBody, KinematicBody, etc), Raycasts, Tilemap, etc support collision layers. This makes easy to group which objects collide against which. -2D Trigger shapes can now also trigger collision reporting in other 2D bodies (it used to be in Area2D before) -Viewport render target textures can now be filtered. -Few fixes in GDscript make it easier to work with static functions and class members. -Several and many bugfixes.
Diffstat (limited to 'scene/resources/surface_tool.h')
-rw-r--r--scene/resources/surface_tool.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h
index 8f0fcaa01a..fe82d3a4ce 100644
--- a/scene/resources/surface_tool.h
+++ b/scene/resources/surface_tool.h
@@ -49,12 +49,17 @@ public:
Vector<int> bones;
Vector<float> weights;
+ bool operator==(const Vertex& p_vertex) const;
+
Vertex() { }
};
private:
- bool compare(const Vertex& p_a,const Vertex& p_b) const;
+
+ struct VertexHasher {
+ static _FORCE_INLINE_ uint32_t hash(const Vertex &p_vtx);
+ };
bool begun;
bool first;
@@ -64,6 +69,7 @@ private:
//arrays
List< Vertex > vertex_array;
List< int > index_array;
+ Map<int,bool> smooth_groups;
//memory
Color last_color;
@@ -92,13 +98,13 @@ public:
void add_uv2( const Vector2& p_uv);
void add_bones( const Vector<int>& p_indices);
void add_weights( const Vector<float>& p_weights);
+ void add_smooth_group(bool p_smooth);
void add_index( int p_index);
void index();
void deindex();
- void generate_flat_normals();
- void generate_smooth_normals();
+ void generate_normals();
void generate_tangents();
void add_to_format(int p_flags) { format|=p_flags; }