eltopo3d/surftrack.cpp
// ---------------------------------------------------------
///
/// Add a vertex to the surface.  Update the acceleration grid. 
///
// ---------------------------------------------------------
Add a vertex to the surface.  Update the acceleration grid.
Add a vertex to the surface . Update the acceleration grid .
size_t SurfTrack::add_vertex( const Vec3d& new_vertex_position, double new_vertex_mass )
{
    size_t new_vertex_index = m_mesh.add_vertex( );
    if( new_vertex_index > get_num_vertices() - 1 )
    {
        pm_positions.resize( new_vertex_index  + 1 );
        pm_newpositions.resize( new_vertex_index  + 1 );
        m_masses.resize( new_vertex_index  + 1 );
    }
    pm_positions[new_vertex_index] = new_vertex_position;
    pm_newpositions[new_vertex_index] = new_vertex_position;
    m_masses[new_vertex_index] = new_vertex_mass;
    if ( m_collision_safety )
    {
        m_broad_phase->add_vertex( new_vertex_index, get_position(new_vertex_index), get_position(new_vertex_index), vertex_is_solid(new_vertex_index) );       
    }
    return new_vertex_index;
}
size_t SurfTrack :: add_vertex ( const Vec3d & new_vertex_position , double new_vertex_mass ) { size_t new_vertex_index = m_mesh . add_vertex ( ) ; if ( new_vertex_index > get_num_vertices ( ) - 1 ) { pm_positions . resize ( new_vertex_index + 1 ) ; pm_newpositions . resize ( new_vertex_index + 1 ) ; m_masses . resize ( new_vertex_index + 1 ) ; } pm_positions [ new_vertex_index ] = new_vertex_position ; pm_newpositions [ new_vertex_index ] = new_vertex_position ; m_masses [ new_vertex_index ] = new_vertex_mass ; if ( m_collision_safety ) { m_broad_phase -> add_vertex ( new_vertex_index , get_position ( new_vertex_index ) , get_position ( new_vertex_index ) , vertex_is_solid ( new_vertex_index ) ) ; } return new_vertex_index ; }
Add a vertex to the surface.
Add a vertex to the surface .