summaryrefslogtreecommitdiff
path: root/editor/import/collada.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/import/collada.h')
-rw-r--r--editor/import/collada.h43
1 files changed, 21 insertions, 22 deletions
diff --git a/editor/import/collada.h b/editor/import/collada.h
index 90c6c47e0b..2c3f0a3006 100644
--- a/editor/import/collada.h
+++ b/editor/import/collada.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,9 +31,9 @@
#ifndef COLLADA_H
#define COLLADA_H
+#include "core/config/project_settings.h"
#include "core/io/xml_parser.h"
-#include "core/map.h"
-#include "core/project_settings.h"
+#include "core/templates/map.h"
#include "scene/resources/material.h"
class Collada {
@@ -96,8 +96,8 @@ public:
};
float aspect = 1;
- float z_near = 0.1;
- float z_far = 100;
+ float z_near = 0.05;
+ float z_far = 4000;
CameraData() {}
};
@@ -128,7 +128,7 @@ public:
String name;
struct Source {
Vector<float> array;
- int stride;
+ int stride = 0;
};
Map<String, Source> sources;
@@ -142,15 +142,15 @@ public:
struct Primitives {
struct SourceRef {
String source;
- int offset;
+ int offset = 0;
};
String material;
Map<String, SourceRef> sources;
Vector<float> polygons;
Vector<float> indices;
- int count;
- int vertex_size;
+ int count = 0;
+ int vertex_size = 0;
};
Vector<Primitives> primitives;
@@ -168,7 +168,7 @@ public:
struct Source {
Vector<String> sarray;
Vector<float> array;
- int stride;
+ int stride = 0;
};
Map<String, Source> sources;
@@ -200,14 +200,14 @@ public:
struct Weights {
struct SourceRef {
String source;
- int offset;
+ int offset = 0;
};
String material;
Map<String, SourceRef> sources;
Vector<float> sets;
Vector<float> indices;
- int count;
+ int count = 0;
} weights;
Map<String, Transform> bone_rest_map;
@@ -242,8 +242,8 @@ public:
Color color;
int uid = 0;
struct Weight {
- int bone_idx;
- float weight;
+ int bone_idx = 0;
+ float weight = 0;
bool operator<(const Weight w) const { return weight > w.weight; } //heaviest first
};
@@ -274,7 +274,7 @@ public:
if (normal == p_vert.normal) {
if (uv == p_vert.uv) {
if (uv2 == p_vert.uv2) {
- if (!weights.empty() || !p_vert.weights.empty()) {
+ if (!weights.is_empty() || !p_vert.weights.is_empty()) {
if (weights.size() == p_vert.weights.size()) {
for (int i = 0; i < weights.size(); i++) {
if (weights[i].bone_idx != p_vert.weights[i].bone_idx) {
@@ -313,7 +313,6 @@ public:
struct Node {
enum Type {
-
TYPE_NODE,
TYPE_JOINT,
TYPE_SKELETON, //this bone is not collada, it's added afterwards as optimization
@@ -332,7 +331,7 @@ public:
};
String id;
- Op op;
+ Op op = OP_ROTATE;
Vector<float> data;
};
@@ -376,7 +375,7 @@ public:
};
struct NodeGeometry : public Node {
- bool controller;
+ bool controller = false;
String source;
struct Material {
@@ -439,7 +438,7 @@ public:
TYPE_MATRIX
};
- float time;
+ float time = 0;
Vector<float> data;
Point2 in_tangent;
Point2 out_tangent;
@@ -464,10 +463,10 @@ public:
float unit_scale = 1.0;
Vector3::Axis up_axis = Vector3::AXIS_Y;
- bool z_up;
+ bool z_up = false;
struct Version {
- int major, minor, rev;
+ int major = 0, minor = 0, rev = 0;
bool operator<(const Version &p_ver) const { return (major == p_ver.major) ? ((minor == p_ver.minor) ? (rev < p_ver.rev) : minor < p_ver.minor) : major < p_ver.major; }
Version(int p_major = 0, int p_minor = 0, int p_rev = 0) {