Program Listing for File AABB.h

Program Listing for File AABB.h#

Return to documentation for file (include/Karana/Math/AABB.h)

/*
*Copyright(c)2024-2025KaranaDynamicsPtyLtd.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<iostream>
#include<string>

namespaceKarana::Math{
classAABB{
public:
AABB();

AABB(constVec3&min,constVec3&max,boolfix_minmax=true);

AABB(constAABB&other);

AABB&operator=(constAABB&other);

constVec3&min()const;

constVec3&max()const;

std::stringdumpString(conststd::string&prefix="",
intprecision=6,
boolexponential=false)const;

void
dump(conststd::string&prefix="",intprecision=10,boolexponential=false)const;

AABBoperator+(constAABB&other)const;

AABB&operator+=(constAABB&other);

AABBtranslate(constVec3&t)const;

AABBrotate(constUnitQuaternion&q)const;

AABBscale(doubles)const;

AABBscale(constVec3&s)const;

AABBtransform(constHomTran&t)const;

private:
Vec3_min;

Vec3_max;
};
}//namespaceKarana::Math

std::ostream&operator<<(std::ostream&os,constKarana::Math::AABB&aabb);