Program Listing for File CoalGeometryCache.h#
↰ Return to documentation for file (include/Karana/CoalScene/CoalGeometryCache.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/KCore/Id.h"
#include"Karana/KCore/SharedPointer.h"
#include"Karana/Scene/StaticGeometry.h"
#include<memory>
#include<unordered_map>
namespacecoal{
classCollisionGeometry;//forwarddeclaration.Fullclassincludedintheccfile.
}
namespaceKarana::Scene{
classCoalGeometryCache{
public:
CoalGeometryCache()=default;
~CoalGeometryCache()=default;
//Disablecopying/movingtoavoidissueswiththe
//thispointercapturedbythecustomdeletersused
//tocleanuptheCollisionGeometryweakpointers
CoalGeometryCache(constCoalGeometryCache&)=delete;
CoalGeometryCache&operator=(constCoalGeometryCache&)=delete;
CoalGeometryCache(CoalGeometryCache&&)=delete;
CoalGeometryCache&operator=(CoalGeometryCache&&)=delete;
Karana::Core::ks_ptr<coal::CollisionGeometry>get(constVarStaticGeometry&geometry)const;
private:
mutablestd::unordered_map<Karana::Core::id_t,std::weak_ptr<coal::CollisionGeometry>>
_geometry_map;
};
}//namespaceKarana::Scene