Wednesday, 26th July, 2006

VSL: getting a list of all portals

Filed under: Virtools, Virtools Tutorials, Tips and Tricks, Virtools VSL — dominique @ 01:28

Getting a list of all portals is a bit more complicated than one might think at first as it's not a class. A portal is a 3D Entity with special flags. So here is the Run VSL code. Note that scene is a pIn of type Scene and portals is a pOut of type ObjectArray. I am also using feranti's for-loop style

Wink

void main()
{
    ObjectArray ents;
    bc.FillObjectArrayByType(ents, CKCID_3DENTITY, false, scene);
    int count = ents.Size();
    Entity3D ent = NULL;
    portals.Clear();
    for(int i=-1; ++i<count;)
    {
        ent = Entity3D.Cast(ents[i]);
        if( and(ent.GetFlags(), CK_3DENTITY_PORTAL) )
        {
            portals.PushBack(ents[i]);
        }
    }
}

Bookmark and Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Technorati
  • Digg
  • Reddit
  • Google Bookmarks
  • YahooMyWeb
  • Live-MSN
  • Facebook

1 Comment »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

Bookmark and Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Technorati
  • Digg
  • Reddit
  • Google Bookmarks
  • YahooMyWeb
  • Live-MSN
  • Facebook