// Copyright (C) 2012-2015 ChaosForge Ltd // http://chaosforge.org/ // // This file is part of Nova libraries. // For conditions of distribution and use, see copying.txt file in root folder. #ifndef NV_GFX_KEYFRAMED_MESH_HH #define NV_GFX_KEYFRAMED_MESH_HH #include #include #include namespace nv { #if 0 class keyframed_mesh : public animated_mesh { public: keyframed_mesh( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ); virtual vertex_array get_vertex_array() const { return m_va; } virtual size_t get_index_count() const { return m_index_count; } virtual void run_animation( animation_entry* a_anim ); size_t get_max_frames() const; virtual transform get_node_transform( uint32 node_id ) const; virtual mat4 get_node_matrix( uint32 node_id ) const; virtual void update_animation( animation_entry*, uint32 a_ms_anim_time ); virtual void update( program a_program ); virtual ~keyframed_mesh(); protected: virtual void set_frame( uint32 frame ); struct vertex_pn { vec3 position; vec3 normal; }; struct vertex_pnt { vec3 position; vec3 normal; vec4 tangent; }; struct vertex_t { vec2 texcoord; }; context* m_context; const mesh_nodes_data* m_tag_map; data_descriptor m_interpolation_key; buffer m_pbuffer; vertex_array m_va; uint32 m_last_frame; uint32 m_next_frame; uint32 m_vsize; f32 m_interpolation; bool m_has_tangent; bool m_active; uint32 m_index_count; uint32 m_frame_count; uint32 m_vertex_count; }; class keyframed_mesh_gpu : public keyframed_mesh { public: keyframed_mesh_gpu( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ); void update_animation( animation_entry* anim, uint32 a_anim_time ); virtual void update( program a_program ); private: int m_loc_next_position; int m_loc_next_normal; int m_loc_next_tangent; uint32 m_gpu_last_frame; uint32 m_gpu_next_frame; }; class keyframed_mesh_cpu : public keyframed_mesh { public: keyframed_mesh_cpu( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ); void update_animation( animation_entry* anim, uint32 a_anim_time ); ~keyframed_mesh_cpu(); private: const uint8* m_model_data; uint8* m_data; }; #endif } // namespace nv #endif // NV_GFX_KEYFRAMED_MESH_HH