8 #include "COLLADABUPlatform.h"
26 unit = asset->getUnit();
27 up_axis = asset->getUpAxisType();
32 switch (unit.getLinearUnitUnit()) {
33 case COLLADAFW::FileInfo::Unit::MILLIMETER:
34 case COLLADAFW::FileInfo::Unit::CENTIMETER:
35 case COLLADAFW::FileInfo::Unit::DECIMETER:
36 case COLLADAFW::FileInfo::Unit::METER:
37 case COLLADAFW::FileInfo::Unit::KILOMETER:
39 case COLLADAFW::FileInfo::Unit::INCH:
40 case COLLADAFW::FileInfo::Unit::FOOT:
41 case COLLADAFW::FileInfo::Unit::YARD:
50 return (
float)unit.getLinearUnitMeter();
66 for (
int i = 0; i < 4; i++) {
67 for (
int j = 0; j < 4; j++) {
84 for (
int i = 0; i < 4; i++) {
85 for (
int j = 0; j < 4; j++) {
86 out[i][j] = mat[i][j];
94 case COLLADAFW::FileInfo::X_UP:
97 case COLLADAFW::FileInfo::Y_UP:
142 rescale[0] = rescale[1] = rescale[2] =
getLinearMeter() / bl_scale;
158 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
159 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
160 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
161 95, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
162 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
163 95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
164 114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
166 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
167 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
168 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
169 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
170 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
171 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
172 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
177 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
178 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
179 95, 95, 95, 95, 95, 95, 95, 45, 95, 95, 48, 49, 50, 51, 52, 53, 54, 55, 56,
180 57, 95, 95, 95, 95, 95, 95, 95, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
181 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 95, 95, 95, 95,
182 95, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
183 114, 115, 116, 117, 118, 119, 120, 121, 122, 95, 95, 95, 95, 95,
185 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
186 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
187 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
188 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
189 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
190 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
191 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
204 std::string
id = std::string(idString);
214 std::string id_translated =
id;
216 for (
unsigned int i = 1; i < id_translated.size(); i++) {
220 if (id_translated !=
id) {
222 map_string_list::iterator iter =
global_id_map.find(id_translated);
226 for (i = 0; i < iter->second.size(); i++) {
227 if (
id == iter->second[i]) {
243 std::stringstream
out;
245 id_translated +=
out.str();
252 return id_translated;
257 return ((
ID *)
id)->name + 2;
262 const std::map<char, std::string> escape{
263 {
'<',
"<"}, {
'>',
">"}, {
'"',
"""}, {
'\'',
"'"}, {
'&',
"&"}};
265 std::map<char, std::string>::const_iterator it;
266 std::string encoded_xml;
271 if (it == escape.end()) {
275 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], char axis, 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)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
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)