Changeset 516


Ignore:
Timestamp:
08/17/16 21:08:34 (9 years ago)
Author:
epyon
Message:
  • model node flags added
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/engine/model_manager.hh

    r515 r516  
    3232                WEIGHTED,
    3333                PATTERN_CHECKER
     34        };
     35
     36        enum model_node_flags
     37        {
     38                MNF_FORCE,
     39                MNF_STATIC,
    3440        };
    3541
     
    4854                uint16                       weight    = 0;
    4955                float                        chance    = 1.0f;
    50                 bool                         force     = false;
     56                flags<16,uint16>             nflags;
    5157                model_node_choice            choice    = model_node_choice::ALL;
    5258
     
    6369                        target->weight    = weight;
    6470                        target->chance    = chance;
    65                         target->force     = force;
     71                        target->nflags    = nflags;
    6672                        target->choice    = choice;
    6773                }
     
    102108        };
    103109
    104         NV_RTTI_DECLARE_NAME( model_node_choice, "random_dist" )
     110        NV_RTTI_DECLARE_NAME( model_node_choice, "model_node_choice" )
     111        NV_RTTI_DECLARE_NAME( model_node_flags, "model_node_flags" )
    105112        NV_RTTI_DECLARE_NAME( model, "model" )
    106113
     
    116123        enum flatten_flags
    117124        {
    118                 FF_GENERATE_CHANCE = 0x02,
    119                 FF_GENERATE_CHOICE = 0x04,
    120                 FF_GENERATE_GHOST  = 0x08,
     125                FF_GENERATE_CHANCE  = 0x02,
     126                FF_GENERATE_CHOICE  = 0x04,
     127                FF_GENERATE_GHOST   = 0x08,
     128                FF_GENERATE_NLOCAL  = 0x10,
     129                FF_GENERATE_STATIC  = 0x20,
     130                FF_GENERATE_NSTATIC = 0x40,
    121131        };
    122132
     
    171181                                                return;
    172182                                }
    173                         transform tr = ptr * m->local;
     183                        transform tr = m->local;
     184                        if ( !(gen_flags & FF_GENERATE_NLOCAL) )
     185                                tr = ptr * tr;
    174186                        vec3 position = rng.eval( m->position );
    175187                        vec3 rotation = rng.eval( m->rotation );
     
    179191                        if ( m == selected ) parent_flags |= FMF_FOCUS;
    180192
    181                         if ( m->mesh || m->force || !m->tag.empty() )
     193                        if ( gen_flags & FF_GENERATE_STATIC )
     194                                if ( !m->nflags[MNF_STATIC] )
     195                                        return;
     196
     197                        bool skip_static = ( gen_flags & FF_GENERATE_NSTATIC ) && m->nflags[MNF_STATIC];
     198
     199                        if ( ( ( m->mesh || !m->tag.empty() ) && !skip_static ) || ( m->nflags[MNF_FORCE] ) )
    182200                        {
    183201                                uint32 id = result.count++;
  • trunk/src/engine/model_manager.cc

    r515 r516  
    107107                }
    108108        }
    109 
    110         node->force     = table.get_boolean( "force", false );
     109       
     110        node->nflags    = table.get< flags<16,uint16> >( "flags" );
    111111        node->choice    = model_node_choice( table.get_unsigned( "choice", false ) );
    112112        node->chance    = table.get_float( "chance", 1.0f );
Note: See TracChangeset for help on using the changeset viewer.