This is a legacy Trac instance left read-only for reference purposes. More info. dev main | home

Changeset 182

Show
Ignore:
Timestamp:
02/27/2010 05:20:57 PM (2 years ago)
Author:
magicd
Message:

collision detection goes more ;p

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/waterworld/sim2/Animats.h

    r175 r182  
    1212         */ 
    1313        typedef std::set<boost::intrusive_ptr<Animat> > Animats; 
     14 
     15        /** 
     16         * List of bodies 
     17         */ 
     18        //typedef std::set<boost::intrusive_ptr<palBodyBase> > Bodies; 
    1419} 
    1520 
  • trunk/include/waterworld/sim2/PhysicalBody.h

    r175 r182  
    2222        class PhysicalBody : public IntrusivePtrBase, private boost::noncopyable 
    2323        { 
    24                 boost::intrusive_ptr<Animat> m_animat; 
    25                 palBody *m_body; 
     24                boost::intrusive_ptr<Animat> m_animat;           
    2625                PhysicalBody(PhysicalBody const &body); 
    2726                PhysicalBody &operator=(PhysicalBody const &body); 
     27                palBody *m_body; 
    2828        public: 
     29                 
    2930                PhysicalBody(); 
    3031                PhysicalBody(boost::intrusive_ptr<Animat> animat); 
  • trunk/include/waterworld/sim2/World.h

    r175 r182  
    2020        { 
    2121                Animats m_animats; 
     22                //Bodies m_bodies; 
    2223                World(); 
    2324                World(World const &); 
  • trunk/src/waterworld/sim2/World.cpp

    r181 r182  
    5757        { 
    5858                for(Animats::iterator i=m_animats.begin();i!=m_animats.end();++i) 
     59                { 
    5960                        (*i)->update(this, dt); 
     61                        palContact contact; 
     62                        pcd->GetContacts((palBodyBase *)(*i)->getPhysicalBody()->getBody(),contact); 
     63                } 
    6064                palPhysics *tmp = getPhysics(); 
    6165                if (tmp!=NULL) 
     
    9296                body->setBody(sphere); 
    9397                animat->setPhysicalBody(body); 
     98 
     99                if(pcd)pcd->NotifyCollision((palBodyBase *) sphere,true);        //enable collision detection for the body 
     100 
    94101                return body; 
    95102        }