Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix spelling error #479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,6 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# imgui.ini
imgui.ini
2 changes: 1 addition & 1 deletion engine/source/editor/include/editor_scene_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Piccolo
private:
EditorTranslationAxis m_translation_axis;
EditorRotationAxis m_rotation_axis;
EditorScaleAxis m_scale_aixs;
EditorScaleAxis m_scale_axis;

GObjectID m_selected_gobject_id{ k_invalid_gobject_id };
Matrix4x4 m_selected_object_matrix{ Matrix4x4::IDENTITY };
Expand Down
6 changes: 3 additions & 3 deletions engine/source/editor/source/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

namespace Piccolo
{
void registerEdtorTickComponent(std::string component_type_name)
void registerEditorTickComponent(std::string component_type_name)
{
g_editor_tick_component_types.insert(component_type_name);
}

PiccoloEditor::PiccoloEditor()
{
registerEdtorTickComponent("TransformComponent");
registerEdtorTickComponent("MeshComponent");
registerEditorTickComponent("TransformComponent");
registerEditorTickComponent("MeshComponent");
}

PiccoloEditor::~PiccoloEditor() {}
Expand Down
26 changes: 13 additions & 13 deletions engine/source/editor/source/editor_scene_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ namespace Piccolo
{
return m_selected_axis;
}
RenderEntity* selected_aixs = getAxisMeshByType(m_axis_mode);
RenderEntity* selected_axis = getAxisMeshByType(m_axis_mode);
m_selected_axis = 3;
if (m_is_show_axis == false)
{
return m_selected_axis;
}
else
{
Matrix4x4 model_matrix = selected_aixs->m_model_matrix;
Matrix4x4 model_matrix = selected_axis->m_model_matrix;
Vector3 model_scale;
Quaternion model_rotation;
Vector3 model_translation;
Expand Down Expand Up @@ -198,7 +198,7 @@ namespace Piccolo
axis_mesh = &m_rotation_axis;
break;
case EditorAxisMode::ScaleMode:
axis_mesh = &m_scale_aixs;
axis_mesh = &m_scale_axis;
break;
default:
break;
Expand All @@ -221,17 +221,17 @@ namespace Piccolo
Matrix4x4 translation_matrix = Matrix4x4::getTrans(translation);
Matrix4x4 scale_matrix = Matrix4x4::buildScaleMatrix(1.0f, 1.0f, 1.0f);
Matrix4x4 axis_model_matrix = translation_matrix * scale_matrix;
RenderEntity* selected_aixs = getAxisMeshByType(m_axis_mode);
RenderEntity* selected_axis = getAxisMeshByType(m_axis_mode);
if (m_axis_mode == EditorAxisMode::TranslateMode || m_axis_mode == EditorAxisMode::RotateMode)
{
selected_aixs->m_model_matrix = axis_model_matrix;
selected_axis->m_model_matrix = axis_model_matrix;
}
else if (m_axis_mode == EditorAxisMode::ScaleMode)
{
selected_aixs->m_model_matrix = axis_model_matrix * Matrix4x4(rotation);
selected_axis->m_model_matrix = axis_model_matrix * Matrix4x4(rotation);
}

g_editor_global_context.m_render_system->setVisibleAxis(*selected_aixs);
g_editor_global_context.m_render_system->setVisibleAxis(*selected_axis);
}
else
{
Expand Down Expand Up @@ -414,7 +414,7 @@ namespace Piccolo

m_translation_axis.m_model_matrix = axis_model_matrix;
m_rotation_axis.m_model_matrix = axis_model_matrix;
m_scale_aixs.m_model_matrix = axis_model_matrix;
m_scale_axis.m_model_matrix = axis_model_matrix;

g_editor_global_context.m_render_system->setVisibleAxis(m_translation_axis);

Expand Down Expand Up @@ -485,7 +485,7 @@ namespace Piccolo
transform_component->setPosition(new_translation);
transform_component->setRotation(new_rotation);
transform_component->setScale(new_scale);
m_scale_aixs.m_model_matrix = new_model_matrix;
m_scale_axis.m_model_matrix = new_model_matrix;
}
else if (m_axis_mode == EditorAxisMode::ScaleMode) // scale
{
Expand Down Expand Up @@ -562,13 +562,13 @@ namespace Piccolo
GameObjectPartId axis_instance_id = {0xFFCC, 0xFFCC};
MeshSourceDesc mesh_source_desc = {"%%scale_axis%%"};

m_scale_aixs.m_instance_id = instance_id_allocator.allocGuid(axis_instance_id);
m_scale_aixs.m_mesh_asset_id = mesh_asset_id_allocator.allocGuid(mesh_source_desc);
m_scale_axis.m_instance_id = instance_id_allocator.allocGuid(axis_instance_id);
m_scale_axis.m_mesh_asset_id = mesh_asset_id_allocator.allocGuid(mesh_source_desc);
}

g_editor_global_context.m_render_system->createAxis(
{m_translation_axis, m_rotation_axis, m_scale_aixs},
{m_translation_axis.m_mesh_data, m_rotation_axis.m_mesh_data, m_scale_aixs.m_mesh_data});
{m_translation_axis, m_rotation_axis, m_scale_axis},
{m_translation_axis.m_mesh_data, m_rotation_axis.m_mesh_data, m_scale_axis.m_mesh_data});
}

