Gazebo Common

API Reference

4.7.0
gz/common/ColladaExporter.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_COMMON_COLLADAEXPORTER_HH_
18 #define IGNITION_COMMON_COLLADAEXPORTER_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <gz/common/config.hh>
26 #include <gz/common/graphics/Export.hh>
27 
28 #include <gz/math/Color.hh>
29 #include <gz/math/Matrix4.hh>
30 
31 #include <ignition/utils/ImplPtr.hh>
32 
33 namespace ignition
34 {
35  namespace common
36  {
39  struct ColladaLight
40  {
43 
46 
49 
52 
55 
57  double constantAttenuation = 1.0;
58 
60  double linearAttenuation = 0.0;
61 
63  double quadraticAttenuation = 0.0;
64 
66  double falloffAngleDeg = 180.0;
67 
69  double falloffExponent = 0.0;
70  };
71 
73  class IGNITION_COMMON_GRAPHICS_VISIBLE ColladaExporter : public MeshExporter
74  {
76  public: ColladaExporter();
77 
79  public: virtual ~ColladaExporter();
80 
86  public: virtual void Export(const Mesh *_mesh,
87  const std::string &_filename, bool _exportTextures = false);
88 
95  public: void Export(const Mesh *_mesh,
96  const std::string &_filename, bool _exportTextures,
97  const std::vector<math::Matrix4d> &_submeshToMatrix);
98 
106  public: void Export(const Mesh *_mesh,
107  const std::string &_filename, bool _exportTextures,
108  const std::vector<math::Matrix4d> &_submeshToMatrix,
109  const std::vector<ColladaLight> &_lights);
110 
112  IGN_UTILS_IMPL_PTR(dataPtr)
113  };
114  }
115 }
116 #endif
double constantAttenuation
Constant attentuation.
Definition: gz/common/ColladaExporter.hh:57
This struct contains light data specifically for collada export Defaults set based on collada 1....
Definition: gz/common/ColladaExporter.hh:39
math::Color diffuse
Light diffuse color.
Definition: gz/common/ColladaExporter.hh:54
Forward declarations for the common classes.
STL class.
std::string name
Name of the light.
Definition: gz/common/ColladaExporter.hh:42
STL class.
double falloffAngleDeg
Falloff angle in degrees.
Definition: gz/common/ColladaExporter.hh:66
Class used to export Collada mesh files.
Definition: gz/common/ColladaExporter.hh:73
math::Vector3d direction
Light direction (directional/spot lights only)
Definition: gz/common/ColladaExporter.hh:48
Base class for exporting meshes.
Definition: gz/common/MeshExporter.hh:32
math::Vector3d position
Light position (non directional lights only)
Definition: gz/common/ColladaExporter.hh:51
double falloffExponent
Fallof exponent.
Definition: gz/common/ColladaExporter.hh:69
std::string type
Type of the light. Either "point", "directional" or "spot".
Definition: gz/common/ColladaExporter.hh:45
double quadraticAttenuation
Quadratic attentuation.
Definition: gz/common/ColladaExporter.hh:63
double linearAttenuation
Linear attentuation.
Definition: gz/common/ColladaExporter.hh:60
A 3D mesh.
Definition: gz/common/Mesh.hh:42