|
|
|
@ -62,6 +62,14 @@ namespace lunarium
|
|
|
|
|
|
|
|
|
|
|
|
mParentPos = glm::vec3(300.0f, 300.0f, 0.0f);
|
|
|
|
mParentPos = glm::vec3(300.0f, 300.0f, 0.0f);
|
|
|
|
mChildPos = glm::vec3(250.0f, 0.0f, 0.0f);
|
|
|
|
mChildPos = glm::vec3(250.0f, 0.0f, 0.0f);
|
|
|
|
|
|
|
|
mParentAngle = 0.0f;
|
|
|
|
|
|
|
|
mChildAngle = 0.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mParentPos2 = glm::vec3(700.0f, 200.0f, 0.0f);
|
|
|
|
|
|
|
|
mChildPos2 = glm::vec3(-300.0f, 50.0f, 0.0f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mParentPos3 = glm::vec3(200.0f, 600.0f, 0.0f);
|
|
|
|
|
|
|
|
mChildPos3 = glm::vec3(150.0f, 100.0f, 0.0f);
|
|
|
|
|
|
|
|
|
|
|
|
angle = 0.0f;
|
|
|
|
angle = 0.0f;
|
|
|
|
box_angle = 0.0f;
|
|
|
|
box_angle = 0.0f;
|
|
|
|
@ -292,10 +300,24 @@ namespace lunarium
|
|
|
|
|
|
|
|
|
|
|
|
void SimpleRenderScene::RenderParentTest(Renderer2D& g)
|
|
|
|
void SimpleRenderScene::RenderParentTest(Renderer2D& g)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g.DrawQuad(Rectangle(mParentPos.x, mParentPos.y, 50.0f, 50.0f), Color::Blue());
|
|
|
|
g.DrawQuad(Rectangle(mParentPos.x, mParentPos.y, 50.0f, 50.0f), Color::Blue(), nullptr, mParentAngle);
|
|
|
|
glm::mat4 parent = glm::mat4(1.0f);
|
|
|
|
glm::mat4 parent = glm::mat4(1.0f);
|
|
|
|
parent = glm::translate(parent, mParentPos);
|
|
|
|
parent = glm::translate(parent, mParentPos);
|
|
|
|
g.DrawQuad(Rectangle(mChildPos.x, mChildPos.y, 50.0f, 50.0f), Color::Green(), nullptr, 0.0f, Rectangle(-1, -1, -1, -1), parent);
|
|
|
|
parent = glm::rotate(parent, mParentAngle, glm::vec3(0.0f, 0.0f, 1.0f));
|
|
|
|
|
|
|
|
g.DrawQuad(Rectangle(mChildPos.x, mChildPos.y, 50.0f, 50.0f), Color::Green(), nullptr, mChildAngle, Rectangle(-1, -1, -1, -1), parent);
|
|
|
|
|
|
|
|
g.DrawLine(glm::vec2(mParentPos.x, mParentPos.y), glm::vec2(mParentPos.x + mChildPos.x, mParentPos.y + mChildPos.y), Color::Blue(), 1.5f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g.DrawQuad(Rectangle(mParentPos2.x, mParentPos2.y, 50.0f, 50.0f), Color::Red());
|
|
|
|
|
|
|
|
parent = glm::mat4(1.0f);
|
|
|
|
|
|
|
|
parent = glm::translate(parent, mParentPos2);
|
|
|
|
|
|
|
|
g.DrawQuad(Rectangle(mChildPos2.x, mChildPos2.y, 50.0f, 50.0f), Color::White(), nullptr, mChildAngle, Rectangle(-1, -1, -1, -1), parent);
|
|
|
|
|
|
|
|
g.DrawLine(glm::vec2(mParentPos2.x, mParentPos2.y), glm::vec2(mParentPos2.x + mChildPos2.x, mParentPos2.y + mChildPos2.y), Color::Red(), 1.5f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g.DrawQuad(Rectangle(mParentPos3.x, mParentPos3.y, 50.0f, 50.0f), Color::Black());
|
|
|
|
|
|
|
|
parent = glm::mat4(1.0f);
|
|
|
|
|
|
|
|
parent = glm::translate(parent, mParentPos3);
|
|
|
|
|
|
|
|
g.DrawQuad(Rectangle(mChildPos3.x, mChildPos3.y, 50.0f, 50.0f), Color(0.75f, 0.15f, 0.5f, 1.0f), nullptr, mChildAngle, Rectangle(-1, -1, -1, -1), parent);
|
|
|
|
|
|
|
|
g.DrawLine(glm::vec2(mParentPos3.x, mParentPos3.y), glm::vec2(mParentPos3.x + mChildPos3.x, mParentPos3.y + mChildPos3.y), Color::Black(), 1.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
@ -325,7 +347,7 @@ namespace lunarium
|
|
|
|
ImGui::Text("FPS: %d", Core::GetInstance().GetFrameData().CurrentFPS);
|
|
|
|
ImGui::Text("FPS: %d", Core::GetInstance().GetFrameData().CurrentFPS);
|
|
|
|
ImGui::Text("Frame Number: %d", mNumFrames);
|
|
|
|
ImGui::Text("Frame Number: %d", mNumFrames);
|
|
|
|
ImGui::EndChild();
|
|
|
|
ImGui::EndChild();
|
|
|
|
ImGui::BeginChild("Settings", ImVec2(ImGui::GetWindowSize().x - 15, ImGui::GetFrameHeightWithSpacing() * 6.5f), true);
|
|
|
|
ImGui::BeginChild("Settings", ImVec2(ImGui::GetWindowSize().x - 15, ImGui::GetFrameHeightWithSpacing() * 10.5f), true);
|
|
|
|
ImGui::Text("Settings");
|
|
|
|
ImGui::Text("Settings");
|
|
|
|
ImGui::Separator();
|
|
|
|
ImGui::Separator();
|
|
|
|
if (mTestMode == TestMode::Stress)
|
|
|
|
if (mTestMode == TestMode::Stress)
|
|
|
|
@ -399,6 +421,8 @@ namespace lunarium
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mTestMode == TestMode::Parent)
|
|
|
|
else if (mTestMode == TestMode::Parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// GROUP ONE
|
|
|
|
|
|
|
|
ImGui::Text("Group One:");
|
|
|
|
float parent_pos[3] = { mParentPos.x, mParentPos.y, mParentPos.z };
|
|
|
|
float parent_pos[3] = { mParentPos.x, mParentPos.y, mParentPos.z };
|
|
|
|
float child_pos[3] = { mChildPos.x, mChildPos.y, mChildPos.z };
|
|
|
|
float child_pos[3] = { mChildPos.x, mChildPos.y, mChildPos.z };
|
|
|
|
|
|
|
|
|
|
|
|
@ -409,12 +433,59 @@ namespace lunarium
|
|
|
|
mParentPos = { parent_pos[0], parent_pos[1], parent_pos[2] };
|
|
|
|
mParentPos = { parent_pos[0], parent_pos[1], parent_pos[2] };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Parent Angle:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
ImGui::DragFloat("##ParentAngle", &mParentAngle);
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Child Position:");
|
|
|
|
ImGui::Text("Child Position:");
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::DragFloat3("##ChildPos", child_pos))
|
|
|
|
if (ImGui::DragFloat3("##ChildPos", child_pos))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mChildPos = { child_pos[0], child_pos[1], child_pos[2] };
|
|
|
|
mChildPos = { child_pos[0], child_pos[1], child_pos[2] };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Child Angle:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
ImGui::DragFloat("##ChildAngle", &mChildAngle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GROUP TWO
|
|
|
|
|
|
|
|
ImGui::Text("Group two:");
|
|
|
|
|
|
|
|
float parent_pos2[3] = { mParentPos2.x, mParentPos2.y, mParentPos2.z };
|
|
|
|
|
|
|
|
float child_pos2[3] = { mChildPos2.x, mChildPos2.y, mChildPos2.z };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Parent Position:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::DragFloat3("##ParentPos2", parent_pos2))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mParentPos2 = { parent_pos2[0], parent_pos2[1], parent_pos2[2] };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Child Position:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::DragFloat3("##ChildPos2", child_pos2))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mChildPos2 = { child_pos2[0], child_pos2[1], child_pos2[2] };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GROUP THREE
|
|
|
|
|
|
|
|
ImGui::Text("Group three:");
|
|
|
|
|
|
|
|
float parent_pos3[3] = { mParentPos3.x, mParentPos3.y, mParentPos3.z };
|
|
|
|
|
|
|
|
float child_pos3[3] = { mChildPos3.x, mChildPos3.y, mChildPos3.z };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Parent Position:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::DragFloat3("##ParentPos3", parent_pos3))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mParentPos3 = { parent_pos3[0], parent_pos3[1], parent_pos3[2] };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Child Position:");
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::DragFloat3("##ChildPos3", child_pos3))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mChildPos3 = { child_pos3[0], child_pos3[1], child_pos3[2] };
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::EndChild();
|
|
|
|
ImGui::EndChild();
|
|
|
|
|