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

Update for new Asset system #9

Merged
merged 18 commits into from
Sep 18, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ jobs:
path: |
build\win\release\RavEngine*.exe
build\win\release\RavEngine*.rvedata
build\win\release\D3D12\*
build\win\release\RavEngine*Streaming\*
- name: Prepare Transfer.sh upload
run: Compress-Archive -Path build\win\release\*.exe,build\win\release\*.rvedata,build\win\release\*Streaming\ -DestinationPath Samples${{ matrix.arch }}.zip
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ function (add_sample sample_dir)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "${APPNAME}")

file(GLOB objects "${sample_dir}/objects/*.fbx" "${sample_dir}/objects/*.dae" "${sample_dir}/objects/*.ozz" "${sample_dir}/objects/*.obj" "${sample_dir}/objects/*.ply")
file(GLOB meshes "${sample_dir}/meshes/*.json")
file(GLOB skeletons "${sample_dir}/meshes/*.skeleton")
file(GLOB animations "${sample_dir}/meshes/*.anim")
file(GLOB textures "${sample_dir}/textures/*.jpg" "${sample_dir}/textures/*.png" "${sample_dir}/textures/*.svg" "${sample_dir}/textures/*.tiff")
file(GLOB shaders "${sample_dir}/shaders/*.json")
file(GLOB uis "${sample_dir}/ui/*.rml" "${sample_dir}/ui/*.rcss" "${sample_dir}/ui/*.png" "${sample_dir}/ui/*.json" "${sample_dir}/ui/*.ids")
Expand All @@ -87,6 +90,9 @@ function (add_sample sample_dir)
pack_resources(TARGET "${APPNAME}"
OUTPUT_FILE DATA_PACK
OBJECTS ${objects}
MESHES ${meshes}
SKELETONS ${skeletons}
ANIMATIONS ${animations}
SHADERS ${shaders}
TEXTURES ${textures}
UIS ${uis}
Expand Down Expand Up @@ -205,3 +211,5 @@ add_sample("Rendering")
add_sample("SoundDynamics")
add_sample("SceneViewer")
add_sample("Rats")

target_link_libraries(RavEngineSceneViewer PUBLIC rve_importlib assimp)
2 changes: 1 addition & 1 deletion RavEngine
3 changes: 1 addition & 2 deletions Samples/AirHockey/Paddle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ void Paddle::Create(const ColorRGBA& color)
{
GameObject::Create();
MeshAssetOptions opt;
opt.scale = 0.5;

Ref<PBRMaterialInstance> material = New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
material->SetAlbedoColor(color);
auto& mesh = EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("HockeyPaddle.fbx", opt)), material);
auto& mesh = EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("HockeyPaddle", opt)), material);

//PhysX doesn't have a cylinder primitive, so we use a sphere offset upwards and lock the axes
auto& dyn = EmplaceComponent<RigidBodyDynamicComponent>(FilterLayers::L0, FilterLayers::L0 | FilterLayers::L1);
Expand Down
3 changes: 1 addition & 2 deletions Samples/AirHockey/Puck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ void Puck::Create()
{
GameObject::Create();
MeshAssetOptions opt;
opt.scale = 0.35;
if (material == nullptr) {
material = New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
material->SetAlbedoColor({ 0.2,0.2,0.2,1 });
}
auto& puckmesh = EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("HockeyPuck.fbx", opt)), material);
auto& puckmesh = EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("HockeyPuck", opt)), material);

auto& dyn = EmplaceComponent<RigidBodyDynamicComponent>(FilterLayers::L0, FilterLayers::L0 | FilterLayers::L1);
dyn.EmplaceCollider<SphereCollider>(0.3f, New<PhysicsMaterial>(0.f, 0.f, 1.f), vector3(0.f, 0.3f, 0.f));
Expand Down
2 changes: 1 addition & 1 deletion Samples/AirHockey/Table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void Table::Create()
GameObject::Create();
//create the table
Ref<PBRMaterialInstance> matinst = New< PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
auto tableMeshAsset = MeshAsset::Manager::Get("HockeyTable.fbx", MeshAssetOptions{ .keepInSystemRAM = true });
auto tableMeshAsset = MeshAsset::Manager::Get("HockeyTable", MeshAssetOptions{ .keepInSystemRAM = true });
auto& tablemesh = EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(tableMeshAsset), matinst);

