Program Listing for File SimTran.h

Program Listing for File SimTran.h#

Return to documentation for file (include/Karana/Math/SimTran.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/Math/Defs.h"
#include"Karana/Math/HomTran.h"
#include"Karana/Math/UnitQuaternion.h"
#include<cmath>

namespaceKarana::Math{
usingnamespaceEigen;

classSimTran{

//Constructors
public:
SimTran();

SimTran(constHomTran&transform);

SimTran(doublescale);

SimTran(constHomTran&transform,doublescale);

SimTran(constSimTran&T);

SimTran&operator=(constSimTran&T);

SimTran(SimTran&&T)noexcept;

SimTran&operator=(SimTran&&T)noexcept;

booloperator==(constSimTran&other)const;

boolisApprox(constSimTran&other,doubleprec=MATH_EPSILON)const;

std::stringtypeString()const;

voidsetTranslation(constVec3&vec,doubleepsilon=MATH_EPSILON);

std::stringdumpString(std::string_viewprefix="",
unsignedintprecision=6,
boolexponential=false)const;

voiddump(std::string_viewprefix="",
unsignedintprecision=10,
boolexponential=false)const;

voidsetUnitQuaternion(constUnitQuaternion&q,doubleepsilon=MATH_EPSILON);

voidsetScale(doublescale);

constMat44getMatrix()const;

constVec3&getTranslation()const;

constUnitQuaternion&getUnitQuaternion()const;

doublegetScale()const;

voidsetIdentity();

boolisIdentity()const;

boolhasTranslation()const;

boolhasRotation()const;

boolhasScale()const;

SimTranoperator*(constSimTran&T)const;

Vec3operator*(constVec3&v)const;

SimTraninverse()const;

voidmakeNotReady();

boolisReady();

private:
double_scale=1.0;
HomTran_hom_tran=HomTran();
};

}//namespaceKarana::Math