Blender V4.3
collada_internal.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include <map>
12#include <string>
13#include <vector>
14
15#include "COLLADAFWFileInfo.h"
16#include "Math/COLLADABUMathMatrix4.h"
17
18#include "BLI_linklist.h"
19#include "DNA_armature_types.h"
20#include "DNA_material_types.h"
21#include "DNA_object_types.h"
22#include "DNA_scene_types.h"
23
25 private:
26 COLLADAFW::FileInfo::Unit unit;
27 COLLADAFW::FileInfo::UpAxisType up_axis;
28
29 float x_up_mat4[4][4];
30 float y_up_mat4[4][4];
31 float z_up_mat4[4][4];
32 float scale_mat4[4][4];
33
34 public:
40
41 /* Initialize with Z_UP, since Blender uses right-handed, z-up */
43
44 void read_asset(const COLLADAFW::FileInfo *asset);
45
46 void convertVector3(COLLADABU::Math::Vector3 &vec, float *v);
47
49
50 float getLinearMeter(void);
51
52 /* TODO: need also for angle conversion, time conversion... */
53
54 static void dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in);
55 static void mat4_to_dae(float out[4][4], float in[4][4]);
56 static void mat4_to_dae_double(double out[4][4], float in[4][4]);
57
58 float (&get_rotation())[4][4];
59 float (&get_scale())[4][4];
60 void calculate_scale(Scene &sce);
61};
62
63extern void clear_global_id_map();
65extern std::string translate_id(const std::string &id);
67extern std::string translate_id(const char *idString);
68
69extern std::string id_name(void *id);
70extern std::string encode_xml(const std::string &xml);
71
72extern std::string get_geometry_id(Object *ob);
73extern std::string get_geometry_id(Object *ob, bool use_instantiation);
74
75extern std::string get_light_id(Object *ob);
76
77extern std::string get_joint_sid(Bone *bone);
78
79extern std::string get_camera_id(Object *ob);
80extern std::string get_morph_id(Object *ob);
81
82extern std::string get_effect_id(Material *mat);
83extern std::string get_material_id(Material *mat);
Object is a sort of wrapper for general info.
ATTR_WARN_UNUSED_RESULT const BMVert * v
void read_asset(const COLLADAFW::FileInfo *asset)
float(& get_scale())[4]
static void mat4_to_dae(float out[4][4], float in[4][4])
void convertVector3(COLLADABU::Math::Vector3 &vec, float *v)
void calculate_scale(Scene &sce)
UnitConverter::UnitSystem isMetricSystem(void)
static void mat4_to_dae_double(double out[4][4], float in[4][4])
float(& get_rotation())[4]
float getLinearMeter(void)
static void dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in)
std::string get_camera_id(Object *ob)
std::string encode_xml(const std::string &xml)
std::string get_morph_id(Object *ob)
std::string get_joint_sid(Bone *bone)
std::string get_geometry_id(Object *ob)
std::string translate_id(const std::string &id)
std::string get_material_id(Material *mat)
std::string get_light_id(Object *ob)
std::string get_effect_id(Material *mat)
void clear_global_id_map()
std::string id_name(void *id)
draw_view in_light_buf[] float