Program Listing for File WebSceneCamera.h#
↰ Return to documentation for file (include/Karana/WebScene/WebSceneCamera.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/Scene/GraphicalSceneCamera.h"
#include"Karana/Scene/Layer.h"
#include"Karana/Scene/Projection.h"
#include"Karana/WebScene/WebSceneNode.h"
namespaceKarana::Scene{
classWebSceneCamera:publicWebSceneNode,publicGraphicalSceneCamera{
public:
WebSceneCamera(std::string_viewname,
constKarana::Core::ks_ptr<Karana::WebUI::Server>&server,
constkc::ks_ptr<Scene>&scene,
constVarProjection&proj=PerspectiveProjection{});
voidsetProjection(constVarProjection&proj)override;
voidsetMask(layer_tmask)override;
voidpointCameraAt(constKarana::Math::Vec3&offset,
constKarana::Math::Vec3&target,
constKarana::Math::Vec3&up)override;
private:
friendclassWebScene;
void_ioHandleConn(Karana::WebUI::Connection&conn)constoverride;
void_ioSendCreateSceneCameraMsg(
conststd::function<void(constuint8_t*data,size_tlen)>&send,
constPerspectiveProjection&proj)const;
void_ioSendCreateSceneCameraMsg(
conststd::function<void(constuint8_t*data,size_tlen)>&send,
constOrthographicProjection&proj)const;
void
_ioSendSetProjectionMsg(conststd::function<void(constuint8_t*data,size_tlen)>&send,
constPerspectiveProjection&proj)const;
void
_ioSendSetProjectionMsg(conststd::function<void(constuint8_t*data,size_tlen)>&send,
constOrthographicProjection&proj)const;
void
_ioSendSetCameraMaskMsg(conststd::function<void(constuint8_t*data,size_tlen)>&send,
layer_tmask)const;
void
_ioSendPointCameraAtMsg(conststd::function<void(constuint8_t*data,size_tlen)>&send,
constKarana::Math::Vec3&,
constKarana::Math::Vec3&,
constKarana::Math::Vec3&)const;
VarProjection_io_projection;
Karana::Math::Vec3_io_offset={0,0,5};
Karana::Math::Vec3_io_target={0,0,0};
Karana::Math::Vec3_io_up={0,1,0};
layer_t_io_mask=LAYER_GRAPHICS;
};
}//namespaceKarana::Scene