<commit_before>/** @file
    @brief Header

    @date 2016

    @author
    Sensics, Inc.
    <http://sensics.com/osvr>
*/

// Copyright 2016 Sensics, Inc.
//
// 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.

#ifndef INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C
#define INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C

// Internal Includes
#include "TrackingSystem.h"

// Library/third-party includes
// - none

// Standard includes
// - none

namespace osvr {
namespace vbtracker {
    inline Eigen::Matrix3d
    getRotationMatrixToCameraSpace(TrackingSystem const &sys) {
        Eigen::Matrix3d ret = sys.getCameraPose().rotation().transpose();
        return ret;
    }

    inline Eigen::Quaterniond getQuatToCameraSpace(TrackingSystem const &sys) {
        return Eigen::Quaterniond(getRotationMatrixToCameraSpace(sys));
    }

} // namespace vbtracker
} // namespace osvr

#endif // INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C<commit_msg>Switch how we do the space transformation - convert to quat then invert.<commit_after>/** @file
    @brief Header

    @date 2016

    @author
    Sensics, Inc.
    <http://sensics.com/osvr>
*/

// Copyright 2016 Sensics, Inc.
//
// 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.

#ifndef INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C
#define INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C

// Internal Includes
#include "TrackingSystem.h"

// Library/third-party includes
// - none

// Standard includes
// - none

namespace osvr {
namespace vbtracker {
    inline Eigen::Quaterniond getQuatToCameraSpace(TrackingSystem const &sys) {
        return Eigen::Quaterniond(sys.getCameraPose().rotation()).inverse();
    }

    inline Eigen::Matrix3d
    getRotationMatrixToCameraSpace(TrackingSystem const &sys) {
        return getQuatToCameraSpace(sys).matrix();
    }

} // namespace vbtracker
} // namespace osvr

#endif // INCLUDED_SpaceTransformations_h_GUID_C1F96E04_2D97_428B_047B_0C620A82C10C
{'fraction_non_alphanumeric': 0.09002904162633107, 'fraction_numerical': 0.051306873184898356, 'mean_word_length': 3.8589341692789967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3137108', 'n_tokens_mistral': 1063, 'n_tokens_neox': 968, 'n_words': 273}