Simbody  3.5
Constraint_SphereOnPlaneContact.h
Go to the documentation of this file.
00001 #ifndef SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_CONTACT_H_
00002 #define SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_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 PLANE CONTACT
00036 //==============================================================================
00086 class SimTK_SIMBODY_EXPORT Constraint::SphereOnPlaneContact
00087 :   public Constraint  {
00088 public:
00089     // no default constructor
00090 
00091 //------------------------------------------------------------------------------
00104 
00129 SphereOnPlaneContact(   MobilizedBody&      planeMobod, 
00130                         const Transform&    defaultPlaneFrame, 
00131                         MobilizedBody&      sphereMobod, 
00132                         const Vec3&         defaultSphereCenter,
00133                         Real                defaultSphereRadius,
00134                         bool                enforceRolling);
00135     
00138 SphereOnPlaneContact() {}
00139 
00143 const MobilizedBody& getPlaneMobilizedBody() const;
00144 
00148 const MobilizedBody& getSphereMobilizedBody() const;
00149 
00153 bool isEnforcingRolling() const;
00154 
00155 
00159 SphereOnPlaneContact& 
00160 setDefaultPlaneFrame(const Transform& defaultPlaneFrame);
00164 SphereOnPlaneContact& 
00165 setDefaultSphereCenter(const Vec3& defaultSphereCenter);
00169 SphereOnPlaneContact& 
00170 setDefaultSphereRadius(Real defaultSphereRadius);
00171 
00172 
00175 const Transform& getDefaultPlaneFrame() const;
00178 const Vec3& getDefaultSphereCenter() const;
00181 Real getDefaultSphereRadius() const;
00184 //------------------------------------------------------------------------------
00196 SphereOnPlaneContact& setPlaneDisplayHalfWidth(Real halfWidth);
00200 Real getPlaneDisplayHalfWidth() const;
00204 //------------------------------------------------------------------------------
00219 
00224 const SphereOnPlaneContact& 
00225 setPlaneFrame(State& state, const Transform& planeFrame) const;
00226 
00232 const SphereOnPlaneContact& 
00233 setSphereCenter(State& state, const Vec3& sphereCenter) const;
00234 
00238 const SphereOnPlaneContact& 
00239 setSphereRadius(State& state, Real sphereRadius) const;
00240 
00246 const Transform& getPlaneFrame(const State& state) const;
00250 const Vec3& getSphereCenter(const State& state) const;
00253 Real getSphereRadius(const State& state) const;
00256 //------------------------------------------------------------------------------
00266 Real getPositionError(const State& state) const;
00267 
00277 Vec3 getVelocityErrors(const State& state) const;
00278 
00284 Vec3 getAccelerationErrors(const State& state) const;
00285 
00296 Vec3 getMultipliers(const State& state) const;
00297 
00306 Vec3 findForceOnSphereInG(const State& state) const;
00307 
00315 Vec3 findContactPointInG(const State& state) const;
00316 
00324 Real findSeparation(const State& state) const; // hide from Doxygen
00328 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS
00329     (SphereOnPlaneContact, SphereOnPlaneContactImpl, Constraint);
00331 };
00332 
00333 } // namespace SimTK
00334 
00335 #endif // SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_CONTACT_H_
00336 
00337 
00338 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines