CollisionWorldDistanceField::CollisionWorldDistanceField(const CollisionWorldDistanceField& other) :
  CollisionWorld(other)
{
  size_x_ = other.size_x_;
  size_y_ = other.size_y_;
  size_z_ = other.size_z_;
  use_signed_distance_field_ = other.use_signed_distance_field_;
  resolution_ = other.resolution_;
  collision_tolerance_ = other.collision_tolerance_;
  max_propogation_distance_ = other.max_propogation_distance_;
  distance_field_cache_entry_ = generateDistanceFieldCacheEntry();
}
CollisionWorldDistanceField::CollisionWorldDistanceField(const CollisionWorldDistanceField& other,
                                                         const WorldPtr& world) :
  CollisionWorld(other, world)
{
  size_x_ = other.size_x_;
  size_y_ = other.size_y_;
  size_z_ = other.size_z_;
  use_signed_distance_field_ = other.use_signed_distance_field_;
  resolution_ = other.resolution_;
  collision_tolerance_ = other.collision_tolerance_;
  max_propogation_distance_ = other.max_propogation_distance_;
  distance_field_cache_entry_ = generateDistanceFieldCacheEntry();

  // request notifications about changes to world
  observer_handle_ = getWorld()->addObserver(boost::bind(&CollisionWorldDistanceField::notifyObjectChange, this, _1, _2));
  getWorld()->notifyObserverAllObjects(observer_handle_, World::CREATE);
}
CollisionWorldDistanceField::CollisionWorldDistanceField(double size_x, 
                                                         double size_y,
                                                         double size_z,
                                                         bool use_signed_distance_field,
                                                         double resolution,
                                                         double collision_tolerance,
                                                         double max_propogation_distance)
  : CollisionWorld(),
    size_x_(size_x),
    size_y_(size_y),
    size_z_(size_z),
    use_signed_distance_field_(use_signed_distance_field),
    resolution_(resolution),
    collision_tolerance_(collision_tolerance),
    max_propogation_distance_(max_propogation_distance)
{  
  distance_field_cache_entry_ = generateDistanceFieldCacheEntry();
}
CollisionWorldDistanceField::CollisionWorldDistanceField(double size_x, 
                                                         double size_y,
                                                         double size_z,
                                                         bool use_signed_distance_field,
                                                         double resolution,
                                                         double collision_tolerance,
                                                         double max_propogation_distance)
  : CollisionWorld(),
    size_x_(size_x),
    size_y_(size_y),
    size_z_(size_z),
    use_signed_distance_field_(use_signed_distance_field),
    resolution_(resolution),
    collision_tolerance_(collision_tolerance),
    max_propogation_distance_(max_propogation_distance)
{  
  distance_field_cache_entry_ = generateDistanceFieldCacheEntry();

  // request notifications about changes to world
  observer_handle_ = getWorld()->addObserver(boost::bind(&CollisionWorldDistanceField::notifyObjectChange, this, _1, _2));
}