Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2008, 7:57:48 PM (17 years ago)
Author:
rgrieder
Message:

Resolved the issue with the collision shape synchronisation.

File:
1 edited

Legend:

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

    r2459 r2469  
    3838
    3939#include "CompoundCollisionShape.h"
     40#include "objects/worldentities/WorldEntity.h"
    4041
    4142namespace orxonox
     
    5556        this->orientation_ = Quaternion::IDENTITY;
    5657        this->scale_ = Vector3::UNIT_SCALE;
     58
     59        this->registerVariables();
    5760    }
    5861
     
    8184    void CollisionShape::parentChanged()
    8285    {
    83         CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_));
    84         if (parent)
    85             parent->addChildShape(this);
     86        Synchronisable* synchronisable = Synchronisable::getSynchronisable(this->parentID_);
     87        CompoundCollisionShape* CCSparent = dynamic_cast<CompoundCollisionShape*>(synchronisable);
     88        if (CCSparent)
     89            CCSparent->addChildShape(this);
     90        else
     91        {
     92            WorldEntity* WEparent = dynamic_cast<WorldEntity*>(synchronisable);
     93            if (WEparent)
     94                WEparent->attachCollisionShape(this);
     95        }
    8696    }
    8797
Note: See TracChangeset for help on using the changeset viewer.