Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/gfx/vr/osvr/Util/Pose3C.h
Line
Count
Source (jump to first uncovered line)
1
/** @file
2
    @brief Header
3
4
    Must be c-safe!
5
6
    @date 2014
7
8
    @author
9
    Sensics, Inc.
10
    <http://sensics.com/osvr>
11
*/
12
13
/*
14
// Copyright 2014 Sensics, Inc.
15
//
16
// Licensed under the Apache License, Version 2.0 (the "License");
17
// you may not use this file except in compliance with the License.
18
// You may obtain a copy of the License at
19
//
20
//     http://www.apache.org/licenses/LICENSE-2.0
21
//
22
// Unless required by applicable law or agreed to in writing, software
23
// distributed under the License is distributed on an "AS IS" BASIS,
24
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
// See the License for the specific language governing permissions and
26
// limitations under the License.
27
*/
28
29
#ifndef INCLUDED_Pose3C_h_GUID_066CFCE2_229C_4194_5D2B_2602CCD5C439
30
#define INCLUDED_Pose3C_h_GUID_066CFCE2_229C_4194_5D2B_2602CCD5C439
31
32
/* Internal Includes */
33
34
/* Internal Includes */
35
#include <osvr/Util/APIBaseC.h>
36
#include <osvr/Util/Vec3C.h>
37
#include <osvr/Util/QuaternionC.h>
38
39
/* Library/third-party includes */
40
/* none */
41
42
/* Standard includes */
43
/* none */
44
45
OSVR_EXTERN_C_BEGIN
46
47
/** @addtogroup UtilMath
48
    @{
49
*/
50
51
/** @brief A structure defining a 3D (6DOF) rigid body pose: translation and
52
    rotation.
53
*/
54
typedef struct OSVR_Pose3 {
55
    /** @brief Position vector */
56
    OSVR_Vec3 translation;
57
    /** @brief Orientation as a unit quaternion */
58
    OSVR_Quaternion rotation;
59
} OSVR_Pose3;
60
61
/** @brief Set a pose to identity */
62
0
OSVR_INLINE void osvrPose3SetIdentity(OSVR_Pose3 *pose) {
63
0
    osvrQuatSetIdentity(&(pose->rotation));
64
0
    osvrVec3Zero(&(pose->translation));
65
0
}
66
/** @} */
67
68
OSVR_EXTERN_C_END
69
70
#endif