Blender V4.5
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
8
9#pragma once
10
11#include <string>
12
13#include "COLLADAFWFileInfo.h"
14#include "Math/COLLADABUMathMatrix4.h"
15
16#include "DNA_armature_types.h"
17#include "DNA_material_types.h"
18#include "DNA_object_types.h"
19#include "DNA_scene_types.h"
20
22 private:
23 COLLADAFW::FileInfo::Unit unit;
24 COLLADAFW::FileInfo::UpAxisType up_axis;
25
26 float x_up_mat4[4][4];
27 float y_up_mat4[4][4];
28 float z_up_mat4[4][4];
29 float scale_mat4[4][4];
30
31 public:
37
38 /* Initialize with Z_UP, since Blender uses right-handed, z-up */
40
41 void read_asset(const COLLADAFW::FileInfo *asset);
42
43 void convertVector3(COLLADABU::Math::Vector3 &vec, float *v);
44
46
47 float getLinearMeter();
48
49 /* TODO: need also for angle conversion, time conversion... */
50
51 static void dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in);
52 static void mat4_to_dae(float out[4][4], float in[4][4]);
53 static void mat4_to_dae_double(double out[4][4], float in[4][4]);
54
55 float (&get_rotation())[4][4];
56 float (&get_scale())[4][4];
57 void calculate_scale(Scene &sce);
58};
59
60extern void clear_global_id_map();
62extern std::string translate_id(const std::string &id);
64extern std::string translate_id(const char *idString);
65
66extern std::string id_name(void *id);
67extern std::string encode_xml(const std::string &xml);
68
69extern std::string get_geometry_id(Object *ob);
70extern std::string get_geometry_id(Object *ob, bool use_instantiation);
71
72extern std::string get_light_id(Object *ob);
73
74extern std::string get_joint_sid(Bone *bone);
75
76extern std::string get_camera_id(Object *ob);
77extern std::string get_morph_id(Object *ob);
78
79extern std::string get_effect_id(Material *mat);
80extern 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)
UnitConverter::UnitSystem isMetricSystem()
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)
static void mat4_to_dae_double(double out[4][4], float in[4][4])
float(& get_rotation())[4]
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)
#define in
#define out