size_t EditorSceneManager::getGuidOfPickedMesh(const Vector2& picked_uv) const
Expand Down
8 changes: 4 additions & 4 deletions engine/source/runtime/core/meta/reflection/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ namespace Piccolo
m_fields.clear();
m_methods.clear();

auto fileds_iter = m_field_map.equal_range(type_name);
while (fileds_iter.first != fileds_iter.second)
auto fields_iter = m_field_map.equal_range(type_name);
while (fields_iter.first != fields_iter.second)
{
FieldAccessor f_field(fileds_iter.first->second);
FieldAccessor f_field(fields_iter.first->second);
m_fields.emplace_back(f_field);
m_is_valid = true;

++fileds_iter.first;
++fields_iter.first;
}

auto methods_iter = m_method_map.equal_range(type_name);
Expand Down
16 changes: 8 additions & 8 deletions engine/source/runtime/core/meta/reflection/reflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ namespace Piccolo
#endif // __REFLECTION_PARSER__

#define REFLECTION_BODY(class_name) \
friend class Reflection::TypeFieldReflectionOparator::Type##class_name##Operator; \
friend class Reflection::TypeFieldReflectionOperator::Type##class_name##Operator; \
friend class Serializer;
// public: virtual std::string getTypeName() override {return #class_name;}

#define REFLECTION_TYPE(class_name) \
namespace Reflection \
{ \
namespace TypeFieldReflectionOparator \
namespace TypeFieldReflectionOperator \
{ \
class Type##class_name##Operator; \
} \
Expand Down Expand Up @@ -76,9 +76,9 @@ namespace Piccolo
class ArrayAccessor;
class ReflectionInstance;
} // namespace Reflection
typedef std::function<void(void*, void*)> SetFuncion;
typedef std::function<void*(void*)> GetFuncion;
typedef std::function<const char*()> GetNameFuncion;
typedef std::function<void(void*, void*)> SetFunction;
typedef std::function<void*(void*)> GetFunction;
typedef std::function<const char*()> GetNameFunction;
typedef std::function<void(int, void*, void*)> SetArrayFunc;
typedef std::function<void*(int, void*)> GetArrayFunc;
typedef std::function<int(void*)> GetSizeFunc;
Expand All @@ -89,11 +89,11 @@ namespace Piccolo
typedef std::function<Json(void*)> WriteJsonByName;
typedef std::function<int(Reflection::ReflectionInstance*&, void*)> GetBaseClassReflectionInstanceListFunc;