//low-friction
Expand Down
4 changes: 4 additions & 0 deletions Samples/AirHockey/meshes/HockeyPaddle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "HockeyPaddle.fbx",
"scale": 0.5
}
4 changes: 4 additions & 0 deletions Samples/AirHockey/meshes/HockeyPuck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "HockeyPuck.fbx",
"scale": 0.35
}
3 changes: 3 additions & 0 deletions Samples/AirHockey/meshes/HockeyTable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file" : "HockeyTable.fbx"
}
9 changes: 4 additions & 5 deletions Samples/Animation/Character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ void CharacterScript::StartPounding() {
}


void Character::Create(Ref<MeshCollectionSkinned> mesh, Ref<PBRMaterialInstance> material, Ref<SkeletonAsset> skeleton) {
void Character::Create(Ref<MeshCollectionSkinned> mesh, Ref<MeshCollectionStatic> handMesh, Ref<PBRMaterialInstance> handMatInst, Ref<PBRMaterialInstance> material, Ref<SkeletonAsset> skeleton) {
GameObject::Create();
// setup animation
// note: if you are loading multiple instances
// of an animated character, you will want to load and store
// the assets separately to avoid unnecessary disk i/o and parsing.
auto all_clips = RavEngine::New<AnimationAsset>("character_anims.fbx", skeleton);
auto all_clips = RavEngine::New<AnimationAsset>("character");
auto walk_anim = RavEngine::New<AnimationAssetSegment>(all_clips, 0, 47);
auto idle_anim = RavEngine::New<AnimationAssetSegment>(all_clips, 60,120);
auto run_anim = RavEngine::New<AnimationAssetSegment>(all_clips, 131, 149);
Expand Down Expand Up @@ -217,9 +217,8 @@ void Character::Create(Ref<MeshCollectionSkinned> mesh, Ref<PBRMaterialInstance>
// the Sockets feature allows you to expose transforms at bones on an animated skeleton as though they were their own entities.
// this is useful for attaching an object to a character's hand, as shown below.
auto handEntity = GetWorld()->Instantiate<GameObject>();
MeshAssetOptions opt;
opt.scale = 0.4f;
handEntity.EmplaceComponent<StaticMesh>(MeshCollectionStaticManager::Get("cone.obj", opt), RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>()));
handEntity.EmplaceComponent<StaticMesh>(handMesh, handMatInst);
handEntity.GetTransform().SetLocalScale(0.4);

childEntity.EmplaceComponent<ConstraintTarget>();
// you must use the name from the importer. To see imported names, have your debugger print animcomp->skeleton->skeleton->joint_names_.data_+n
Expand Down
3 changes: 2 additions & 1 deletion Samples/Animation/Character.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace RavEngine {
struct MeshCollectionSkinned;
struct MeshCollectionStatic;
}

struct CharacterScript : public RavEngine::ComponentWithOwner {
Expand Down Expand Up @@ -46,7 +47,7 @@ namespace RavEngine {


struct Character : public RavEngine::GameObject {
void Create(Ref<RavEngine::MeshCollectionSkinned> skinnedMesh, Ref<RavEngine::PBRMaterialInstance> materialInstance, Ref<RavEngine::SkeletonAsset> skeleton);
void Create(Ref<RavEngine::MeshCollectionSkinned> skinnedMesh, Ref<RavEngine::MeshCollectionStatic> handMesh, Ref<RavEngine::PBRMaterialInstance> handMatInst, Ref<RavEngine::PBRMaterialInstance> materialInstance, Ref<RavEngine::SkeletonAsset> skeleton);
void Move(const vector3&, decimalType speedMultiplier = 0);
void Jump();
void Pound();
Expand Down
23 changes: 12 additions & 11 deletions Samples/Animation/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <RavEngine/SkinnedMeshComponent.hpp>
#include <RavEngine/Utilities.hpp>
#include <RavEngine/InputManager.hpp>
#include <RavEngine/SceneLoader.hpp>
#include <FPSSystem.hpp>
#include <RavEngine/PhysicsBodyComponent.hpp>
#include <RavEngine/PhysicsSolver.hpp>
Expand Down Expand Up @@ -45,19 +44,22 @@ Level::Level(){
auto& gui = lights.EmplaceComponent<GUIComponent>();
gui.AddDocument("ui.rml");

auto spawnCharacter = [this](Ref<MeshCollectionSkinned> mesh, Ref<PBRMaterialInstance> charMat, Ref<SkeletonAsset> skeleton, vector3 pos) {
auto character2 = Instantiate<Character>(mesh, charMat, skeleton);
auto coneMesh = MeshCollectionStaticManager::Get("cone");
auto handMatInst = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());

auto spawnCharacter = [this,&coneMesh, &handMatInst](Ref<MeshCollectionSkinned> mesh, Ref<PBRMaterialInstance> charMat, Ref<SkeletonAsset> skeleton, vector3 pos) {
auto character2 = Instantiate<Character>(mesh, coneMesh, handMatInst, charMat, skeleton);
character2.GetComponent<RigidBodyDynamicComponent>().setDynamicsWorldPose(pos, vector3(0, 0, 0));
characters.push_back(character2);
};

{
auto skeleton = RavEngine::New<SkeletonAsset>("character_anims.fbx");
auto mesh = MeshCollectionSkinnedManager::Get("character_anims.fbx", skeleton);
auto skeleton = RavEngine::New<SkeletonAsset>("character_bones");
auto mesh = MeshCollectionSkinnedManager::Get("character_skin");
auto charMat = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
charMat->SetAlbedoColor({ 1,0.4,0.2,1 });

character = Instantiate<Character>(mesh, charMat, skeleton);
character = Instantiate<Character>(mesh, coneMesh, handMatInst, charMat, skeleton);
character.GetComponent<RigidBodyDynamicComponent>().setDynamicsWorldPose(vector3(15, 5, 0), vector3(0, deg_to_rad(90), 0));
characters.push_back(character);

Expand All @@ -68,8 +70,8 @@ Level::Level(){

// this one uses its own assets to be considered distinct by the engine
{
auto skeleton = RavEngine::New<SkeletonAsset>("character_anims.fbx");
auto mesh = MeshCollectionSkinnedManager::Get("character_anims.fbx", skeleton);
auto skeleton = RavEngine::New<SkeletonAsset>("character_bones");
auto mesh = MeshCollectionSkinnedManager::Get("character_skin");
auto charMat = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
charMat->SetAlbedoColor({ 0.2,0.4,1,1 });

Expand Down Expand Up @@ -127,11 +129,10 @@ Level::Level(){
Ref<PBRMaterialInstance> material = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
auto physmat = RavEngine::New<PhysicsMaterial>(0.5, 0.5, 0);
MeshAssetOptions opt;
opt.scale = 1.5;
opt.keepInSystemRAM = true;
{
auto floorplane = Instantiate<RavEngine::GameObject>();
Ref<MeshAsset> sharedMesh = MeshAsset::Manager::GetWithKey("level.fbx", lvl_floors_key, "ground", opt);
Ref<MeshAsset> sharedMesh = MeshAsset::Manager::GetWithKey("level_floors", lvl_floors_key, opt);
material->SetAlbedoColor({ 174.f / 255,210.f / 255,234.f / 255,1 });
floorplane.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(sharedMesh), material);
auto& r = floorplane.EmplaceComponent<RigidBodyStaticComponent>(FilterLayers::L0, FilterLayers::L0);
Expand All @@ -140,7 +141,7 @@ Level::Level(){

// load the walls
auto walls = Instantiate<GameObject>();
Ref<MeshAsset> sharedMesh = MeshAsset::Manager::GetWithKey("level.fbx", lvl_wall_key, "walls", opt);
Ref<MeshAsset> sharedMesh = MeshAsset::Manager::GetWithKey("level_walls", lvl_wall_key, opt);
walls.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(sharedMesh),material);
auto& s = walls.EmplaceComponent<RigidBodyStaticComponent>(FilterLayers::L1, FilterLayers::L1); // we use L0 to determine floor vs walls
s.EmplaceCollider<MeshCollider>(sharedMesh, physmat);
Expand Down
3 changes: 3 additions & 0 deletions Samples/Animation/meshes/character.anim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file": "character_anims.fbx"
}
3 changes: 3 additions & 0 deletions Samples/Animation/meshes/character_bones.skeleton
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file": "character_anims.fbx"
}
4 changes: 4 additions & 0 deletions Samples/Animation/meshes/character_skin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "character_anims.fbx",
"type": "skinned"
}
File renamed without changes.
5 changes: 5 additions & 0 deletions Samples/Animation/meshes/level_floors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"file": "level.fbx",
"scale": 1.5,
"mesh": "ground"
}
5 changes: 5 additions & 0 deletions Samples/Animation/meshes/level_walls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"file": "level.fbx",
"scale": 1.5,
"mesh": "walls"
}
19 changes: 6 additions & 13 deletions Samples/Flags/Flagpole.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "Flagpole.hpp"
#include <RavEngine/SceneLoader.hpp>
#include <RavEngine/StaticMesh.hpp>
#include <RavEngine/AnimatorComponent.hpp>
#include <RavEngine/SkinnedMeshComponent.hpp>
Expand All @@ -12,21 +11,15 @@ using namespace std;
void Flagpole::Create(){
GameObject::Create();
// load meshes
SceneLoader sl("flagpole.fbx");
Vector<Ref<MeshAsset>> meshes;
sl.LoadMeshes([](const PreloadedAsset& asset){
return true;
}, [&](Ref<MeshAsset> mesh, Ref<PBRMaterialInstance> inst, const PreloadedAsset & data){
meshes.push_back(mesh);
});

auto mat = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(meshes[0]), mat);
EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(meshes[1]), mat);
EmplaceComponent<StaticMesh>(MeshCollectionStaticManager::Get("flagpole"), mat);
EmplaceComponent<StaticMesh>(MeshCollectionStaticManager::Get("flagpole_top"), mat);

// load animation
auto skeleton = RavEngine::New<SkeletonAsset>("flag.fbx");
auto clips = RavEngine::New<AnimationAsset>("flag.fbx",skeleton);
auto meshAssetSkinned = MeshCollectionSkinnedManager::Get("flag.fbx",skeleton);
auto skeleton = RavEngine::New<SkeletonAsset>("flag");
auto clips = RavEngine::New<AnimationAsset>("flag");
auto meshAssetSkinned = MeshCollectionSkinnedManager::Get("flag");

auto flagEntity = GetWorld()->Instantiate<GameObject>();
GetTransform().AddChild(flagEntity);
Expand Down
4 changes: 2 additions & 2 deletions Samples/Flags/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct Level : public World{
{
constexpr int nblades = 4096;
constexpr float scale = 0.3;
auto grassmesh = New<MeshCollectionStatic>(MeshAsset::Manager::Get("grass.obj"));
auto grassmesh = New<MeshCollectionStatic>(MeshAsset::Manager::Get("grass"));
grassMatInst = RavEngine::New<GrassMatInst>(Material::Manager::Get<GrassMat>());

for (int i = 0; i < nblades; i++) {
Expand Down Expand Up @@ -131,7 +131,7 @@ struct Level : public World{
auto ground = Instantiate<GameObject>();
auto groundMat = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
groundMat->SetAlbedoColor({ 92/255.f, 60/255.f, 29/255.f,1});
ground.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("quad.obj")), groundMat);
ground.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("quad")), groundMat);
ground.GetTransform().LocalScaleDelta(vector3(10));

flagpole = Instantiate<Flagpole>();
Expand Down
3 changes: 3 additions & 0 deletions Samples/Flags/meshes/flag.anim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file": "flag.fbx"
}
File renamed without changes.
4 changes: 4 additions & 0 deletions Samples/Flags/meshes/flag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "flag.fbx",
"type": "skinned"
}
3 changes: 3 additions & 0 deletions Samples/Flags/meshes/flag.skeleton
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file": "flag.fbx"
}
File renamed without changes.
4 changes: 4 additions & 0 deletions Samples/Flags/meshes/flagpole.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "flagpole.fbx",
"mesh": "pole"
}
4 changes: 4 additions & 0 deletions Samples/Flags/meshes/flagpole_top.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"file": "flagpole.fbx",
"mesh": "poleBall"
}
3 changes: 3 additions & 0 deletions Samples/Flags/meshes/grass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file": "grass.obj"
}
File renamed without changes.
6 changes: 0 additions & 6 deletions Samples/Flags/objects/grass.mtl

