Simbody
3.5
|
00001 #ifndef SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_SPHERE_CONTACT_H_ 00002 #define SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_SPHERE_CONTACT_H_ 00003 00004 /* -------------------------------------------------------------------------- * 00005 * Simbody(tm) * 00006 * -------------------------------------------------------------------------- * 00007 * This is part of the SimTK biosimulation toolkit originating from * 00008 * Simbios, the NIH National Center for Physics-Based Simulation of * 00009 * Biological Structures at Stanford, funded under the NIH Roadmap for * 00010 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. * 00011 * * 00012 * Portions copyright (c) 2014 Stanford University and the Authors. * 00013 * Authors: Michael Sherman * 00014 * Contributors: * 00015 * * 00016 * Licensed under the Apache License, Version 2.0 (the "License"); you may * 00017 * not use this file except in compliance with the License. You may obtain a * 00018 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * 00019 * * 00020 * Unless required by applicable law or agreed to in writing, software * 00021 * distributed under the License is distributed on an "AS IS" BASIS, * 00022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 00023 * See the License for the specific language governing permissions and * 00024 * limitations under the License. * 00025 * -------------------------------------------------------------------------- */ 00026 00030 #include "simbody/internal/Constraint.h" 00031 00032 namespace SimTK { 00033 00034 //============================================================================== 00035 // SPHERE ON SPHERE CONTACT 00036 //============================================================================== 00102 class SimTK_SIMBODY_EXPORT Constraint::SphereOnSphereContact 00103 : public Constraint { 00104 public: 00105 // no default constructor 00106 00107 //------------------------------------------------------------------------------ 00123 00156 SphereOnSphereContact( MobilizedBody& mobod_F, 00157 const Vec3& defaultCenterOnF, 00158 Real defaultRadiusOnF, 00159 MobilizedBody& mobod_B, 00160 const Vec3& defaultCenterOnB, 00161 Real defaultRadiusOnB, 00162 bool enforceRolling); 00163 00166 SphereOnSphereContact() {} 00167 00171 const MobilizedBody& getMobilizedBodyF() const; 00172 00176 const MobilizedBody& getMobilizedBodyB() const; 00177 00181 bool isEnforcingRolling() const; 00182 00187 SphereOnSphereContact& 00188 setDefaultCenterOnF(const Vec3& defaultCenter); 00193 SphereOnSphereContact& 00194 setDefaultRadiusOnF(Real defaultRadius); 00199 SphereOnSphereContact& 00200 setDefaultCenterOnB(const Vec3& defaultCenter); 00205 SphereOnSphereContact& 00206 setDefaultRadiusOnB(Real defaultRadius); 00207 00212 const Vec3& getDefaultCenterOnF() const; 00217 Real getDefaultRadiusOnF() const; 00222 const Vec3& getDefaultCenterOnB() const; 00227 Real getDefaultRadiusOnB() const; 00230 //------------------------------------------------------------------------------ 00238 // nothing yet 00242 //------------------------------------------------------------------------------ 00260 00266 const SphereOnSphereContact& 00267 setCenterOnF(State& state, const Vec3& sphereCenter) const; 00268 00272 const SphereOnSphereContact& 00273 setRadiusOnF(State& state, Real sphereRadius) const; 00274 00280 const SphereOnSphereContact& 00281 setCenterOnB(State& state, const Vec3& sphereCenter) const; 00282 00286 const SphereOnSphereContact& 00287 setRadiusOnB(State& state, Real sphereRadius) const; 00288 00293 const Vec3& getCenterOnF(const State& state) const; 00296 Real getRadiusOnF(const State& state) const; 00297 00302 const Vec3& getCenterOnB(const State& state) const; 00305 Real getRadiusOnB(const State& state) const; 00308 //------------------------------------------------------------------------------ 00318 Real getPositionError(const State& state) const; 00319 00329 Vec3 getVelocityErrors(const State& state) const; 00330 00336 Vec3 getAccelerationErrors(const State& state) const; 00337 00348 Vec3 getMultipliers(const State& state) const; 00349 00359 Vec3 findForceOnSphereBInG(const State& state) const; 00360 00373 Transform findContactFrameInG(const State& state) const; 00374 00381 Real findSeparation(const State& state) const; // hide from Doxygen 00385 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS 00386 (SphereOnSphereContact, SphereOnSphereContactImpl, Constraint); 00388 }; 00389 00390 } // namespace SimTK 00391 00392 #endif // SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_SPHERE_CONTACT_H_ 00393 00394 00395