Simbody
3.5
|
00001 #ifndef SimTK_SIMBODY_CONSTRAINT_BALL_H_ 00002 #define SimTK_SIMBODY_CONSTRAINT_BALL_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) 2007-14 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 // CONSTRAINT:: BALL (COINCIDENT POINTS) 00036 //============================================================================== 00037 00057 class SimTK_SIMBODY_EXPORT Constraint::Ball : public Constraint { 00058 public: 00062 Ball(MobilizedBody& body1, MobilizedBody& body2); 00066 Ball(MobilizedBody& body1, const Vec3& defaultPoint1, 00067 MobilizedBody& body2, const Vec3& defaultPoint2); 00068 00070 Ball() {} 00071 00076 void setPointOnBody1(State& state, const Vec3& point_B1) const; 00081 void setPointOnBody2(State& state, const Vec3& point_B2) const; 00082 00085 const Vec3& getPointOnBody1(const State& state) const; 00088 const Vec3& getPointOnBody2(const State& state) const; 00089 00094 Ball& setDefaultPointOnBody1(const Vec3& defaultPoint_B1); 00099 Ball& setDefaultPointOnBody2(const Vec3& defaultPoint_B2); 00100 00105 const Vec3& getDefaultPointOnBody1() const; 00110 const Vec3& getDefaultPointOnBody2() const; 00111 00112 00115 Ball& setDefaultRadius(Real r); 00118 Real getDefaultRadius() const; 00119 00121 MobilizedBodyIndex getBody1MobilizedBodyIndex() const; 00123 MobilizedBodyIndex getBody2MobilizedBodyIndex() const; 00124 00125 00131 Vec3 getPositionErrors(const State& state) const; 00132 00139 Vec3 getVelocityErrors(const State& state) const; 00140 00149 Vec3 getAccelerationErrors(const State&) const; 00150 00154 Vec3 getBallReactionForceOnBody1(const State&) const; 00158 Vec3 getBallReactionForceOnBody2(const State&) const; 00159 00167 Vec3 getMultipliers(const State& state) const; 00168 // hide from Doxygen 00170 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(Ball, BallImpl, Constraint); 00172 }; 00173 00174 00175 } // namespace SimTK 00176 00177 #endif // SimTK_SIMBODY_CONSTRAINT_BALL_H_ 00178 00179 00180