Skip to content

File Entity.h

File List > Amplitude > Core > Entity.h

Go to the documentation of this file

// Copyright (c) 2021-present Sparky Studios. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#ifndef _AM_CORE_ENTITY_H
#define _AM_CORE_ENTITY_H

#include <SparkyStudios/Audio/Amplitude/Math/Orientation.h>

#include <unordered_map>

namespace SparkyStudios::Audio::Amplitude
{
    class EntityInternalState;

    class AM_API_PUBLIC Entity
    {
    public:
        Entity();

        explicit Entity(EntityInternalState* state);

        void Clear();

        [[nodiscard]] bool Valid() const;

        [[nodiscard]] AmEntityID GetId() const;

        [[nodiscard]] const AmVector3& GetVelocity() const;

        void SetLocation(const AmVector3& location) const;

        [[nodiscard]] const AmVector3& GetLocation() const;

        void SetOrientation(const Orientation& orientation) const;

        [[nodiscard]] AmVector3 GetDirection() const;

        [[nodiscard]] AmVector3 GetUp() const;

        [[nodiscard]] const Orientation& GetOrientation() const;

        void Update() const;

        void SetObstruction(AmReal32 obstruction) const;

        void SetOcclusion(AmReal32 occlusion) const;

        void SetDirectivity(AmReal32 directivity, AmReal32 sharpness) const;

        [[nodiscard]] AmReal32 GetObstruction() const;

        [[nodiscard]] AmReal32 GetOcclusion() const;

        [[nodiscard]] AmReal32 GetDirectivity() const;

        [[nodiscard]] AmReal32 GetDirectivitySharpness() const;

        void SetEnvironmentFactor(AmEnvironmentID environment, AmReal32 factor) const;

        [[nodiscard]] AmReal32 GetEnvironmentFactor(AmEnvironmentID environment) const;

        [[nodiscard]] const std::unordered_map<AmEnvironmentID, AmReal32>& GetEnvironments() const;

        [[nodiscard]] AmUInt64 GetActiveChannelCount() const;

        [[nodiscard]] EntityInternalState* GetState() const;

    private:
        EntityInternalState* _state;
    };
} // namespace SparkyStudios::Audio::Amplitude

#endif // _AM_CORE_ENTITY_H