This file was deleted.

2 changes: 1 addition & 1 deletion Samples/GUI/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ::World::World(){
dirlight.GetTransform().LocalRotateDelta(vector3(deg_to_rad(45),deg_to_rad(45),0));

cube = Instantiate<GameObject>();
auto& cubemesh = cube.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("cube.obj")), RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>()));
auto& cubemesh = cube.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("cube")), RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>()));

auto gui = Instantiate<Entity>();
auto& doc = gui.EmplaceComponent<GUIComponent>();
Expand Down
5 changes: 2 additions & 3 deletions Samples/Gravity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ struct HeavyThing : public GameObject{
auto& body = EmplaceComponent<RigidBodyDynamicComponent>();
body.SetGravityEnabled(false);
body.SetMass(mass);
MeshAssetOptions opt;
opt.scale = scaleOverride;
auto matinst = RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
matinst->SetAlbedoColor(colorOverride);
EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::GetWithKey("sphere.obj", scaleOverride * 100, opt)), matinst);
EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(MeshAsset::Manager::Get("sphere")), matinst);
GetTransform().SetLocalScale(scaleOverride);
if (mass < 1000){
auto& light = EmplaceComponent<PointLight>();
light.SetIntensity(scaleOverride * 7);
Expand Down
6 changes: 3 additions & 3 deletions Samples/Navigation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct Level : public World{
}
}

