Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Constraint_SphereOnPlaneContact.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_CONTACT_H_
2 #define SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_CONTACT_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2014 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
31 
32 namespace SimTK {
33 
34 //==============================================================================
35 // SPHERE ON PLANE CONTACT
36 //==============================================================================
87 : public Constraint {
88 public:
89  // no default constructor
90 
91 //------------------------------------------------------------------------------
104 
129 SphereOnPlaneContact( MobilizedBody& planeMobod,
130  const Transform& defaultPlaneFrame,
131  MobilizedBody& sphereMobod,
132  const Vec3& defaultSphereCenter,
133  Real defaultSphereRadius,
134  bool enforceRolling);
135 
139 
143 const MobilizedBody& getPlaneMobilizedBody() const;
144 
148 const MobilizedBody& getSphereMobilizedBody() const;
149 
153 bool isEnforcingRolling() const;
154 
155 
160 setDefaultPlaneFrame(const Transform& defaultPlaneFrame);
165 setDefaultSphereCenter(const Vec3& defaultSphereCenter);
170 setDefaultSphereRadius(Real defaultSphereRadius);
171 
172 
175 const Transform& getDefaultPlaneFrame() const;
178 const Vec3& getDefaultSphereCenter() const;
181 Real getDefaultSphereRadius() const;
184 //------------------------------------------------------------------------------
196 SphereOnPlaneContact& setPlaneDisplayHalfWidth(Real halfWidth);
200 Real getPlaneDisplayHalfWidth() const;
204 //------------------------------------------------------------------------------
219 
224 const SphereOnPlaneContact&
225 setPlaneFrame(State& state, const Transform& planeFrame) const;
226 
232 const SphereOnPlaneContact&
233 setSphereCenter(State& state, const Vec3& sphereCenter) const;
234 
238 const SphereOnPlaneContact&
239 setSphereRadius(State& state, Real sphereRadius) const;
240 
246 const Transform& getPlaneFrame(const State& state) const;
250 const Vec3& getSphereCenter(const State& state) const;
253 Real getSphereRadius(const State& state) const;
256 //------------------------------------------------------------------------------
266 Real getPositionError(const State& state) const;
267 
277 Vec3 getVelocityErrors(const State& state) const;
278 
284 Vec3 getAccelerationErrors(const State& state) const;
285 
296 Vec3 getMultipliers(const State& state) const;
297 
306 Vec3 findForceOnSphereInG(const State& state) const;
307 
315 Vec3 findContactPointInG(const State& state) const;
316 
324 Real findSeparation(const State& state) const; // hide from Doxygen
329  (SphereOnPlaneContact, SphereOnPlaneContactImpl, Constraint);
331 };
332 
333 } // namespace SimTK
334 
335 #endif // SimTK_SIMBODY_CONSTRAINT_SPHERE_ON_PLANE_CONTACT_H_
336 
337 
338 
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:577
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:276
This constraint represents a bilateral connection between a sphere on one body and a plane on another...
Definition: Constraint_SphereOnPlaneContact.h:86
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
This defines the base Constraint class and related classes, which are used to specify limitations on ...
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:167
This is the base class for all Constraint classes, which is just a handle for the underlying hidden i...
Definition: Constraint.h:66
SphereOnPlaneContact()
Default constructor creates an empty handle that can be used to reference any SphereOnPlaneContact Co...
Definition: Constraint_SphereOnPlaneContact.h:138