~holger-seelig/titania/0.5

« back to all changes in this revision

Viewing changes to libtitania-x3d/Titania/X3D/Components/Followers/CoordinateDamper.h

  • Committer: Holger Seelig
  • Date: 2013-11-11 05:36:47 UTC
  • Revision ID: holger.seelig@yahoo.de-20131111053647-rwld79xsmc2rr4o1
Implemented CoordinateDamper and TexCoordDamper2D.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        void
137
137
        initialize () final;
138
138
 
 
139
        ///  @name Operations
 
140
 
 
141
        template <class LHS, class RHS>
 
142
        bool
 
143
        equals (const LHS & lhs, const RHS & rhs, float tolerance) const
 
144
        {
 
145
                float distance = 0;
 
146
 
 
147
                for (size_t i = 0, size = lhs .size (); i < size; ++ i)
 
148
                        distance = std::max (distance, abs (lhs [i] - rhs [i]));
 
149
 
 
150
                return distance < tolerance;
 
151
        }
 
152
 
139
153
        ///  @name Event handlers
140
154
        
141
155
        void
172
186
 
173
187
        Fields fields;
174
188
 
 
189
        std::vector <std::vector <Vector3f>> value;
 
190
 
175
191
};
176
192
 
177
193
} // X3D