auto sphereMeshCol = New<MeshCollectionStatic>(MeshAsset::Manager::Get("sphere.obj"));
auto sphereMeshCol = New<MeshCollectionStatic>(MeshAsset::Manager::Get("sphere"));
auto drawDottedLine = [this,sphereMeshCol](const vector3& start, const vector3& end, decimalType step){
vector3 point = start;
auto scalefac = (step / 2) / 1.7f;
Expand Down Expand Up @@ -151,7 +151,7 @@ struct Level : public World{
auto targetEndMat = New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>());
targetEndMat->SetAlbedoColor({0,0,1,1});

auto targetMeshCol = New<MeshCollectionStatic>(MeshAsset::Manager::Get("target.obj"));
auto targetMeshCol = New<MeshCollectionStatic>(MeshAsset::Manager::Get("target"));

targetBegin.EmplaceComponent<StaticMesh>(targetMeshCol, targetBeginMat);
targetEnd.EmplaceComponent<StaticMesh>(targetMeshCol, targetEndMat);
Expand Down Expand Up @@ -203,7 +203,7 @@ struct Level : public World{
auto mazeEntity = Instantiate<GameObject>();
MeshAssetOptions opt;
opt.keepInSystemRAM = true;
mesh = MeshAsset::Manager::Get("maze.fbx", opt);
mesh = MeshAsset::Manager::Get("maze", opt);
mazeEntity.EmplaceComponent<StaticMesh>(New<MeshCollectionStatic>(mesh), RavEngine::New<PBRMaterialInstance>(Material::Manager::Get<PBRMaterial>()));
// used for raycasting clicks onto the maze
auto& rigid = mazeEntity.EmplaceComponent<RigidBodyStaticComponent>();
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions Samples/Navigation/meshes/maze.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file" : "maze.fbx"
}
3 changes: 3 additions & 0 deletions Samples/Navigation/meshes/target.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"file" : "target.obj"
}
Loading
Loading