Program Listing for File FramePairHinge.h#
↰ Return to documentation for file (include/Karana/SOADyn/FramePairHinge.h)
/*
*Copyright(c)2024-2026KaranaDynamicsPtyLtd.Allrightsreserved.
*
*NOTICETOUSER:
*
*Thissourcecodeand/ordocumentation(the"LicensedMaterials")is
*theconfidentialandproprietaryinformationofKaranaDynamicsInc.
*UseoftheseLicensedMaterialsisgovernedbythetermsandconditions
*ofaseparatesoftwarelicenseagreementbetweenKaranaDynamicsandthe
*Licensee("LicenseAgreement").Unlessexpresslypermittedunderthat
*agreement,anyreproduction,modification,distribution,ordisclosure
*oftheLicensedMaterials,inwholeorinpart,toanythirdparty
*withoutthepriorwrittenconsentofKaranaDynamicsisstrictlyprohibited.
*
*THELICENSEDMATERIALSAREPROVIDED"ASIS"WITHOUTWARRANTYOFANYKIND.
*KARANADYNAMICSDISCLAIMSALLWARRANTIES,EXPRESSORIMPLIED,INCLUDING
*BUTNOTLIMITEDTOWARRANTIESOFMERCHANTABILITY,NON-INFRINGEMENT,AND
*FITNESSFORAPARTICULARPURPOSE.
*
*INNOEVENTSHALLKARANADYNAMICSBELIABLEFORANYDAMAGESWHATSOEVER,
*INCLUDINGBUTNOTLIMITEDTOLOSSOFPROFITS,DATA,ORUSE,EVENIF
*ADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES,WHETHERINCONTRACT,TORT,
*OROTHERWISEARISINGOUTOFORINCONNECTIONWITHTHELICENSEDMATERIALS.
*
*U.S.GovernmentEndUsers:TheLicensedMaterialsarea"commercialitem"
*asdefinedat48C.F.R.2.101,andareprovidedtotheU.S.Government
*onlyasacommercialenditemunderthetermsofthislicense.
*
*AnyuseoftheLicensedMaterialsinindividualorcommercialsoftwaremust
*include,intheuserdocumentationandinternalsourcecodecomments,
*thisNotice,Disclaimer,andU.S.GovernmentUseProvision.
*/
#pragmaonce
#include"Karana/Frame/OrientedChainedFrameToFrame.h"
#include"Karana/Math/NonlinearSolver.h"
#include"Karana/ProxyScene/ProxyScene.h"
#include"Karana/SOADyn/HingeBase.h"
#include"Karana/SOADyn/PhysicalSubhinge.h"
//#include"Karana/SOADyn/Multibody.h"
namespaceKarana::Dynamics{
namespacekc=Karana::Core;
namespacekf=Karana::Frame;
namespacekm=Karana::Math;
namespaceks=Karana::Scene;
classPinSubhinge;
classFrameToFrameJacobianGenerator;
//classMultibody;
structStickPartsConfig;
classFramePairHinge:publicHingeBase,publickf::OrientedChainedFrameToFrame{
/*foraccessto_changeActionT*/
friendclassPhysicalSubhinge;
/*foraccessto_oneTimeSetup*/
friendclassLoopConstraintCutJoint;
template<int,int>friendclassPhysicalSubhinge_T;
/*foraccessto_newtonian_frame*/
friendclassMultibody;
/*foraccessto_createStickParts*/
friendclassPhysicalBody;
public:
virtual~FramePairHinge();
statickc::ks_ptr<FramePairHinge>
create(kc::ks_ptr<kf::Frame>oframe,
kc::ks_ptr<kf::Frame>pframe,
std::string_viewname,
HingeBase::HingeTypehtype,
conststd::vector<SubhingeBase::SubhingeType>&subhinge_types=
std::vector<SubhingeBase::SubhingeType>());
FramePairHinge(kc::ks_ptr<kf::Frame>oframe,
kc::ks_ptr<kf::Frame>pframe,
std::string_viewname,
HingeBase::HingeTypehtype,
conststd::vector<SubhingeBase::SubhingeType>&subhinge_types=
std::vector<SubhingeBase::SubhingeType>());
std::string_viewtypeString()constnoexceptoverride{returnkc::Base::typeString();}
std::string_viewname()constoverride{returnkf::OrientedChainedFrameToFrame::name();}
public:
km::MatpframeCoordMapMatrix()constoverride;
km::MatoframeCoordMapMatrix()constoverride;
km::HomTranfitQ(constkm::HomTran&T,kc::ks_ptr<FrameToFrame>f_to_f=nullptr);
km::SpatialVectorfitU(constkm::SpatialVector&V,
kc::ks_ptr<FrameToFrame>f_to_f=nullptr);
km::SpatialVectorfitUdot(constkm::SpatialVector&alpha,
kc::ks_ptr<FrameToFrame>f_to_f=nullptr);
conststd::vector<SubhingeBase::SubhingeType>&subhingeTypes()const{
return_subhinge_types;
}
public:
std::stringdumpString(std::string_viewprefix,
constKarana::Core::Base::DumpOptions*options)constoverride;
protected:
kc::ks_ptr<FrameToFrameJacobianGenerator>_jacgen();
virtualvoid_changeActionT(){};
void_oneTimeSetup();
void_oneTimeTeardown();
void_createStickParts(kc::ks_ptr<ks::ProxyScene>&scene,
constStickPartsConfig&c,
boolconstraint)const;
void
_createPhysicalSubhinges(conststd::vector<SubhingeBase::SubhingeType>&subhinge_types);
void_discardPhysicalSubhinges();
void_makeNlSolver();
void_makeJacobianGenerator();
protected:
kc::ks_ptr<kf::Frame>_newtonian_frame=nullptr;
kc::ks_ptr<FrameToFrameJacobianGenerator>_hinge_jacgen=nullptr;
kc::ks_ptr<km::NonlinearSolver>_nl_solver=nullptr;
kc::ks_ptr<kf::Frame>_fit_frame=nullptr;
};
}//namespaceKarana::Dynamics