Ignore:
Timestamp:
04/22/22 18:14:32 (3 years ago)
Author:
Maciej Komosinski
Message:

Fixed the descriptor distribution similarity measure: we don't want the Geometry's dummy "anchor" Part to be considered in similarity estimation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/geometry/geometryutils.cpp

    r1125 r1173  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2022  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    428428void GeometryUtils::addPointToModel(const Pt3D &markerLocation, Model &model)
    429429{
    430     Part *anchor = model.getPart(0);
    431430    Part *part = model.addNewPart(Part::SHAPE_ELLIPSOID);
    432431
     
    435434    part->vcolor = Pt3D(1.0, 1.0, 0.0);
    436435
    437     model.addNewJoint(anchor, part, Joint::SHAPE_FIXED); //keep all Parts in the Model connected (just for Model validity)
     436    if (model.getPartCount() > 1) // keep all Parts in the Model connected (just for Model validity)
     437    {
     438        Part* prevpart = model.getPart(model.getPartCount() - 2);
     439        model.addNewJoint(prevpart, part, Joint::SHAPE_FIXED);
     440    }
    438441}
    439442
Note: See TracChangeset for help on using the changeset viewer.