Program Listing for File Layer.h

Program Listing for File Layer.h#

Return to documentation for file (include/Karana/Scene/Layer.h)

/*
 * Copyright (c) 2024-2026 Karana Dynamics Pty Ltd. All rights reserved.
 *
 * NOTICE TO USER:
 *
 * This source code and/or documentation (the "Licensed Materials") is
 * the confidential and proprietary information of Karana Dynamics Inc.
 * Use of these Licensed Materials is governed by the terms and conditions
 * of a separate software license agreement between Karana Dynamics and the
 * Licensee ("License Agreement"). Unless expressly permitted under that
 * agreement, any reproduction, modification, distribution, or disclosure
 * of the Licensed Materials, in whole or in part, to any third party
 * without the prior written consent of Karana Dynamics is strictly prohibited.
 *
 * THE LICENSED MATERIALS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
 * KARANA DYNAMICS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, AND
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * IN NO EVENT SHALL KARANA DYNAMICS BE LIABLE FOR ANY DAMAGES WHATSOEVER,
 * INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, DATA, OR USE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, WHETHER IN CONTRACT, TORT,
 * OR OTHERWISE ARISING OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS.
 *
 * U.S. Government End Users: The Licensed Materials are a "commercial item"
 * as defined at 48 C.F.R. 2.101, and are provided to the U.S. Government
 * only as a commercial end item under the terms of this license.
 *
 * Any use of the Licensed Materials in individual or commercial software must
 * include, in the user documentation and internal source code comments,
 * this Notice, Disclaimer, and U.S. Government Use Provision.
 */

/** @file
 * @brief Standard values and type alias to use for layer bitmasks
 */

#pragma once
#include <cstdint>

namespace Karana::Scene {
    /// Bitmask layer type
    using layer_t = uint32_t;

    /*
     * Custom layers
     */

    /// Custom layer 0 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM0 = layer_t{1} << 0;

    /// Custom layer 1 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM1 = layer_t{1} << 1;

    /// Custom layer 2 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM2 = layer_t{1} << 2;

    /// Custom layer 3 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM3 = layer_t{1} << 3;

    /// Custom layer 4 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM4 = layer_t{1} << 4;

    /// Custom layer 5 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM5 = layer_t{1} << 5;

    /// Custom layer 6 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM6 = layer_t{1} << 6;

    /// Custom layer 7 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM7 = layer_t{1} << 7;

    /// Custom layer 8 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM8 = layer_t{1} << 8;

    /// Custom layer 9 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM9 = layer_t{1} << 9;

    /// Custom layer 10 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM10 = layer_t{1} << 10;

    /// Custom layer 11 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM11 = layer_t{1} << 11;

    /// Custom layer 12 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM12 = layer_t{1} << 12;

    /// Custom layer 13 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM13 = layer_t{1} << 13;

    /// Custom layer 14 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM14 = layer_t{1} << 14;

    /// Custom layer 15 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM15 = layer_t{1} << 15;

    /// Custom layer 16 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM16 = layer_t{1} << 16;

    /// Custom layer 17 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM17 = layer_t{1} << 17;

    /// Custom layer 18 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM18 = layer_t{1} << 18;

    /// Custom layer 19 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM19 = layer_t{1} << 19;

    /// Custom layer 20 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM20 = layer_t{1} << 20;

    /// Custom layer 21 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM21 = layer_t{1} << 21;

    /// Custom layer 22 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM22 = layer_t{1} << 22;

    /// Custom layer 23 - set aside for users
    inline constexpr layer_t LAYER_CUSTOM23 = layer_t{1} << 23;

    /*
     * Reserved layers
     */

    /// Reserved layer 0 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED0 = layer_t{1} << 24;

    /// Reserved layer 1 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED1 = layer_t{1} << 25;

    /// Reserved layer 2 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED2 = layer_t{1} << 26;

    /// Reserved layer 3 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED3 = layer_t{1} << 27;

    /// Reserved layer 4 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED4 = layer_t{1} << 28;

    /// Reserved layer 5 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED5 = layer_t{1} << 29;

    /// Reserved layer 6 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED6 = layer_t{1} << 30;

    /// Reserved layer 7 - reserved by kdflex
    inline constexpr layer_t LAYER_RESERVED7 = layer_t{1} << 31;

    /*
     * Graphical layers
     */

    /// Layer for real, physical graphical objects
    inline constexpr layer_t LAYER_PHYSICAL_GRAPHICS = LAYER_RESERVED0;

    /// Layer for ornamental graphics objects
    inline constexpr layer_t LAYER_ORNAMENTAL = LAYER_RESERVED1;

    /// Layer for automatically generated stick figure parts
    inline constexpr layer_t LAYER_STICK_FIGURE = LAYER_RESERVED2;

    /*
     * Other assigned layers
     */

    /// Layer for collision objects
    inline constexpr layer_t LAYER_COLLISION = LAYER_RESERVED3;

    /*
     * Layer sets
     */

    /// No layers, e.g., the number zero
    inline constexpr layer_t LAYER_NONE = 0;

    /// All layers, e.g., UINT32_MAX
    inline constexpr layer_t LAYER_ALL = UINT32_MAX;

    /// Layers for physical parts that should be used for both graphics and collisions
    inline constexpr layer_t LAYER_PHYSICAL = LAYER_COLLISION | LAYER_PHYSICAL_GRAPHICS;
    /// Default layers displayed in graphical scenes
    inline constexpr layer_t LAYER_GRAPHICS =
        LAYER_PHYSICAL_GRAPHICS | LAYER_ORNAMENTAL | LAYER_STICK_FIGURE;
} // namespace Karana::Scene