Panda3D
fcollada_utils.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file fcollada_utils.h
10  * @author rdb
11  * @date 2008-12-22
12  */
13 
14 // This file defines some conversion tools for conversion between FCollada and
15 // Panda3D
16 
17 #ifndef FCOLLADA_UTILS_H
18 #define FCOLLADA_UTILS_H
19 
20 #include "pre_fcollada_include.h"
21 #include <FCollada.h>
22 
23 // Useful conversion stuff
24 inline LVecBase3d TO_VEC3(FMVector3 v) {
25  return LVecBase3d(v.x, v.y, v.z);
26 }
27 inline LVecBase4d TO_VEC4(FMVector4 v) {
28  return LVecBase4d(v.x, v.y, v.z, v.w);
29 }
30 inline LColor TO_COLOR(FMVector4 v) {
31  return LColor(v.x, v.y, v.z, v.w);
32 }
33 #define FROM_VEC3(v) (FMVector3(v[0], v[1], v[2]))
34 #define FROM_VEC4(v) (FMVector4(v[0], v[1], v[2], v[3]))
35 #define FROM_MAT4(v) (FMMatrix44(v.getData()))
36 #define FROM_FSTRING(fs) (std::string(fs.c_str()))
37 
38 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.