Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: Representin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 646 of 680
Post > Topic >>

Re: Representing/returning indicies to a model

by "Gernot Frisch" <Me@[EMAIL PROTECTED] > Sep 11, 2007 at 01:31 PM

> Actually, if you look at the C++ class I was defining I was actually 
> doing
> that.  The parts class didn't predefine anything.  That would be up 
> to whatever called it.


Nathan's solution is best. If you want an "arm" pointer, you might 
have each body assigned with a unique description string, and make an 
operator:

body* operator[] (const std::string& bodyname)
{
    if(this->m_name == bodyname) return this;
    for(std::container<body>::iterator it=m_bodies.begin(); 
it!=m_bodies.end(); ++it)
    return it->operator[](bodyname);
return NULL;
}
 




 5 Posts in Topic:
Representing/returning indicies to a model
"Jim Langston"   2007-09-05 17:36:32 
Re: Representing/returning indicies to a model
nathan@[EMAIL PROTECTED]   2007-09-06 00:59:50 
Re: Representing/returning indicies to a model
"Jim Langston"   2007-09-05 19:32:02 
Re: Representing/returning indicies to a model
"Gernot Frisch"  2007-09-11 13:31:38 
Re: Representing/returning indicies to a model
"Jim Langston"   2007-09-11 09:31:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:27:05 CDT 2008.