22 #include "COLLADABUPlatform.h"
40 unit = asset->getUnit();
41 up_axis = asset->getUpAxisType();
46 switch (unit.getLinearUnitUnit()) {
47 case COLLADAFW::FileInfo::Unit::MILLIMETER:
48 case COLLADAFW::FileInfo::Unit::CENTIMETER:
49 case COLLADAFW::FileInfo::Unit::DECIMETER:
50 case COLLADAFW::FileInfo::Unit::METER:
51 case COLLADAFW::FileInfo::Unit::KILOMETER:
53 case COLLADAFW::FileInfo::Unit::INCH:
54 case COLLADAFW::FileInfo::Unit::FOOT:
55 case COLLADAFW::FileInfo::Unit::YARD:
64 return (
float)unit.getLinearUnitMeter();
80 for (
int i = 0; i < 4; i++) {
81 for (
int j = 0; j < 4; j++) {
98 for (
int i = 0; i < 4; i++) {
99 for (
int j = 0; j < 4; j++) {
100 out[i][j] = mat[i][j];
108 case COLLADAFW::FileInfo::X_UP:
111 case COLLADAFW::FileInfo::Y_UP:
156 rescale[0] = rescale[1] = rescale[2] =
getLinearMeter() / bl_scale;
172 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
173 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
174 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
175 95, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
176 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
177 95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
178 114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
180 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
181 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
182 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
183 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
184 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
185 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
186 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
191 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
192 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
193 95, 95, 95, 95, 95, 95, 95, 45, 95, 95, 48, 49, 50, 51, 52, 53, 54, 55, 56,
194 57, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
195 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
196 95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
197 114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
199 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
200 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
201 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
202 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
203 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
204 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
205 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
219 std::string
id = std::string(idString);
229 std::string id_translated =
id;
231 for (
unsigned int i = 1; i < id_translated.size(); i++) {
235 if (id_translated !=
id) {
237 map_string_list::iterator iter =
global_id_map.find(id_translated);
241 for (i = 0; i < iter->second.size(); i++) {
242 if (
id == iter->second[i]) {
258 std::stringstream out;
260 id_translated += out.str();
267 return id_translated;
272 return ((
ID *)
id)->name + 2;
277 const std::map<char, std::string> escape{
278 {
'<',
"<"}, {
'>',
">"}, {
'"',
"""}, {
'\'',
"'"}, {
'&',
"&"}};
280 std::map<char, std::string>::const_iterator it;
281 std::string encoded_xml;
286 if (it == escape.end()) {
290 encoded_xml += it->second;
typedef float(TangentPoint)[2]
void transpose_m4_m4(float R[4][4], const float M[4][4])
void unit_m4(float m[4][4])
void size_to_mat4(float R[4][4], const float size[3])
void axis_angle_to_mat4_single(float R[4][4], const char axis, const float angle)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
ATTR_WARN_UNUSED_RESULT const BMVert * v
void read_asset(const COLLADAFW::FileInfo *asset)
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 get_morph_id(Object *ob)
const unsigned char translate_name_map[256]
std::string get_joint_sid(Bone *bone)
std::map< std::string, std::vector< std::string > > map_string_list
std::string translate_id(const char *idString)
const unsigned char translate_start_name_map[256]
std::string get_geometry_id(Object *ob)
std::string get_material_id(Material *mat)
std::string encode_xml(std::string xml)
std::string get_light_id(Object *ob)
std::string get_effect_id(Material *mat)
void clear_global_id_map()
map_string_list global_id_map
std::string id_name(void *id)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)