Project

General

Profile

« Previous | Next » 

Revision bc208a9c

Added by Leszek Koltunski almost 4 years ago

Introduce 'tags' (soon to be renamed to 'associations') to Mesh and VertexEffect.
A 'tag' is a way to associate a Vertex Effect only to a subgroup of a given Mesh's vertices (more precisely, only to an arbitrary subset of its Components)

View differences:

src/main/java/org/distorted/library/effect/VertexEffect.java
58 58
    {
59 59
    return
60 60

  
61
        "if( vName[i]=="+effect+")\n" +
61
        "if( vName[i]=="+effect+" && (int(a_Tag) & vTag[i]) != 0 )\n" +
62 62
          "{\n" +
63 63
           code +"\n" +
64 64
          "}\n" +
......
187 187
    {
188 188
    return mNumEnabled;
189 189
    }
190

  
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192
/**
193
 * Set a tag.
194
 *
195
 * A 'tag' of a Vertex Effect joins the effect with a component of a Mesh the effect gets applied to.
196
 * One can set a Tag of the effect and of a Component, and the Effect will only be active on vertices
197
 * of Components such that (effect tag) & (component tag) != 0. (see retSection() above)
198
 *
199
 * The point: this way we can configure the system so that each Vertex Effect acts only on a certain
200
 * subset of the Mesh, thus potentially significantly reducing the number of render calls.
201
 */
202
  public void setTag(int tag)
203
    {
204
    mTag = tag;
205
    }
190 206
  }

Also available in: Unified diff