Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2008, 2:44:00 PM (17 years ago)
Author:
rgrieder
Message:

Resolved four issues with the collision shapes:

  • NetworkCallback will of course not call functions virtually
  • CompoundCollisionShapes with a WorldEntity parent don't have to attach themselves when synchronised
  • Just in case: When changing a CollisionShape, the old gets destroyed AFTER everything has been updated
  • CompoundCollisionShapes with a WorldEntity parent now update both the WE and the CompoundCollisionShape when something changes

Other changes

  • Also replaced some redundant code while at it (updating the shapes was done individually)
  • Like in WE, the CompoundCollisionShape deletes all its children when being destroyed itself. This requires in WE that the children get detached before the CompoundCollisionShape gets deleted.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/collisionshapes/CollisionShape.h

    r2459 r2514  
    6666                { return this->scale_; }
    6767
     68            void updateShape();
     69
    6870            void calculateLocalInertia(float mass, btVector3& inertia) const;
    6971
     
    7880        protected:
    7981            virtual void updateParent();
     82            virtual void parentChanged();
     83            // Note: This is required because the NetworkCallback will not call functions virtually
     84            void parentChangedCallback() { this->parentChanged(); }
     85            virtual btCollisionShape* createNewShape() const = 0;
    8086
    8187            btCollisionShape*       collisionShape_;
     
    8389
    8490        private:
    85             void parentChanged();
    86 
    8791            Vector3                 position_;
    8892            Quaternion              orientation_;
Note: See TracChangeset for help on using the changeset viewer.