Skip to content

Commit

Permalink
updated way of how picking works
Browse files Browse the repository at this point in the history
  • Loading branch information
wpsimon09 committed Oct 3, 2024
1 parent f769f44 commit 60df884
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/VirtualAnatomy/ExplorerLevel/MeshSelector.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ This post-processing volume uses the `HighLightMat` material, which can be found

Every actor that has the `RenderCustomDepth` field set to `True` will be highlighted. By default, this field is set to `False`. We use this to our advantage by setting the `RenderCustomDepth` field to `True` whenever the user clicks on a mesh. This causes the clicked actor to be highlighted.

To improve performance, we've merged larger parts of the model (like bones, arteries and parts of hearth) in Blender, allowing us to render them all at once. You can find these in the `FullBody_Merged` folder in the context menu. This helped us load all necessary textures without the hassle of exporting FBX files properly. As a result, Blender scripts used by previous developers are no longer needed.

To allow users to click on different parts of the model, we exported each body mesh as it is in the Blender file, but with fewer triangles using Blender's Decimate modifier.

We then hid these meshes, so they're loaded into Unreal Engine's Bounding Volume Hierarchy but not drawn. These hidden meshes (static mesh actors) are named `Picker-Mesh`. This lets us detect clicks on different parts of the model without rendering them, which gave us a huge performance boost.

By default, the actors in Picker-Mesh are hidden and only become visible if the user selects them.

While this approach may cause more work for developers, it significantly improves the user experience.

# `MeshSelector.h`

This class is responsible for performing the actions specified above.
Expand Down
38 changes: 36 additions & 2 deletions docs/VirtualAnatomy/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,43 @@ For how to set up project up and running on Linux please reffer to [this file](/

### C++ code guide lines

### Class naming conventions
For class members that have macro `UPROPERTY` or `UFUNCTION` defined above them we have used the `PascalCase`

For functions that are used inside classes we have also used `PascalCase`

For private member functions that are only accesible within the classes we have used `m_` prefix and `smallPacalCase` example


```c++
class FooBar{

public:
Foo(std::string name);

public:
UPROPERTY(BlueprintReadOnly)
AActor* actor

UFUNCTION(BlueprintCallable)
void DisplayFoo(bool& success);

private:
int m_countOfFoos;
}

```
### Class names
Class names are specified with `PascalCase`
### Forward declaration of headers
### Unreal Engine C++ API
In `C++` you can use `#include` prepocessor to include external header files. This however is going to take long time to compile, therefore we have used forward declaration wherever possible inside the header files and only use `#include` preprocessor inside the `cpp` files.
### Memory safety
We have designed the class strucutre around `Ownership` priciple. To do that we have use `smart pointers` that are defined by unreal engine. This assures that only given class can "own" the resource and others can only borrow it without additionaly coppies.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: VirtualAnatomy docs
site_name: Virtual Anatomy docs
include_sidebar: false
site_description: 'Documentation for VirtualAnatomy'
site_author: 'JRCZ'
Expand Down

0 comments on commit 60df884

Please sign in to comment.