Overte C++ Documentation
MirrorMode.h
1 //
2 // Created by HifiExperiments on 3/14/22.
3 // Copyright 2022 Overte e.V.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #ifndef hifi_MirrorMode_h
10 #define hifi_MirrorMode_h
11 
12 #include <functional>
13 
14 #include "QString"
15 
16 #include "ViewFrustum.h"
17 
18 /*@jsdoc
19  * <p>If an entity is rendered as a mirror, a portal, or normally.</p>
20  * <table>
21  * <thead>
22  * <tr><th>Value</th><th>Description</th></tr>
23  * </thead>
24  * <tbody>
25  * <tr><td><code>"none"</code></td><td>The entity will render normally.</td></tr>
26  * <tr><td><code>"mirror"</code></td><td>The entity will render as a mirror.</td></tr>
27  * <tr><td><code>"portal"</code></td><td>The entity will render as a portal.</td></tr>
28  * </tbody>
29  * </table>
30  * @typedef {string} MirrorMode
31  */
32 
33 enum class MirrorMode : uint8_t {
34  NONE = 0,
35  MIRROR,
36  PORTAL
37 };
38 
39 class MirrorModeHelpers {
40 public:
41  static QString getNameForMirrorMode(MirrorMode mode);
42 
43  static void setComputeMirrorViewOperator(std::function<uint32_t(ViewFrustum&, const glm::vec3&, const glm::quat&, MirrorMode, const QUuid&)> computeMirrorViewOperator);
44  static uint32_t computeMirrorView(ViewFrustum& viewFrustum, const glm::vec3& inPropertiesPosition, const glm::quat& inPropertiesRotation,
45  MirrorMode mirrorMode, const QUuid& portalExitID);
46 
47 private:
48  static std::function<uint32_t(ViewFrustum&, const glm::vec3&, const glm::quat&, MirrorMode, const QUuid&)> _computeMirrorViewOperator;
49 };
50 
51 #endif // hifi_MirrorMode_h