typedef std::tuple<SetFuncion, GetFuncion, GetNameFuncion, GetNameFuncion, GetNameFuncion, GetBoolFunc>
typedef std::tuple<SetFunction, GetFunction, GetNameFunction, GetNameFunction, GetNameFunction, GetBoolFunc>
FieldFunctionTuple;
typedef std::tuple<GetNameFuncion, InvokeFunction> MethodFunctionTuple;
typedef std::tuple<GetNameFunction, InvokeFunction> MethodFunctionTuple;
typedef std::tuple<GetBaseClassReflectionInstanceListFunc, ConstructorWithJson, WriteJsonByName> ClassFunctionTuple;
typedef std::tuple<SetArrayFunc, GetArrayFunc, GetSizeFunc, GetNameFuncion, GetNameFuncion> ArrayFunctionTuple;
typedef std::tuple<SetArrayFunc, GetArrayFunc, GetSizeFunc, GetNameFunction, GetNameFunction> ArrayFunctionTuple;

namespace Reflection
{
Expand Down
2 changes: 1 addition & 1 deletion engine/source/runtime/function/character/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Piccolo
unsigned int command = g_runtime_global_context.m_input_system->getGameCommand();
if (command < (unsigned int)GameCommand::invalid)
{
if ((((unsigned int)GameCommand::free_carema & command) > 0) != m_is_free_camera)
if ((((unsigned int)GameCommand::free_camera & command) > 0) != m_is_free_camera)
{
toggleFreeCamera();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace Piccolo
bool has_move_command = ((unsigned int)GameCommand::forward | (unsigned int)GameCommand::backward |
(unsigned int)GameCommand::left | (unsigned int)GameCommand::right) &
command;
has_move_command &= ((unsigned int)GameCommand::free_carema & command) == 0;
has_move_command &= ((unsigned int)GameCommand::free_camera & command) == 0;
bool has_sprint_command = (unsigned int)GameCommand::sprint & command;

bool is_acceleration = false;
Expand Down
2 changes: 1 addition & 1 deletion engine/source/runtime/function/input/input_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Piccolo
m_game_command |= (unsigned int)GameCommand::sprint;
break;
case GLFW_KEY_F:
m_game_command ^= (unsigned int)GameCommand::free_carema;
m_game_command ^= (unsigned int)GameCommand::free_camera;
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion engine/source/runtime/function/input/input_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Piccolo
squat = 1 << 5, // not implemented yet
sprint = 1 << 6, // LEFT SHIFT
fire = 1 << 7, // not implemented yet
free_carema = 1 << 8, // F
free_camera = 1 << 8, // F
invalid = (unsigned int)(1 << 31) // lost focus
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Piccolo
{
std::atomic<ParticleEmitterID> new_emitter_ret = m_next_id.load();
m_next_id++;
if (m_next_id >= k_invalid_particke_emmiter_id)
if (m_next_id >= k_invalid_particle_emitter_id)
{
LOG_FATAL("particle emitter id overflow");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Piccolo
{
using ParticleEmitterID = std::size_t;

constexpr ParticleEmitterID k_invalid_particke_emmiter_id = std::numeric_limits<std::size_t>::max();
constexpr ParticleEmitterID k_invalid_particle_emitter_id = std::numeric_limits<std::size_t>::max();

class ParticleEmitterIDAllocator
{
Expand Down
10 changes: 5 additions & 5 deletions engine/source/runtime/function/particle/particle_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ namespace Piccolo
static constexpr int s_default_particle_life_time{ 10 };
static constexpr float s_default_particle_time_step{ 0.004 };

static const Vector4 s_default_emiter_position{ 5.71, 13.53, 3.0, 0.5 };
static const Vector4 s_default_emiter_velocity{ 0.02, 0.02, 2.5, 4.0 };
static const Vector4 s_default_emiter_acceleration{ 0.00, 0.00, -2.5, 0.0 };
static const Vector3 s_default_emiter_size{ 0.02, 0.02, 0.0 };
static const Vector2 s_default_emiter_life{ 1.2, 0.0 };
static const Vector4 s_default_emitter_position{ 5.71, 13.53, 3.0, 0.5 };
static const Vector4 s_default_emitter_velocity{ 0.02, 0.02, 2.5, 4.0 };
static const Vector4 s_default_emitter_acceleration{ 0.00, 0.00, -2.5, 0.0 };
static const Vector3 s_default_emitter_size{ 0.02, 0.02, 0.0 };
static const Vector2 s_default_emitter_life{ 1.2, 0.0 };

enum class EMITTER_TYPE
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ namespace Piccolo
directional_light_mesh_drawcall_batch;

// reorganize mesh
for (RenderMeshNode& node : *(m_visiable_nodes.p_directional_light_visible_mesh_nodes))
for (RenderMeshNode& node : *(m_visible_nodes.p_directional_light_visible_mesh_nodes))
{
auto& mesh_instanced = directional_light_mesh_drawcall_batch[node.ref_material];
auto& mesh_nodes = mesh_instanced[node.ref_mesh];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Piccolo
RenderPass::initialize(nullptr);

const MainCameraPassInitInfo* _init_info = static_cast<const MainCameraPassInitInfo*>(init_info);
m_enable_fxaa = _init_info->enble_fxaa;
m_enable_fxaa = _init_info->enable_fxaa;

setupAttachments();
setupRenderPass();
Expand Down Expand Up @@ -2112,7 +2112,7 @@ namespace Piccolo
std::map<VulkanPBRMaterial*, std::map<VulkanMesh*, std::vector<MeshNode>>> main_camera_mesh_drawcall_batch;

// reorganize mesh
for (RenderMeshNode& node : *(m_visiable_nodes.p_main_camera_visible_mesh_nodes))
for (RenderMeshNode& node : *(m_visible_nodes.p_main_camera_visible_mesh_nodes))
{
auto& mesh_instanced = main_camera_mesh_drawcall_batch[node.ref_material];
auto& mesh_nodes = mesh_instanced[node.ref_mesh];
Expand Down Expand Up @@ -2385,7 +2385,7 @@ namespace Piccolo
std::map<VulkanPBRMaterial*, std::map<VulkanMesh*, std::vector<MeshNode>>> main_camera_mesh_drawcall_batch;

// reorganize mesh
for (RenderMeshNode& node : *(m_visiable_nodes.p_main_camera_visible_mesh_nodes))
for (RenderMeshNode& node : *(m_visible_nodes.p_main_camera_visible_mesh_nodes))
{
auto& mesh_instanced = main_camera_mesh_drawcall_batch[node.ref_material];
auto& mesh_nodes = mesh_instanced[node.ref_mesh];
Expand Down Expand Up @@ -2683,27 +2683,27 @@ namespace Piccolo
&perframe_dynamic_offset);

m_axis_storage_buffer_object.selected_axis = m_selected_axis;
m_axis_storage_buffer_object.model_matrix = m_visiable_nodes.p_axis_node->model_matrix;
m_axis_storage_buffer_object.model_matrix = m_visible_nodes.p_axis_node->model_matrix;

RHIBuffer* vertex_buffers[3] = {m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_position_buffer,
m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_enable_blending_buffer,
m_visiable_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_buffer};
RHIBuffer* vertex_buffers[3] = {m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_position_buffer,
m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_enable_blending_buffer,
m_visible_nodes.p_axis_node->ref_mesh->mesh_vertex_varying_buffer};
RHIDeviceSize offsets[3] = {0, 0, 0};
m_rhi->cmdBindVertexBuffersPFN(m_rhi->getCurrentCommandBuffer(),
0,
(sizeof(vertex_buffers) / sizeof(vertex_buffers[0])),
vertex_buffers,
offsets);
m_rhi->cmdBindIndexBufferPFN(m_rhi->getCurrentCommandBuffer(),
m_visiable_nodes.p_axis_node->ref_mesh->mesh_index_buffer,
m_visible_nodes.p_axis_node->ref_mesh->mesh_index_buffer,
0,
RHI_INDEX_TYPE_UINT16);
(*reinterpret_cast<AxisStorageBufferObject*>(reinterpret_cast<uintptr_t>(
m_global_render_resource->_storage_buffer._axis_inefficient_storage_buffer_memory_pointer))) =
m_axis_storage_buffer_object;

m_rhi->cmdDrawIndexedPFN(m_rhi->getCurrentCommandBuffer(),
m_visiable_nodes.p_axis_node->ref_mesh->mesh_index_count,
m_visible_nodes.p_axis_node->ref_mesh->mesh_index_count,
1,
0,
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Piccolo

struct MainCameraPassInitInfo : RenderPassInitInfo
{
bool enble_fxaa;
bool enable_fxaa;
};

class MainCameraPass : public RenderPass
Expand Down
20 changes: 10 additions & 10 deletions engine/source/runtime/function/render/passes/particle_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ namespace Piccolo
m_rhi->freeCommandBuffers(m_rhi->getCommandPoor(), 1, copyCmd);
}

const VkDeviceSize staggingBuferSize = s_max_particles * sizeof(Particle);
const VkDeviceSize staggingBufferSize = s_max_particles * sizeof(Particle);
m_emitter_buffer_batches[id].m_emitter_desc = desc;

// fill in data
Expand Down Expand Up @@ -681,7 +681,7 @@ namespace Piccolo
RHI_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
m_emitter_buffer_batches[id].m_position_host_buffer,
m_emitter_buffer_batches[id].m_position_host_memory,
staggingBuferSize);
staggingBufferSize);

// Flush writes to host visible buffer
void* mapped;
Expand All @@ -697,14 +697,14 @@ namespace Piccolo
RHI_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
m_emitter_buffer_batches[id].m_position_device_buffer,
m_emitter_buffer_batches[id].m_position_device_memory,
staggingBuferSize);
staggingBufferSize);

m_rhi->createBufferAndInitialize(RHI_BUFFER_USAGE_STORAGE_BUFFER_BIT | RHI_BUFFER_USAGE_TRANSFER_SRC_BIT |
RHI_BUFFER_USAGE_TRANSFER_DST_BIT,
RHI_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
m_emitter_buffer_batches[id].m_position_render_buffer,
m_emitter_buffer_batches[id].m_position_render_memory,
staggingBuferSize);
staggingBufferSize);

// Copy to staging buffer
RHICommandBufferAllocateInfo cmdBufAllocateInfo {};
Expand All @@ -727,7 +727,7 @@ namespace Piccolo
RHIBufferCopy copyRegion = {};
copyRegion.srcOffset = 0;
copyRegion.dstOffset = 0;
copyRegion.size = staggingBuferSize;
copyRegion.size = staggingBufferSize;
m_rhi->cmdCopyBuffer(copyCmd,
m_emitter_buffer_batches[id].m_position_host_buffer,
m_emitter_buffer_batches[id].m_position_device_buffer,
Expand Down Expand Up @@ -814,11 +814,11 @@ namespace Piccolo
{
RHIDescriptorSetLayoutBinding particle_layout_bindings[11] = {};
{
RHIDescriptorSetLayoutBinding& uniform_layout_bingding = particle_layout_bindings[0];
uniform_layout_bingding.binding = 0;
uniform_layout_bingding.descriptorType = RHI_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
uniform_layout_bingding.descriptorCount = 1;
uniform_layout_bingding.stageFlags = RHI_SHADER_STAGE_COMPUTE_BIT;
RHIDescriptorSetLayoutBinding& uniform_layout_binding = particle_layout_bindings[0];
uniform_layout_binding.binding = 0;
uniform_layout_binding.descriptorType = RHI_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
uniform_layout_binding.descriptorCount = 1;
uniform_layout_binding.stageFlags = RHI_SHADER_STAGE_COMPUTE_BIT;
}

{
Expand Down
Loading