Fix model compiler errors
This commit is contained in:
parent
060111dc4f
commit
33e60bfba6
1 changed files with 9 additions and 9 deletions
|
@ -374,10 +374,10 @@ void ModelEditor::compile_model() {
|
||||||
max_z = vertex_pos.z;
|
max_z = vertex_pos.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
AABB aabb;
|
prism::aabb aabb;
|
||||||
aabb.min = Vector3(min_x, min_y, min_z);
|
aabb.min = prism::float3(min_x, min_y, min_z);
|
||||||
aabb.max = Vector3(max_x, max_y, max_z);
|
aabb.max = prism::float3(max_x, max_y, max_z);
|
||||||
fwrite(&aabb, sizeof(AABB), 1, file);
|
fwrite(&aabb, sizeof(prism::aabb), 1, file);
|
||||||
|
|
||||||
fwrite(&mesh->mNumVertices, sizeof(int), 1, file);
|
fwrite(&mesh->mNumVertices, sizeof(int), 1, file);
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ void ModelEditor::compile_model() {
|
||||||
aiColor4D color;
|
aiColor4D color;
|
||||||
aiGetMaterialColor(sc->mMaterials[i], AI_MATKEY_COLOR_DIFFUSE,&color);
|
aiGetMaterialColor(sc->mMaterials[i], AI_MATKEY_COLOR_DIFFUSE,&color);
|
||||||
|
|
||||||
j["baseColor"] = Vector3(color.r, color.g, color.b);
|
j["baseColor"] = prism::float3(color.r, color.g, color.b);
|
||||||
j["metallic"] = 0.0f;
|
j["metallic"] = 0.0f;
|
||||||
j["roughness"] = 0.5f;
|
j["roughness"] = 0.5f;
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ void ModelEditor::compile_model() {
|
||||||
|
|
||||||
for(auto k = 0; k < channel->mNumPositionKeys; k++) {
|
for(auto k = 0; k < channel->mNumPositionKeys; k++) {
|
||||||
PositionKeyFrame key;
|
PositionKeyFrame key;
|
||||||
key.value = Vector3(channel->mPositionKeys[k].mValue.x, channel->mPositionKeys[k].mValue.y, channel->mPositionKeys[k].mValue.z);
|
key.value = prism::float3(channel->mPositionKeys[k].mValue.x, channel->mPositionKeys[k].mValue.y, channel->mPositionKeys[k].mValue.z);
|
||||||
key.time = channel->mPositionKeys[k].mTime;
|
key.time = channel->mPositionKeys[k].mTime;
|
||||||
|
|
||||||
fwrite(&key, sizeof(PositionKeyFrame), 1, file);
|
fwrite(&key, sizeof(PositionKeyFrame), 1, file);
|
||||||
|
@ -473,7 +473,7 @@ void ModelEditor::compile_model() {
|
||||||
|
|
||||||
for(auto k = 0; k < channel->mNumScalingKeys; k++) {
|
for(auto k = 0; k < channel->mNumScalingKeys; k++) {
|
||||||
ScaleKeyFrame key;
|
ScaleKeyFrame key;
|
||||||
key.value = Vector3(channel->mScalingKeys[k].mValue.x, channel->mScalingKeys[k].mValue.y, channel->mScalingKeys[k].mValue.z);
|
key.value = prism::float3(channel->mScalingKeys[k].mValue.x, channel->mScalingKeys[k].mValue.y, channel->mScalingKeys[k].mValue.z);
|
||||||
key.time = channel->mScalingKeys[k].mTime;
|
key.time = channel->mScalingKeys[k].mTime;
|
||||||
|
|
||||||
fwrite(&key, sizeof(ScaleKeyFrame), 1, file);
|
fwrite(&key, sizeof(ScaleKeyFrame), 1, file);
|
||||||
|
@ -492,13 +492,13 @@ void ModelEditor::drawUI() {
|
||||||
ImGui::SetWindowSize(platform::get_window_size(engine->get_main_window()));
|
ImGui::SetWindowSize(platform::get_window_size(engine->get_main_window()));
|
||||||
|
|
||||||
if(ImGui::Button("Open model to compile...")) {
|
if(ImGui::Button("Open model to compile...")) {
|
||||||
platform::open_dialog(true, [this](std::string path) {
|
engine->get_imgui().open_dialog(true, [this](std::string path) {
|
||||||
model_path = path;
|
model_path = path;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ImGui::Button("Open data path...")) {
|
if(ImGui::Button("Open data path...")) {
|
||||||
platform::open_dialog(true, [this](std::string path) {
|
engine->get_imgui().open_dialog(true, [this](std::string path) {
|
||||||
data_path = path;
|
data_path = path;
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue