Camera.h#

Parent directory (model)

Represents a Camera in the scene (Model.h).

Includes#

  • PVRAssets/model/FormattedUserData.h

  • PVRCore/math/MathUtils.h

Included By#

Namespaces#

Classes#

Source Code#

#pragma once
#include "PVRCore/math/MathUtils.h"
#include "PVRAssets/model/FormattedUserData.h"

namespace pvr {
namespace assets {
class Camera
{
public:
    struct InternalData
    {
        int32_t targetNodeIdx;
        float farClip;
        float nearClip;

        struct FovAnimationData
        {
            float timeInSec;
            float fov;
        };

        std::vector<FovAnimationData> fovs;

        InternalData() : targetNodeIdx(-1), farClip(5000.0f), nearClip(5.0f) {}
    };

public:
    inline int32_t getTargetNodeIndex() const { return _data.targetNodeIdx; }

    inline void setTargetNodeIndex(int32_t idx) { _data.targetNodeIdx = idx; }

    inline uint32_t getNumFrames() const { return static_cast<uint32_t>(_data.fovs.size()); }

    inline float getFar() const { return _data.farClip; }

    inline void setFar(float farClip) { _data.farClip = farClip; }

    inline float getNear() const { return _data.nearClip; }

    inline void setNear(float nearClip) { _data.nearClip = nearClip; }

    float getFOV(float timeInMs = 0) const;

    void setFOV(float fov);

    void setFOV(uint32_t numFrames, const float* fovs, const float* timeInSec);

    inline InternalData& getInternalData() { return _data; }

    CustomData& getFormattedUserData() { return _customData; }

private:
    CustomData _customData;
    InternalData _data;
};
} // namespace assets
} // namespace pvr