Archived
1
Fork 0

Fix model compiler errors

This commit is contained in:
Joshua Goins 2022-02-01 19:29:40 +00:00
parent 060111dc4f
commit 33e60bfba6

View file

@ -374,10 +374,10 @@ void ModelEditor::compile_model() {
max_z = vertex_pos.z;
}
AABB aabb;
aabb.min = Vector3(min_x, min_y, min_z);
aabb.max = Vector3(max_x, max_y, max_z);
fwrite(&aabb, sizeof(AABB), 1, file);
prism::aabb aabb;
aabb.min = prism::float3(min_x, min_y, min_z);
aabb.max = prism::float3(max_x, max_y, max_z);
fwrite(&aabb, sizeof(prism::aabb), 1, file);
fwrite(&mesh->mNumVertices, sizeof(int), 1, file);
@ -416,7 +416,7 @@ void ModelEditor::compile_model() {
aiColor4D 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["roughness"] = 0.5f;
@ -453,7 +453,7 @@ void ModelEditor::compile_model() {
for(auto k = 0; k < channel->mNumPositionKeys; k++) {
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;
fwrite(&key, sizeof(PositionKeyFrame), 1, file);
@ -473,7 +473,7 @@ void ModelEditor::compile_model() {
for(auto k = 0; k < channel->mNumScalingKeys; k++) {
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;
fwrite(&key, sizeof(ScaleKeyFrame), 1, file);
@ -492,13 +492,13 @@ void ModelEditor::drawUI() {
ImGui::SetWindowSize(platform::get_window_size(engine->get_main_window()));
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;
});
}
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;
}, true);
}