Improving Asset managment
@ -5,18 +5,21 @@
|
|||||||
|
|
||||||
#include "Deer/Path.h"
|
#include "Deer/Path.h"
|
||||||
|
|
||||||
#define DEER_SCENE_PATH "scenes"
|
#define DEER_ASSET_PATH "Assets"
|
||||||
#define DEER_SCRIPT_PATH "scripts"
|
#define DEER_MESH_PATH "Assets/Meshes"
|
||||||
#define DEER_SHADER_PATH "shaders"
|
#define DEER_SHADER_PATH "Assets/Shaders"
|
||||||
#define DEER_VOXEL_PATH "voxels"
|
#define DEER_SCENE_PATH "Assets/Scenes"
|
||||||
#define DEER_VOXEL_DATA_PATH "voxels/data"
|
#define DEER_SCRIPT_PATH "Assets/Scripts"
|
||||||
#define DEER_VOXEL_ASPECT_PATH "voxels/aspect"
|
|
||||||
#define DEER_VOXEL_TEXTURE_PATH "voxels/textures"
|
#define DEER_VOXEL_PATH "Assets/Voxels"
|
||||||
#define DEER_VOXEL_SHADER_PATH "voxels/shaders"
|
#define DEER_VOXEL_DATA_PATH "Assets/Voxels/Data"
|
||||||
|
#define DEER_VOXEL_ASPECT_PATH "Assets/Voxels/Visuals"
|
||||||
|
#define DEER_VOXEL_TEXTURE_PATH "Assets/Voxels/Textures"
|
||||||
|
#define DEER_VOXEL_SHADER_PATH "Assets/Voxels/Shaders"
|
||||||
|
|
||||||
#define DEER_EDITOR_PATH "Editor"
|
#define DEER_EDITOR_PATH "Editor"
|
||||||
#define DEER_EDITOR_PANEL_PATH "Editor/DockPanelModules"
|
#define DEER_EDITOR_PANEL_PATH "Editor/Panels"
|
||||||
#define DEER_EDITOR_SERVICE_PATH "Editor/ScriptServiceModules"
|
#define DEER_EDITOR_SERVICE_PATH "Editor/Services"
|
||||||
#define DEER_MESH_PATH "meshes"
|
|
||||||
|
|
||||||
#define DEER_MESH_EXTENSION ".dmesh"
|
#define DEER_MESH_EXTENSION ".dmesh"
|
||||||
#define DEER_SHADER_EXTENSION ".glsl"
|
#define DEER_SHADER_EXTENSION ".glsl"
|
||||||
@ -38,15 +41,18 @@ namespace Deer {
|
|||||||
void clearCache();
|
void clearCache();
|
||||||
|
|
||||||
// Rerturns a directory data with the elements relative to the id
|
// Rerturns a directory data with the elements relative to the id
|
||||||
const DirectoryData& getDirData(const Path& id, const Path& dir, const char* extension);
|
const DirectoryData& getDirData(const Path& id, const Path& dir,
|
||||||
|
const char* extension);
|
||||||
|
|
||||||
// TODO: Add safety
|
// TODO: Add safety
|
||||||
// Returns the data of the specified file path
|
// Returns the data of the specified file path
|
||||||
bool loadFileData(const Path& id, const Path& name, uint8_t** data, uint32_t* size);
|
bool loadFileData(const Path& id, const Path& name, uint8_t** data,
|
||||||
|
uint32_t* size);
|
||||||
// Returns the data of the specified file path avoiding extension
|
// Returns the data of the specified file path avoiding extension
|
||||||
bool loadGlobalFileData(const Path& id, const Path& name, uint8_t** data, uint32_t* size);
|
bool loadGlobalFileData(const Path& id, const Path& name,
|
||||||
|
uint8_t** data, uint32_t* size);
|
||||||
void freeFileData(uint8_t*);
|
void freeFileData(uint8_t*);
|
||||||
|
|
||||||
void createFolder(const Path& path);
|
void createFolder(const Path& path);
|
||||||
|
|
||||||
void saveFile(const Path&, uint8_t* data, uint32_t size);
|
void saveFile(const Path&, uint8_t* data, uint32_t size);
|
||||||
@ -60,5 +66,5 @@ namespace Deer {
|
|||||||
// Refactor----
|
// Refactor----
|
||||||
|
|
||||||
extern Path rootPath;
|
extern Path rootPath;
|
||||||
} // namespace DataStore
|
} // namespace DataStore
|
||||||
} // namespace Deer
|
} // namespace Deer
|
@ -2,200 +2,210 @@
|
|||||||
#include "Deer/Log.h"
|
#include "Deer/Log.h"
|
||||||
#include "Deer/Path.h"
|
#include "Deer/Path.h"
|
||||||
|
|
||||||
|
#include "cereal/archives/portable_binary.hpp"
|
||||||
#include "cereal/cereal.hpp"
|
#include "cereal/cereal.hpp"
|
||||||
#include "cereal/types/unordered_map.hpp"
|
#include "cereal/types/unordered_map.hpp"
|
||||||
#include "cereal/archives/portable_binary.hpp"
|
|
||||||
|
|
||||||
#include "Deer/DataStore/DataStructure.h"
|
#include "Deer/DataStore/DataStructure.h"
|
||||||
#include "Deer/DataStore/DataStructureSerialization.h"
|
#include "Deer/DataStore/DataStructureSerialization.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#include <sstream>
|
||||||
#include <streambuf>
|
#include <streambuf>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace Deer {
|
namespace Deer {
|
||||||
namespace DataStore {
|
namespace DataStore {
|
||||||
Path rootPath;
|
Path rootPath;
|
||||||
std::unordered_map<std::string ,DirectoryData> dirData_cache;
|
std::unordered_map<std::string, DirectoryData> dirData_cache;
|
||||||
}
|
} // namespace DataStore
|
||||||
|
|
||||||
const DirectoryData& DataStore::getDirData(const Path& id, const Path& subDir, const char* extension) {
|
const DirectoryData& DataStore::getDirData(const Path& id,
|
||||||
std::string dirId = std::string(id) + "&" + std::string(subDir) + "&" + std::string(extension);
|
const Path& subDir,
|
||||||
if (dirData_cache.contains(dirId)) {
|
const char* extension) {
|
||||||
return dirData_cache[dirId];
|
std::string dirId = std::string(id) + "&" + std::string(subDir) + "&" +
|
||||||
}
|
std::string(extension);
|
||||||
|
if (dirData_cache.contains(dirId)) {
|
||||||
|
return dirData_cache[dirId];
|
||||||
|
}
|
||||||
|
|
||||||
Path idPath = rootPath / id;
|
Path idPath = rootPath / id;
|
||||||
|
|
||||||
Path searchPath = idPath / subDir;
|
Path searchPath = idPath / subDir;
|
||||||
|
|
||||||
DirectoryData& dirData = dirData_cache[dirId];
|
DirectoryData& dirData = dirData_cache[dirId];
|
||||||
for (const auto& entry : std::filesystem::directory_iterator(searchPath)) {
|
for (const auto& entry :
|
||||||
if (entry.is_directory())
|
std::filesystem::directory_iterator(searchPath)) {
|
||||||
dirData.dirs.push_back(entry.path().lexically_relative(idPath));
|
if (entry.is_directory())
|
||||||
else if (entry.path().extension() == extension) {
|
dirData.dirs.push_back(entry.path().lexically_relative(idPath));
|
||||||
Path ent = entry.path().lexically_relative(idPath);
|
else if (entry.path().extension() == extension) {
|
||||||
dirData.elements.push_back(ent.parent_path() / ent.stem());
|
Path ent = entry.path().lexically_relative(idPath);
|
||||||
}
|
dirData.elements.push_back(ent.parent_path() / ent.stem());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return dirData;
|
return dirData;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataStore::loadFileData(const Path& id, const Path& name, uint8_t** data, uint32_t* size) {
|
bool DataStore::loadFileData(const Path& id, const Path& name,
|
||||||
Path filePath = rootPath / id / name;
|
uint8_t** data, uint32_t* size) {
|
||||||
std::ifstream file(filePath, std::ios::in | std::ios::binary);
|
Path filePath = rootPath / id / name;
|
||||||
|
std::ifstream file(filePath, std::ios::in | std::ios::binary);
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
file.close();
|
file.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.seekg(0, std::ios::end);
|
file.seekg(0, std::ios::end);
|
||||||
*size = (size_t)file.tellg();
|
*size = (size_t)file.tellg();
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
*data = new uint8_t[*size];
|
*data = new uint8_t[*size];
|
||||||
|
|
||||||
if (!file.read(reinterpret_cast<char*>(*data), *size)) {
|
if (!file.read(reinterpret_cast<char*>(*data), *size)) {
|
||||||
DEER_CORE_ERROR("Failed to read file: {0}", filePath.generic_string().c_str());
|
DEER_CORE_ERROR("Failed to read file: {0}",
|
||||||
delete[] *data;
|
filePath.generic_string().c_str());
|
||||||
return false;
|
delete[] *data;
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataStore::loadGlobalFileData(const Path& id, const Path& name, uint8_t** data, uint32_t* size) {
|
bool DataStore::loadGlobalFileData(const Path& id, const Path& name,
|
||||||
Path filePath = rootPath / id;
|
uint8_t** data, uint32_t* size) {
|
||||||
for (auto& f : std::filesystem::recursive_directory_iterator(filePath)) {
|
Path filePath = rootPath / id;
|
||||||
if (f.path().stem() == name) {
|
for (auto& f :
|
||||||
std::ifstream file(f.path(), std::ios::in | std::ios::binary);
|
std::filesystem::recursive_directory_iterator(filePath)) {
|
||||||
|
if (f.path().stem() == name) {
|
||||||
|
std::ifstream file(f.path(), std::ios::in | std::ios::binary);
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
file.close();
|
file.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.seekg(0, std::ios::end);
|
file.seekg(0, std::ios::end);
|
||||||
*size = (size_t)file.tellg();
|
*size = (size_t)file.tellg();
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
*data = new uint8_t[*size];
|
*data = new uint8_t[*size];
|
||||||
|
|
||||||
if (!file.read(reinterpret_cast<char*>(*data), *size)) {
|
if (!file.read(reinterpret_cast<char*>(*data), *size)) {
|
||||||
DEER_CORE_ERROR("Failed to read file: {0}", filePath.generic_string().c_str());
|
DEER_CORE_ERROR("Failed to read file: {0}",
|
||||||
delete[] *data;
|
filePath.generic_string().c_str());
|
||||||
return false;
|
delete[] *data;
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
file.close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DEER_CORE_ERROR("File {0} not found", filePath.string().c_str());
|
file.close();
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DataStore::freeFileData(uint8_t* data) {
|
DEER_CORE_ERROR("File {0} not found", filePath.string().c_str());
|
||||||
delete[] data;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataStore::deleteFile(const Path& path) {
|
void DataStore::freeFileData(uint8_t* data) { delete[] data; }
|
||||||
Path filePath = rootPath / toLowerCasePath(path);
|
|
||||||
std::filesystem::remove(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t* DataStore::readFile(const Path& path, uint32_t* size) {
|
void DataStore::deleteFile(const Path& path) {
|
||||||
Path filePath = rootPath / toLowerCasePath(path);
|
Path filePath = rootPath / toLowerCasePath(path);
|
||||||
std::ifstream file(filePath, std::ios::in | std::ios::binary);
|
std::filesystem::remove(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
if (!file) {
|
uint8_t* DataStore::readFile(const Path& path, uint32_t* size) {
|
||||||
file.close();
|
Path filePath = rootPath / path;
|
||||||
return nullptr;
|
std::ifstream file(filePath, std::ios::in | std::ios::binary);
|
||||||
}
|
|
||||||
|
|
||||||
file.seekg(0, std::ios::end);
|
if (!file) {
|
||||||
*size = (size_t)file.tellg();
|
file.close();
|
||||||
file.seekg(0, std::ios::beg);
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t* buffer = new uint8_t[*size];
|
file.seekg(0, std::ios::end);
|
||||||
|
*size = (size_t)file.tellg();
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
if (!file.read(reinterpret_cast<char*>(buffer), *size)) {
|
uint8_t* buffer = new uint8_t[*size];
|
||||||
DEER_CORE_ERROR("Failed to read file: {0}", filePath.generic_string().c_str());
|
|
||||||
delete[] buffer;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
if (!file.read(reinterpret_cast<char*>(buffer), *size)) {
|
||||||
return buffer;
|
DEER_CORE_ERROR("Failed to read file: {0}",
|
||||||
}
|
filePath.generic_string().c_str());
|
||||||
|
delete[] buffer;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void DataStore::saveFile(const Path& path, uint8_t* data, uint32_t size) {
|
file.close();
|
||||||
Path filePath = rootPath / toLowerCasePath(path);
|
return buffer;
|
||||||
std::filesystem::create_directories(filePath.parent_path());
|
}
|
||||||
|
|
||||||
std::ofstream file(filePath, std::ios::out | std::ios::binary);
|
void DataStore::saveFile(const Path& path, uint8_t* data, uint32_t size) {
|
||||||
|
Path filePath = rootPath / toLowerCasePath(path);
|
||||||
|
std::filesystem::create_directories(filePath.parent_path());
|
||||||
|
|
||||||
DEER_CORE_ASSERT(file, "Error when writing file {0}", filePath.generic_string().c_str());
|
std::ofstream file(filePath, std::ios::out | std::ios::binary);
|
||||||
|
|
||||||
file.write(reinterpret_cast<const char*>(data), size);
|
DEER_CORE_ASSERT(file, "Error when writing file {0}",
|
||||||
}
|
filePath.generic_string().c_str());
|
||||||
|
|
||||||
void DataStore::compressFiles(std::vector<Path> files, const Path& path) {
|
file.write(reinterpret_cast<const char*>(data), size);
|
||||||
std::unordered_map<Path, DataStructure> dataStructure;
|
}
|
||||||
std::vector<uint8_t> combinedData;
|
|
||||||
|
|
||||||
for (const Path& inputPath : files) {
|
|
||||||
uint32_t fileSize = 0;
|
|
||||||
uint8_t* fileData = readFile(inputPath, &fileSize);
|
|
||||||
|
|
||||||
uint32_t start = combinedData.size();
|
void DataStore::compressFiles(std::vector<Path> files, const Path& path) {
|
||||||
|
std::unordered_map<Path, DataStructure> dataStructure;
|
||||||
|
std::vector<uint8_t> combinedData;
|
||||||
|
|
||||||
combinedData.insert(combinedData.end(), fileData, fileData + fileSize);
|
for (const Path& inputPath : files) {
|
||||||
dataStructure[inputPath] = DataStructure{
|
uint32_t fileSize = 0;
|
||||||
.dataPath = inputPath,
|
uint8_t* fileData = readFile(inputPath, &fileSize);
|
||||||
.dataStart = start,
|
|
||||||
.dataSize = fileSize
|
|
||||||
};
|
|
||||||
|
|
||||||
delete[] fileData;
|
uint32_t start = combinedData.size();
|
||||||
}
|
|
||||||
|
|
||||||
Path compressedPath = path;
|
combinedData.insert(combinedData.end(), fileData,
|
||||||
compressedPath += ".deer";
|
fileData + fileSize);
|
||||||
Path metaPath = path;
|
dataStructure[inputPath] = DataStructure{.dataPath = inputPath,
|
||||||
metaPath += ".deer.meta";
|
.dataStart = start,
|
||||||
|
.dataSize = fileSize};
|
||||||
|
|
||||||
std::stringstream buffer;
|
delete[] fileData;
|
||||||
{
|
}
|
||||||
cereal::PortableBinaryOutputArchive archive(buffer);
|
|
||||||
archive(dataStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
saveFile(compressedPath, combinedData.data(), combinedData.size());
|
Path compressedPath = path;
|
||||||
saveFile(metaPath, (uint8_t*)buffer.str().c_str(), buffer.str().size());
|
compressedPath += ".deer";
|
||||||
}
|
Path metaPath = path;
|
||||||
|
metaPath += ".deer.meta";
|
||||||
|
|
||||||
std::vector<Path> DataStore::getFiles(const Path& path, const std::string& extension) {
|
std::stringstream buffer;
|
||||||
std::vector<Path> files;
|
{
|
||||||
Path lookPath = rootPath / path;
|
cereal::PortableBinaryOutputArchive archive(buffer);
|
||||||
|
archive(dataStructure);
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& entry : std::filesystem::recursive_directory_iterator(lookPath)) {
|
saveFile(compressedPath, combinedData.data(), combinedData.size());
|
||||||
if (std::filesystem::is_regular_file(entry) && entry.path().extension() == extension) {
|
saveFile(metaPath, (uint8_t*)buffer.str().c_str(), buffer.str().size());
|
||||||
files.push_back(entry.path().lexically_relative(rootPath));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return files;
|
std::vector<Path> DataStore::getFiles(const Path& path,
|
||||||
}
|
const std::string& extension) {
|
||||||
|
std::vector<Path> files;
|
||||||
|
Path lookPath = rootPath / path;
|
||||||
|
|
||||||
void DataStore::createFolder(const Path& path) {
|
for (const auto& entry :
|
||||||
std::filesystem::create_directories(path);
|
std::filesystem::recursive_directory_iterator(lookPath)) {
|
||||||
}
|
if (std::filesystem::is_regular_file(entry) &&
|
||||||
}
|
entry.path().extension() == extension) {
|
||||||
|
files.push_back(entry.path().lexically_relative(rootPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataStore::createFolder(const Path& path) {
|
||||||
|
std::filesystem::create_directories(path);
|
||||||
|
}
|
||||||
|
} // namespace Deer
|
||||||
|
@ -13,10 +13,11 @@ namespace Deer {
|
|||||||
namespace DataStore {
|
namespace DataStore {
|
||||||
std::vector<VoxelInfo> voxelsInfo;
|
std::vector<VoxelInfo> voxelsInfo;
|
||||||
std::unordered_map<std::string, uint32_t> blockIDMap;
|
std::unordered_map<std::string, uint32_t> blockIDMap;
|
||||||
} // namespace DataStore
|
} // namespace DataStore
|
||||||
|
|
||||||
int32_t DataStore::getVoxelID(const std::string& name) {
|
int32_t DataStore::getVoxelID(const std::string& name) {
|
||||||
if (blockIDMap.contains(name)) return blockIDMap[name];
|
if (blockIDMap.contains(name))
|
||||||
|
return blockIDMap[name];
|
||||||
DEER_CORE_WARN("Voxel Info {0} Not Found!", name.c_str());
|
DEER_CORE_WARN("Voxel Info {0} Not Found!", name.c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -35,7 +36,6 @@ namespace Deer {
|
|||||||
voxelsData = DataStore::getFiles(DEER_VOXEL_DATA_PATH, ".voxel");
|
voxelsData = DataStore::getFiles(DEER_VOXEL_DATA_PATH, ".voxel");
|
||||||
|
|
||||||
DEER_CORE_TRACE("Loading voxels");
|
DEER_CORE_TRACE("Loading voxels");
|
||||||
//DEER_CORE_TRACE(" default - air");
|
|
||||||
for (Path& voxel : voxelsData) {
|
for (Path& voxel : voxelsData) {
|
||||||
VoxelInfo voxelData;
|
VoxelInfo voxelData;
|
||||||
|
|
||||||
@ -61,9 +61,9 @@ namespace Deer {
|
|||||||
voxelData.name.c_str());
|
voxelData.name.c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//DEER_CORE_TRACE(" {0} - {1}",
|
// DEER_CORE_TRACE(" {0} - {1}",
|
||||||
// voxel.filename().generic_string().c_str(),
|
// voxel.filename().generic_string().c_str(),
|
||||||
// voxelData.name);
|
// voxelData.name);
|
||||||
|
|
||||||
uint32_t id = voxelsInfo.size();
|
uint32_t id = voxelsInfo.size();
|
||||||
|
|
||||||
@ -86,4 +86,4 @@ namespace Deer {
|
|||||||
DataStore::saveFile(Path(DEER_VOXEL_PATH) / "voxel.example",
|
DataStore::saveFile(Path(DEER_VOXEL_PATH) / "voxel.example",
|
||||||
(uint8_t*)(data.str().c_str()), data.str().size());
|
(uint8_t*)(data.str().c_str()), data.str().size());
|
||||||
}
|
}
|
||||||
} // namespace Deer
|
} // namespace Deer
|
@ -9,44 +9,44 @@ Size=400,400
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Terrain Editor]
|
[Window][Terrain Editor]
|
||||||
Pos=827,24
|
Pos=925,24
|
||||||
Size=453,361
|
Size=355,413
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000006,0
|
DockId=0x00000006,0
|
||||||
|
|
||||||
[Window][Viewport]
|
[Window][Viewport]
|
||||||
Pos=440,24
|
Pos=309,24
|
||||||
Size=385,361
|
Size=614,413
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000005,0
|
DockId=0x00000005,0
|
||||||
|
|
||||||
[Window][ViewportPannel]
|
[Window][ViewportPannel]
|
||||||
Pos=440,24
|
Pos=309,24
|
||||||
Size=385,361
|
Size=614,413
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000005,1
|
DockId=0x00000005,1
|
||||||
|
|
||||||
[Window][ShaderExplorer]
|
[Window][ShaderExplorer]
|
||||||
Pos=0,387
|
Pos=0,439
|
||||||
Size=1280,333
|
Size=1280,281
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000004,1
|
DockId=0x00000004,1
|
||||||
|
|
||||||
[Window][TreePannel]
|
[Window][TreePannel]
|
||||||
Pos=0,24
|
Pos=0,24
|
||||||
Size=438,361
|
Size=307,413
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000001,0
|
DockId=0x00000001,0
|
||||||
|
|
||||||
[Window][MeshExplorer]
|
[Window][MeshExplorer]
|
||||||
Pos=0,387
|
Pos=0,439
|
||||||
Size=1280,333
|
Size=1280,281
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000004,0
|
DockId=0x00000004,0
|
||||||
|
|
||||||
[Window][PropertiesPannel]
|
[Window][PropertiesPannel]
|
||||||
Pos=827,24
|
Pos=925,24
|
||||||
Size=453,361
|
Size=355,413
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000006,1
|
DockId=0x00000006,1
|
||||||
|
|
||||||
@ -62,22 +62,28 @@ Size=40,64
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Rename entity]
|
[Window][Rename entity]
|
||||||
Pos=1228,651
|
Pos=398,235
|
||||||
Size=104,68
|
Size=643,74
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Test]
|
[Window][Test]
|
||||||
Pos=440,24
|
Pos=423,24
|
||||||
Size=385,361
|
Size=1682,1012
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000005,2
|
DockId=0x00000005,2
|
||||||
|
|
||||||
|
[Window][AssetExplorer]
|
||||||
|
Pos=0,439
|
||||||
|
Size=1280,281
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x00000004,2
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockSpace ID=0xA1672E74 Window=0x4647B76E Pos=0,24 Size=1280,696 Split=Y Selected=0x34A4C10F
|
DockSpace ID=0xA1672E74 Window=0x4647B76E Pos=0,24 Size=1280,696 Split=Y Selected=0x34A4C10F
|
||||||
DockNode ID=0x00000003 Parent=0xA1672E74 SizeRef=1280,1012 Split=X
|
DockNode ID=0x00000003 Parent=0xA1672E74 SizeRef=1280,413 Split=X
|
||||||
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=438,696 Selected=0xE45B9F93
|
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=307,696 Selected=0xE45B9F93
|
||||||
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=2120,696 Split=X Selected=0x34A4C10F
|
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=971,696 Split=X Selected=0x34A4C10F
|
||||||
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=1665,454 CentralNode=1 Selected=0x34A4C10F
|
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=614,454 CentralNode=1 Selected=0x34A4C10F
|
||||||
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=453,454 Selected=0xA35A27E3
|
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=355,454 Selected=0xA35A27E3
|
||||||
DockNode ID=0x00000004 Parent=0xA1672E74 SizeRef=1280,333 Selected=0xD962995A
|
DockNode ID=0x00000004 Parent=0xA1672E74 SizeRef=1280,281 Selected=0x21191D0B
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
#include "DeerStudio.h"
|
#include "DeerStudio.h"
|
||||||
|
|
||||||
#include "Deer/Path.h"
|
|
||||||
#include "Deer/VoxelWorld.h"
|
|
||||||
#include "Deer/DataStore.h"
|
#include "Deer/DataStore.h"
|
||||||
#include "Deer/Voxel.h"
|
#include "Deer/Path.h"
|
||||||
#include "Deer/Scene.h"
|
#include "Deer/Scene.h"
|
||||||
|
#include "Deer/Voxel.h"
|
||||||
|
#include "Deer/VoxelWorld.h"
|
||||||
|
|
||||||
#include "DeerRender/Application.h"
|
#include "DeerRender/Application.h"
|
||||||
#include "DeerRender/GizmoRenderer.h"
|
#include "DeerRender/GizmoRenderer.h"
|
||||||
|
|
||||||
#include "DeerStudio/EditorEngine.h"
|
|
||||||
#include "DeerStudio/Editor/Viewport.h"
|
|
||||||
#include "DeerStudio/Editor/Terrain/TerrainEditor.h"
|
#include "DeerStudio/Editor/Terrain/TerrainEditor.h"
|
||||||
|
#include "DeerStudio/Editor/Viewport.h"
|
||||||
|
#include "DeerStudio/EditorEngine.h"
|
||||||
|
|
||||||
// TMP
|
// TMP
|
||||||
#include "DeerStudio/Editor/Icons.h"
|
#include "DeerStudio/Editor/Icons.h"
|
||||||
@ -19,20 +19,18 @@
|
|||||||
#include "DeerStudio/Style.h"
|
#include "DeerStudio/Style.h"
|
||||||
// TMP
|
// TMP
|
||||||
|
|
||||||
int main(int, char**) {
|
int main(int argc, char** args) { Deer::DeerStudio::main(); }
|
||||||
Deer::DeerStudio::main();
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Deer {
|
namespace Deer {
|
||||||
namespace DeerStudio {
|
namespace DeerStudio {
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
Log::init();
|
Log::init();
|
||||||
Application::initWindow();
|
Application::initWindow();
|
||||||
|
|
||||||
Path projectPath = Application::getWindow().folderDialog(nullptr);
|
Path projectPath = Application::getWindow().folderDialog(nullptr);
|
||||||
if (projectPath.empty()) return;
|
if (projectPath.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
DataStore::rootPath = projectPath;
|
DataStore::rootPath = projectPath;
|
||||||
|
|
||||||
DataStore::loadVoxelsData();
|
DataStore::loadVoxelsData();
|
||||||
@ -48,12 +46,12 @@ namespace Deer {
|
|||||||
SetupImGuiStyle();
|
SetupImGuiStyle();
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(20, 20));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(20, 20));
|
||||||
|
|
||||||
Application::setTickCallback(DeerStudio::onUpdate);
|
Application::setTickCallback(DeerStudio::onUpdate);
|
||||||
Application::setRenderCallback(DeerStudio::onRender);
|
Application::setRenderCallback(DeerStudio::onRender);
|
||||||
Application::setEventCallback(DeerStudio::onEvent);
|
Application::setEventCallback(DeerStudio::onEvent);
|
||||||
|
|
||||||
Application::run();
|
Application::run();
|
||||||
|
|
||||||
EditorEngine::deinitialize();
|
EditorEngine::deinitialize();
|
||||||
|
|
||||||
@ -61,72 +59,73 @@ namespace Deer {
|
|||||||
Log::shutdown();
|
Log::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdate() {
|
void onUpdate() {
|
||||||
if (VoxelWorld::isInitialized())
|
if (VoxelWorld::isInitialized())
|
||||||
VoxelWorld::bakeNextChunk();
|
VoxelWorld::bakeNextChunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onRender() {
|
void onRender() {
|
||||||
static bool opt_fullscreen = true;
|
static bool opt_fullscreen = true;
|
||||||
static bool opt_padding = false;
|
static bool opt_padding = false;
|
||||||
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None;
|
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None;
|
||||||
|
|
||||||
ImGuiWindowFlags window_flags =
|
ImGuiWindowFlags window_flags =
|
||||||
ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
|
ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
|
||||||
|
|
||||||
{
|
{
|
||||||
const ImGuiViewport* viewport = ImGui::GetMainViewport();
|
const ImGuiViewport* viewport = ImGui::GetMainViewport();
|
||||||
ImGui::SetNextWindowPos(viewport->WorkPos);
|
ImGui::SetNextWindowPos(viewport->WorkPos);
|
||||||
ImGui::SetNextWindowSize(viewport->WorkSize);
|
ImGui::SetNextWindowSize(viewport->WorkSize);
|
||||||
ImGui::SetNextWindowViewport(viewport->ID);
|
ImGui::SetNextWindowViewport(viewport->ID);
|
||||||
window_flags |= ImGuiWindowFlags_NoTitleBar |
|
window_flags |=
|
||||||
ImGuiWindowFlags_NoCollapse |
|
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse |
|
||||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
|
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
|
||||||
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus |
|
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus |
|
||||||
ImGuiWindowFlags_NoNavFocus;
|
ImGuiWindowFlags_NoNavFocus;
|
||||||
window_flags |= ImGuiWindowFlags_NoBackground;
|
window_flags |= ImGuiWindowFlags_NoBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool p_open = true;
|
static bool p_open = true;
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
ImVec2(0.0f, 0.0f));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
||||||
ImGui::Begin("DockSpace Demo", &p_open, window_flags);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
||||||
ImGui::PopStyleVar();
|
ImGui::Begin("DockSpace Demo", &p_open, window_flags);
|
||||||
ImGui::PopStyleVar(2);
|
ImGui::PopStyleVar();
|
||||||
|
ImGui::PopStyleVar(2);
|
||||||
|
|
||||||
ImGuiID dockspace_id = ImGui::GetID("DockSpace Demo");
|
ImGuiID dockspace_id = ImGui::GetID("DockSpace Demo");
|
||||||
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);
|
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(10, 10));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(10, 10));
|
||||||
if (ImGui::BeginMenuBar()) {
|
if (ImGui::BeginMenuBar()) {
|
||||||
if (ImGui::BeginMenu("Pannel")) {
|
if (ImGui::BeginMenu("Pannel")) {
|
||||||
onPannelMenuBar();
|
onPannelMenuBar();
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
TerrainEditor::onImGui();
|
TerrainEditor::onImGui();
|
||||||
viewport_onImGui();
|
viewport_onImGui();
|
||||||
EditorEngine::render();
|
EditorEngine::render();
|
||||||
|
|
||||||
Scene::gizmoRenderer.refresh();
|
Scene::gizmoRenderer.refresh();
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onEvent(Event& e) {
|
void onEvent(Event& e) {
|
||||||
//viewport_onEvent(e);
|
// viewport_onEvent(e);
|
||||||
|
|
||||||
EventDispatcher ed(e);
|
EventDispatcher ed(e);
|
||||||
|
|
||||||
ed.dispatch<WindowCloseEvent>(onWindowCloseEvent);
|
ed.dispatch<WindowCloseEvent>(onWindowCloseEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool onWindowCloseEvent(WindowCloseEvent&) {
|
bool onWindowCloseEvent(WindowCloseEvent&) {
|
||||||
Application::shutdown();
|
Application::shutdown();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace DeerStudio
|
||||||
} // namespace Deer
|
} // namespace Deer
|
@ -1,12 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "DeerStudio/EditorEngine/API/Asset.h"
|
||||||
#include "DeerStudio/EditorEngine/API/Debug.h"
|
#include "DeerStudio/EditorEngine/API/Debug.h"
|
||||||
#include "DeerStudio/EditorEngine/API/Entity.h"
|
#include "DeerStudio/EditorEngine/API/Entity.h"
|
||||||
#include "DeerStudio/EditorEngine/API/Layout.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/Menu.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/Resource.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/UI.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/Math.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/FrameBuffer.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API/Environment.h"
|
#include "DeerStudio/EditorEngine/API/Environment.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/FrameBuffer.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/Layout.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/Math.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/Menu.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/UI.h"
|
||||||
|
35
DeerStudio/src/DeerStudio/EditorEngine/API/Asset.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace Deer {
|
||||||
|
namespace EditorEngine {
|
||||||
|
enum AssetType : uint32_t {
|
||||||
|
NONE = 0,
|
||||||
|
MESH = 1,
|
||||||
|
SHADER = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the count of meshes in the dir relative to the mesh root dir
|
||||||
|
int getAssetCount(AssetType, std::string& dir);
|
||||||
|
// Returns the path to the mesh with id i
|
||||||
|
std::string getAssetNameById(AssetType, std::string& dir, int i);
|
||||||
|
// Returns the name of the mesh with id i
|
||||||
|
std::string getAssetTypePathById(AssetType, std::string& dir, int i);
|
||||||
|
|
||||||
|
// Returns the count of sub dirs in the dir relative to the mesh root
|
||||||
|
// dir
|
||||||
|
int getDirCount(AssetType, std::string&);
|
||||||
|
// Returns the path to the subDir in the dir relative to the mesh root
|
||||||
|
// dir
|
||||||
|
std::string getDirPathById(AssetType, std::string& dir, int i);
|
||||||
|
// Returns the name of the subDir in the dir relative to the mesh root
|
||||||
|
// dir
|
||||||
|
std::string getDirNameById(AssetType, std::string& dir, int i);
|
||||||
|
|
||||||
|
// INTERNAL
|
||||||
|
const char* getAssetTypePath(AssetType);
|
||||||
|
const char* getAssetTypeExtension(AssetType);
|
||||||
|
const char* getAssetTypeName(AssetType);
|
||||||
|
} // namespace EditorEngine
|
||||||
|
} // namespace Deer
|
@ -1,32 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace Deer {
|
|
||||||
namespace EditorEngine {
|
|
||||||
enum ResourceType : uint32_t {
|
|
||||||
NOTHING = 0,
|
|
||||||
MESH = 1,
|
|
||||||
SHADER = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Returns the count of meshes in the dir relative to the mesh root dir
|
|
||||||
int getResourceCount(ResourceType, std::string& dir);
|
|
||||||
// Returns the path to the mesh with id i
|
|
||||||
std::string getResourceNameById(ResourceType, std::string& dir, int i);
|
|
||||||
// Returns the name of the mesh with id i
|
|
||||||
std::string getResourcePathById(ResourceType, std::string& dir, int i);
|
|
||||||
|
|
||||||
// Returns the count of sub dirs in the dir relative to the mesh root dir
|
|
||||||
int getDirCount(ResourceType, std::string&);
|
|
||||||
// Returns the path to the subDir in the dir relative to the mesh root dir
|
|
||||||
std::string getDirPathById(ResourceType, std::string& dir, int i);
|
|
||||||
// Returns the name of the subDir in the dir relative to the mesh root dir
|
|
||||||
std::string getDirNameById(ResourceType, std::string& dir, int i);
|
|
||||||
|
|
||||||
// INTERNAL
|
|
||||||
const char* getResourcePath(ResourceType);
|
|
||||||
const char* getResourceExtension(ResourceType);
|
|
||||||
const char* getResourceName(ResourceType);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,204 +1,212 @@
|
|||||||
#include "DeerStudio/EditorEngine/API/Resource.h"
|
|
||||||
#include "DeerStudio/EditorEngine.h"
|
|
||||||
#include "Deer/DataStore.h"
|
#include "Deer/DataStore.h"
|
||||||
#include "DeerStudio/EditorEngine/DockPanel/DockPanelObject.h"
|
|
||||||
#include "Deer/Log.h"
|
#include "Deer/Log.h"
|
||||||
|
#include "DeerStudio/EditorEngine.h"
|
||||||
|
#include "DeerStudio/EditorEngine/API/Asset.h"
|
||||||
|
#include "DeerStudio/EditorEngine/DockPanel/DockPanelObject.h"
|
||||||
|
|
||||||
namespace Deer {
|
namespace Deer {
|
||||||
namespace EditorEngine {
|
namespace EditorEngine {
|
||||||
|
|
||||||
const char* getResourcePath(ResourceType resource) {
|
|
||||||
switch (resource)
|
|
||||||
{
|
|
||||||
case ResourceType::NOTHING:
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
case ResourceType::MESH :
|
|
||||||
return DEER_MESH_PATH;
|
|
||||||
|
|
||||||
case ResourceType::SHADER :
|
const char* getAssetTypePath(AssetType resource) {
|
||||||
return DEER_SHADER_PATH;
|
switch (resource) {
|
||||||
}
|
case AssetType::NONE:
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
return nullptr;
|
case AssetType::MESH:
|
||||||
}
|
return DEER_MESH_PATH;
|
||||||
|
|
||||||
const char* getResourceExtension(ResourceType resource) {
|
case AssetType::SHADER:
|
||||||
switch (resource)
|
return DEER_SHADER_PATH;
|
||||||
{
|
}
|
||||||
case ResourceType::NOTHING:
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
case ResourceType::MESH :
|
|
||||||
return DEER_MESH_EXTENSION;
|
|
||||||
|
|
||||||
case ResourceType::SHADER :
|
return nullptr;
|
||||||
return DEER_SHADER_EXTENSION;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
const char* getAssetTypeExtension(AssetType resource) {
|
||||||
}
|
switch (resource) {
|
||||||
|
case AssetType::NONE:
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
const char* getResourceName(ResourceType resource) {
|
case AssetType::MESH:
|
||||||
switch (resource)
|
return DEER_MESH_EXTENSION;
|
||||||
{
|
|
||||||
case ResourceType::NOTHING:
|
|
||||||
return "???";
|
|
||||||
|
|
||||||
case ResourceType::MESH :
|
|
||||||
return "Mesh";
|
|
||||||
|
|
||||||
case ResourceType::SHADER :
|
case AssetType::SHADER:
|
||||||
return "Shader";
|
return DEER_SHADER_EXTENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getResourceCount(ResourceType type, std::string& dir) {
|
const char* getAssetTypeName(AssetType resource) {
|
||||||
const char* resourcePath = getResourcePath(type);
|
switch (resource) {
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
case AssetType::NONE:
|
||||||
|
return "???";
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
case AssetType::MESH:
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getResourceCount(..)");
|
return "Mesh";
|
||||||
if (currentDockPanelExecution) {
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return DataStore::getDirData(resourcePath, dir, resourceExtension).elements.size();
|
case AssetType::SHADER:
|
||||||
}
|
return "Shader";
|
||||||
|
}
|
||||||
std::string getResourceNameById(ResourceType type, std::string& dir, int i) {
|
|
||||||
const char* resourcePath = getResourcePath(type);
|
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
return nullptr;
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getResourceNameById(..)");
|
}
|
||||||
if (currentDockPanelExecution) {
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const DirectoryData& dirData = DataStore::getDirData(resourcePath, dir, resourceExtension);
|
int getAssetCount(AssetType type, std::string& dir) {
|
||||||
if (i < 0 || i >= dirData.elements.size()) {
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid element id {3} calling getResourceNameById(..) for type {0} and path {1}, element count on that dir is {2}",
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
getResourceName(type),
|
|
||||||
dir.c_str(),
|
|
||||||
dirData.elements.size(),
|
|
||||||
i
|
|
||||||
);
|
|
||||||
|
|
||||||
if (currentDockPanelExecution)
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return dirData.elements[i].stem().string();
|
if (!resourcePath || !resourceExtension) {
|
||||||
}
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid resource type calling getAssetCount(..)");
|
||||||
|
if (currentDockPanelExecution) {
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::string getResourcePathById(ResourceType type, std::string& dir, int i) {
|
return DataStore::getDirData(resourcePath, dir, resourceExtension)
|
||||||
const char* resourcePath = getResourcePath(type);
|
.elements.size();
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
}
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
std::string getAssetNameById(AssetType type, std::string& dir, int i) {
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getResourcePathById(..)");
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
if (currentDockPanelExecution) {
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const DirectoryData& dirData = DataStore::getDirData(resourcePath, dir, resourceExtension);
|
if (!resourcePath || !resourceExtension) {
|
||||||
if (i < 0 || i >= dirData.elements.size()) {
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid element id {3} calling getResourcePathById(..) for type {0} and path {1}, element count on that dir is {2}",
|
"Invalid resource type calling getAssetNameById(..)");
|
||||||
getResourceName(type),
|
if (currentDockPanelExecution) {
|
||||||
dir.c_str(),
|
currentDockPanelExecution->invalidate();
|
||||||
dirData.elements.size(),
|
}
|
||||||
i
|
return "";
|
||||||
);
|
}
|
||||||
|
|
||||||
if (currentDockPanelExecution)
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return dirData.elements[i].string();
|
const DirectoryData& dirData =
|
||||||
}
|
DataStore::getDirData(resourcePath, dir, resourceExtension);
|
||||||
|
if (i < 0 || i >= dirData.elements.size()) {
|
||||||
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid element id {3} calling getAssetNameById(..) "
|
||||||
|
"for type {0} and path {1}, element count on that dir is "
|
||||||
|
"{2}",
|
||||||
|
getAssetTypeName(type), dir.c_str(),
|
||||||
|
dirData.elements.size(), i);
|
||||||
|
|
||||||
int getDirCount(ResourceType type, std::string& dir) {
|
if (currentDockPanelExecution)
|
||||||
const char* resourcePath = getResourcePath(type);
|
currentDockPanelExecution->invalidate();
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
return dirData.elements[i].stem().string();
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getDirCount(..)");
|
}
|
||||||
if (currentDockPanelExecution) {
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return DataStore::getDirData(resourcePath, dir, resourceExtension).dirs.size();
|
std::string getAssetTypePathById(AssetType type, std::string& dir,
|
||||||
}
|
int i) {
|
||||||
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
std::string getDirPathById(ResourceType type, std::string& dir, int i) {
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
const char* resourcePath = getResourcePath(type);
|
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
if (!resourcePath || !resourceExtension) {
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getDirPathById(..)");
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
if (currentDockPanelExecution) {
|
"Invalid resource type calling getAssetTypePathById(..)");
|
||||||
currentDockPanelExecution->invalidate();
|
if (currentDockPanelExecution) {
|
||||||
}
|
currentDockPanelExecution->invalidate();
|
||||||
return "";
|
}
|
||||||
}
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
const DirectoryData& dirData = DataStore::getDirData(resourcePath, dir, resourceExtension);
|
const DirectoryData& dirData =
|
||||||
if (i < 0 || i >= dirData.dirs.size()) {
|
DataStore::getDirData(resourcePath, dir, resourceExtension);
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid element id {3} calling getDirPathById(..) for type {0} and path {1}, sub_dir count on that dir is {2}",
|
if (i < 0 || i >= dirData.elements.size()) {
|
||||||
getResourceName(type),
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
dir.c_str(),
|
"Invalid element id {3} calling getAssetTypePathById(..) "
|
||||||
dirData.dirs.size(),
|
"for type {0} and path {1}, element count on that dir is "
|
||||||
i)
|
"{2}",
|
||||||
;
|
getAssetTypeName(type), dir.c_str(),
|
||||||
|
dirData.elements.size(), i);
|
||||||
if (currentDockPanelExecution)
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return dirData.dirs[i].string();
|
if (currentDockPanelExecution)
|
||||||
}
|
currentDockPanelExecution->invalidate();
|
||||||
|
return "";
|
||||||
std::string getDirNameById(ResourceType type, std::string& dir, int i) {
|
}
|
||||||
const char* resourcePath = getResourcePath(type);
|
|
||||||
const char* resourceExtension = getResourceExtension(type);
|
|
||||||
|
|
||||||
if (!resourcePath || !resourceExtension) {
|
return dirData.elements[i].string();
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid resource type calling getDirNameById(..)");
|
}
|
||||||
if (currentDockPanelExecution) {
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const DirectoryData& dirData = DataStore::getDirData(resourcePath, dir, resourceExtension);
|
int getDirCount(AssetType type, std::string& dir) {
|
||||||
if (i < 0 || i >= dirData.dirs.size()) {
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
DEER_EDITOR_ENGINE_ERROR("Invalid element id {3} calling getDirPathById(..) for type {0} and path {1}, sub_dir count on that dir is {2}",
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
getResourceName(type),
|
|
||||||
dir.c_str(),
|
|
||||||
dirData.dirs.size(),
|
|
||||||
i
|
|
||||||
);
|
|
||||||
|
|
||||||
if (currentDockPanelExecution)
|
|
||||||
currentDockPanelExecution->invalidate();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return dirData.dirs[i].stem().string();
|
if (!resourcePath || !resourceExtension) {
|
||||||
}
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
}
|
"Invalid resource type calling getDirCount(..)");
|
||||||
}
|
if (currentDockPanelExecution) {
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DataStore::getDirData(resourcePath, dir, resourceExtension)
|
||||||
|
.dirs.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getDirPathById(AssetType type, std::string& dir, int i) {
|
||||||
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
|
|
||||||
|
if (!resourcePath || !resourceExtension) {
|
||||||
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid resource type calling getDirPathById(..)");
|
||||||
|
if (currentDockPanelExecution) {
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const DirectoryData& dirData =
|
||||||
|
DataStore::getDirData(resourcePath, dir, resourceExtension);
|
||||||
|
if (i < 0 || i >= dirData.dirs.size()) {
|
||||||
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid element id {3} calling getDirPathById(..) for "
|
||||||
|
"type {0} and path {1}, sub_dir count on that dir is {2}",
|
||||||
|
getAssetTypeName(type), dir.c_str(), dirData.dirs.size(),
|
||||||
|
i);
|
||||||
|
|
||||||
|
if (currentDockPanelExecution)
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dirData.dirs[i].string();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getDirNameById(AssetType type, std::string& dir, int i) {
|
||||||
|
const char* resourcePath = getAssetTypePath(type);
|
||||||
|
const char* resourceExtension = getAssetTypeExtension(type);
|
||||||
|
|
||||||
|
if (!resourcePath || !resourceExtension) {
|
||||||
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid resource type calling getDirNameById(..)");
|
||||||
|
if (currentDockPanelExecution) {
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const DirectoryData& dirData =
|
||||||
|
DataStore::getDirData(resourcePath, dir, resourceExtension);
|
||||||
|
if (i < 0 || i >= dirData.dirs.size()) {
|
||||||
|
DEER_EDITOR_ENGINE_ERROR(
|
||||||
|
"Invalid element id {3} calling getDirPathById(..) for "
|
||||||
|
"type {0} and path {1}, sub_dir count on that dir is {2}",
|
||||||
|
getAssetTypeName(type), dir.c_str(), dirData.dirs.size(),
|
||||||
|
i);
|
||||||
|
|
||||||
|
if (currentDockPanelExecution)
|
||||||
|
currentDockPanelExecution->invalidate();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return dirData.dirs[i].stem().string();
|
||||||
|
}
|
||||||
|
} // namespace EditorEngine
|
||||||
|
} // namespace Deer
|
@ -1,51 +1,80 @@
|
|||||||
#include "DeerStudio/EditorEngine/API.h"
|
#include "DeerStudio/EditorEngine.h"
|
||||||
#include "DeerStudio/EditorEngine.h"
|
#include "DeerStudio/EditorEngine/API.h"
|
||||||
#include "DeerStudio/EditorEngine/ErrorHandle.h"
|
#include "DeerStudio/EditorEngine/API_Registration/API_Registration.h"
|
||||||
#include "DeerStudio/EditorEngine/API_Registration/API_Registration.h"
|
#include "DeerStudio/EditorEngine/ErrorHandle.h"
|
||||||
|
|
||||||
#include "angelscript.h"
|
#include "angelscript.h"
|
||||||
|
|
||||||
namespace Deer {
|
namespace Deer {
|
||||||
void EditorEngine::registerEditorEngineFunctions() {
|
void EditorEngine::registerEditorEngineFunctions() {
|
||||||
registerEntityFunctions();
|
registerEntityFunctions();
|
||||||
registerMathFunctions();
|
registerMathFunctions();
|
||||||
registerUIFunctions();
|
registerUIFunctions();
|
||||||
registerFrameBufferFunctions();
|
registerFrameBufferFunctions();
|
||||||
registerEnvironmentFunctions();
|
registerEnvironmentFunctions();
|
||||||
|
|
||||||
scriptEngine->SetDefaultNamespace("UI");
|
scriptEngine->SetDefaultNamespace("UI");
|
||||||
REGISTER_GLOBAL_FUNC("void setupAutomaticColumns(int)", setupAutomaticColumns);
|
REGISTER_GLOBAL_FUNC("void setupAutomaticColumns(int)",
|
||||||
REGISTER_GLOBAL_FUNC("void setupColumns(int)", setupColumns);
|
setupAutomaticColumns);
|
||||||
REGISTER_GLOBAL_FUNC("void endColumns()", endColumns);
|
REGISTER_GLOBAL_FUNC("void setupColumns(int)", setupColumns);
|
||||||
REGISTER_GLOBAL_FUNC("void nextColumn()", nextColumn);
|
REGISTER_GLOBAL_FUNC("void endColumns()", endColumns);
|
||||||
scriptEngine->SetDefaultNamespace("");
|
REGISTER_GLOBAL_FUNC("void nextColumn()", nextColumn);
|
||||||
|
scriptEngine->SetDefaultNamespace("");
|
||||||
|
|
||||||
scriptEngine->SetDefaultNamespace("Resource");
|
scriptEngine->SetDefaultNamespace("Assets");
|
||||||
REGISTER_GLOBAL_FUNC("int getResourceCount(ResourceType, const string& in)", getResourceCount);
|
REGISTER_GLOBAL_FUNC("int getAssetCount(AssetType, const string& in)",
|
||||||
REGISTER_GLOBAL_FUNC("string getResourceNameById(ResourceType, const string& in, int)", getResourceNameById);
|
getAssetCount);
|
||||||
REGISTER_GLOBAL_FUNC("string getResourcePathById(ResourceType, const string& in, int)", getResourcePathById);
|
REGISTER_GLOBAL_FUNC(
|
||||||
REGISTER_GLOBAL_FUNC("int getDirCount(ResourceType, const string& in)", getDirCount);
|
"string getAssetNameById(AssetType, const string& in, int)",
|
||||||
REGISTER_GLOBAL_FUNC("string getDirPathById(ResourceType, const string& in, int)", getDirPathById);
|
getAssetNameById);
|
||||||
REGISTER_GLOBAL_FUNC("string getDirNameById(ResourceType, const string& in, int)", getDirNameById);
|
REGISTER_GLOBAL_FUNC(
|
||||||
scriptEngine->SetDefaultNamespace("");
|
"string getAssetTypePathById(AssetType, const string& in, int)",
|
||||||
|
getAssetTypePathById);
|
||||||
|
REGISTER_GLOBAL_FUNC("int getDirCount(AssetType, const string& in)",
|
||||||
|
getDirCount);
|
||||||
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"string getDirPathById(AssetType, const string& in, int)",
|
||||||
|
getDirPathById);
|
||||||
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"string getDirNameById(AssetType, const string& in, int)",
|
||||||
|
getDirNameById);
|
||||||
|
scriptEngine->SetDefaultNamespace("");
|
||||||
|
|
||||||
scriptEngine->SetDefaultNamespace("Engine");
|
scriptEngine->SetDefaultNamespace("Engine");
|
||||||
REGISTER_GLOBAL_FUNC("void print(const string& in)", print);
|
REGISTER_GLOBAL_FUNC("void print(const string& in)", print);
|
||||||
scriptEngine->SetDefaultNamespace("");
|
scriptEngine->SetDefaultNamespace("");
|
||||||
|
|
||||||
scriptEngine->SetDefaultNamespace("UI");
|
scriptEngine->SetDefaultNamespace("UI");
|
||||||
REGISTER_GLOBAL_FUNC("void treeNodeLeaf(const string& in, bool)", treeNode);
|
REGISTER_GLOBAL_FUNC("void treeNodeLeaf(const string& in, bool)",
|
||||||
REGISTER_GLOBAL_FUNC("bool treeNode(const string& in, bool, any@+, ReciverFunc@+)", treeNodeRecursive);
|
treeNode);
|
||||||
REGISTER_GLOBAL_FUNC("bool componentNode(const string& in, any@+, ReciverFunc@+)", componentNode);
|
REGISTER_GLOBAL_FUNC(
|
||||||
REGISTER_GLOBAL_FUNC("bool componentNode_contextMenu(const string& in, any@+, ReciverFunc@+, ReciverFunc@+)", componentNode_contextMenu);
|
"bool treeNode(const string& in, bool, any@+, ReciverFunc@+)",
|
||||||
REGISTER_GLOBAL_FUNC("void contextItemPopup(const string& in, any@+, ReciverFunc@+)", contextItemPopup);
|
treeNodeRecursive);
|
||||||
REGISTER_GLOBAL_FUNC("void contextMenuPopup(const string& in, any@+, ReciverFunc@+)", contextMenuPopup);
|
REGISTER_GLOBAL_FUNC(
|
||||||
REGISTER_GLOBAL_FUNC("void modalPopup(const string& in, ReciverFunc@+)", modalPopup);
|
"bool componentNode(const string& in, any@+, ReciverFunc@+)",
|
||||||
REGISTER_GLOBAL_FUNC("void simplePopup(const string& in, ReciverFunc@+)", simplePopup);
|
componentNode);
|
||||||
REGISTER_GLOBAL_FUNC("void openPopup(const string& in, any@)", openPopup);
|
REGISTER_GLOBAL_FUNC("bool componentNode_contextMenu(const string& in, "
|
||||||
REGISTER_GLOBAL_FUNC("void closePopup()", closePopup);
|
"any@+, ReciverFunc@+, ReciverFunc@+)",
|
||||||
REGISTER_GLOBAL_FUNC("void dragDropSource(const string& in, any@, const string& in)", dragDropSource);
|
componentNode_contextMenu);
|
||||||
REGISTER_GLOBAL_FUNC("void dragDropTarget(const string& in, any@+, TransferFunc@+)", dragDropTarget);
|
REGISTER_GLOBAL_FUNC(
|
||||||
scriptEngine->SetDefaultNamespace("");
|
"void contextItemPopup(const string& in, any@+, ReciverFunc@+)",
|
||||||
}
|
contextItemPopup);
|
||||||
}
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"void contextMenuPopup(const string& in, any@+, ReciverFunc@+)",
|
||||||
|
contextMenuPopup);
|
||||||
|
REGISTER_GLOBAL_FUNC("void modalPopup(const string& in, ReciverFunc@+)",
|
||||||
|
modalPopup);
|
||||||
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"void simplePopup(const string& in, ReciverFunc@+)", simplePopup);
|
||||||
|
REGISTER_GLOBAL_FUNC("void openPopup(const string& in, any@)",
|
||||||
|
openPopup);
|
||||||
|
REGISTER_GLOBAL_FUNC("void closePopup()", closePopup);
|
||||||
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"void dragDropSource(const string& in, any@, const string& in)",
|
||||||
|
dragDropSource);
|
||||||
|
REGISTER_GLOBAL_FUNC(
|
||||||
|
"void dragDropTarget(const string& in, any@+, TransferFunc@+)",
|
||||||
|
dragDropTarget);
|
||||||
|
scriptEngine->SetDefaultNamespace("");
|
||||||
|
}
|
||||||
|
} // namespace Deer
|
@ -1,38 +1,44 @@
|
|||||||
#include "DeerStudio/EditorEngine.h"
|
#include "DeerStudio/EditorEngine.h"
|
||||||
#include "DeerStudio/EditorEngine/ErrorHandle.h"
|
|
||||||
#include "DeerStudio/EditorEngine/API.h"
|
#include "DeerStudio/EditorEngine/API.h"
|
||||||
|
#include "DeerStudio/EditorEngine/ErrorHandle.h"
|
||||||
|
|
||||||
#include "scripthandle.h"
|
|
||||||
#include "scriptany.h"
|
|
||||||
#include "angelscript.h"
|
#include "angelscript.h"
|
||||||
|
#include "scriptany.h"
|
||||||
|
#include "scripthandle.h"
|
||||||
|
|
||||||
namespace Deer {
|
namespace Deer {
|
||||||
namespace EditorEngine {
|
namespace EditorEngine {
|
||||||
void registerResourceTypeEnum() {
|
void registerAssetTypeEnum() {
|
||||||
AS_RET_CHECK(scriptEngine->RegisterEnum("ResourceType"));
|
AS_RET_CHECK(scriptEngine->RegisterEnum("AssetType"));
|
||||||
AS_CHECK(scriptEngine->RegisterEnumValue("ResourceType", "Mesh", (int)ResourceType::MESH));
|
AS_CHECK(scriptEngine->RegisterEnumValue("AssetType", "None",
|
||||||
AS_CHECK(scriptEngine->RegisterEnumValue("ResourceType", "Shader", (int)ResourceType::SHADER));
|
(int)AssetType::NONE));
|
||||||
}
|
AS_CHECK(scriptEngine->RegisterEnumValue("AssetType", "Shader",
|
||||||
|
(int)AssetType::SHADER));
|
||||||
|
AS_CHECK(scriptEngine->RegisterEnumValue("AssetType", "Mesh",
|
||||||
|
(int)AssetType::MESH));
|
||||||
|
}
|
||||||
|
|
||||||
void registerEditorEngineStructs() {
|
void registerEditorEngineStructs() {
|
||||||
RegisterScriptHandle(scriptEngine);
|
RegisterScriptHandle(scriptEngine);
|
||||||
RegisterScriptAny(scriptEngine);
|
RegisterScriptAny(scriptEngine);
|
||||||
|
|
||||||
AS_RET_CHECK(scriptEngine->RegisterInterface("DockPanel"));
|
AS_RET_CHECK(scriptEngine->RegisterInterface("DockPanel"));
|
||||||
AS_RET_CHECK(scriptEngine->RegisterInterfaceMethod("DockPanel", "void onRender()"));
|
AS_RET_CHECK(scriptEngine->RegisterInterfaceMethod(
|
||||||
|
"DockPanel", "void onRender()"));
|
||||||
|
|
||||||
AS_RET_CHECK(scriptEngine->RegisterInterface("ServiceScript"));
|
AS_RET_CHECK(scriptEngine->RegisterInterface("ServiceScript"));
|
||||||
|
|
||||||
AS_CHECK(scriptEngine->RegisterFuncdef("void ReciverFunc(any@)"));
|
AS_CHECK(scriptEngine->RegisterFuncdef("void ReciverFunc(any@)"));
|
||||||
AS_CHECK(scriptEngine->RegisterFuncdef("void TransferFunc(any@, any@)"));
|
AS_CHECK(
|
||||||
|
scriptEngine->RegisterFuncdef("void TransferFunc(any@, any@)"));
|
||||||
|
|
||||||
registerUIStructs();
|
registerUIStructs();
|
||||||
registerResourceTypeEnum();
|
registerAssetTypeEnum();
|
||||||
registerEntityStructs();
|
registerEntityStructs();
|
||||||
registerMathStructs();
|
registerMathStructs();
|
||||||
registerFrameBufferStructs();
|
registerFrameBufferStructs();
|
||||||
registerEnvironmentStructs();
|
registerEnvironmentStructs();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace EditorEngine
|
||||||
}
|
} // namespace Deer
|
@ -127,6 +127,7 @@ void printClassTypeList(const asIScriptEngine& engine) {
|
|||||||
for (int j = 0; j < t->GetMethodCount(); ++j) {
|
for (int j = 0; j < t->GetMethodCount(); ++j) {
|
||||||
const auto m = t->GetMethodByIndex(j);
|
const auto m = t->GetMethodByIndex(j);
|
||||||
stream << "\t" << m->GetDeclaration(false, false, true);
|
stream << "\t" << m->GetDeclaration(false, false, true);
|
||||||
|
|
||||||
if (m->IsProperty())
|
if (m->IsProperty())
|
||||||
stream << " property";
|
stream << " property";
|
||||||
stream << ";\n";
|
stream << ";\n";
|
||||||
|
@ -162,7 +162,11 @@ namespace Deer {
|
|||||||
asITypeInfo* paramType =
|
asITypeInfo* paramType =
|
||||||
scriptEngine->GetTypeInfoById(typeId);
|
scriptEngine->GetTypeInfoById(typeId);
|
||||||
|
|
||||||
ext_dec << paramType->GetName();
|
const char* typeName =
|
||||||
|
scriptEngine->GetTypeDeclaration(typeId, false);
|
||||||
|
|
||||||
|
ext_dec << typeName;
|
||||||
|
|
||||||
if (name != nullptr)
|
if (name != nullptr)
|
||||||
ext_dec << " " << name;
|
ext_dec << " " << name;
|
||||||
}
|
}
|
||||||
@ -178,9 +182,11 @@ namespace Deer {
|
|||||||
serviceScriptFunction->scriptContext = scriptContext;
|
serviceScriptFunction->scriptContext = scriptContext;
|
||||||
serviceScriptFunction->scriptObject = object;
|
serviceScriptFunction->scriptObject = object;
|
||||||
|
|
||||||
AS_CHECK(scriptEngine->RegisterGlobalFunction(
|
AS_CHECK_ADDITIONAL_INFO(
|
||||||
ext_dec.str().c_str(), asFUNCTION(apiFunction),
|
scriptEngine->RegisterGlobalFunction(
|
||||||
asCALL_GENERIC, serviceScriptFunction));
|
ext_dec.str().c_str(), asFUNCTION(apiFunction),
|
||||||
|
asCALL_GENERIC, serviceScriptFunction),
|
||||||
|
ext_dec.str().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace EditorEngine
|
} // namespace EditorEngine
|
||||||
|
3011
roe/3dMesh.dmesh
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 575 B |
Before Width: | Height: | Size: 588 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@ -1,13 +0,0 @@
|
|||||||
void renameEntity(any@ data) {
|
|
||||||
Entity entity;
|
|
||||||
data.retrieve(entity);
|
|
||||||
|
|
||||||
string name = entity.name;
|
|
||||||
if (UI::inputText("##RENAME", name, name)) {
|
|
||||||
entity.name = name;
|
|
||||||
}
|
|
||||||
UI::sameline();
|
|
||||||
if (UI::button("Accept")) {
|
|
||||||
UI::closePopup();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
class Test : DockPanel {
|
|
||||||
void onRender() {
|
|
||||||
Entity ent = ActiveEntity::getActiveEntity();
|
|
||||||
|
|
||||||
UI::text("Hi");
|
|
||||||
UI::text(ent.name);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"dockPanelModule" : {
|
|
||||||
"name" : "Test",
|
|
||||||
"author" : "Chewico",
|
|
||||||
"version" : "1.0.0",
|
|
||||||
"services" : []
|
|
||||||
}
|
|
||||||
}
|
|
12
roe/Editor/Panels/AssetExplorer/AssetExplorer.as
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class AssetExplorer : DockPanel {
|
||||||
|
AssetType searchAssetType = AssetType::None;
|
||||||
|
string currentPath = "";
|
||||||
|
|
||||||
|
void onRender() {
|
||||||
|
UI::setupAutomaticColumns(128);
|
||||||
|
|
||||||
|
if (searchAssetType == AssetType::None) {
|
||||||
|
searchAssetType = renderGenerics();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
roe/Editor/Panels/AssetExplorer/Generics.as
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Here we render the base folders
|
||||||
|
AssetType renderGenerics() {
|
||||||
|
AssetType selectedAssetType = AssetType::None;
|
||||||
|
|
||||||
|
if (drawFolder("Scripts")) selectedAssetType = AssetType::None;
|
||||||
|
if (drawFolder("Meshes")) selectedAssetType = AssetType::Mesh;
|
||||||
|
if (drawFolder("Textures")) selectedAssetType = AssetType::None;
|
||||||
|
if (drawFolder("Shaders")) selectedAssetType = AssetType::Shader;
|
||||||
|
|
||||||
|
return selectedAssetType;
|
||||||
|
}
|
12
roe/Editor/Panels/AssetExplorer/IconRender.as
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
bool drawFolder(string&in name) {
|
||||||
|
bool click = false;
|
||||||
|
UI::drawIconCentered("folder", 64);
|
||||||
|
|
||||||
|
if (UI::isItemClicked(0) and UI::isMouseDoubleClicked(0)) {
|
||||||
|
click = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
UI::textCenter(name);
|
||||||
|
UI::nextColumn();
|
||||||
|
return click;
|
||||||
|
}
|
@ -16,28 +16,28 @@ class MeshExplorer : DockPanel {
|
|||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceType resourceType = ResourceType::Mesh;
|
AssetType resourceType = AssetType::Mesh;
|
||||||
int dirCount = Resource::getDirCount(resourceType, cache_currentPath);
|
int dirCount = Assets::getDirCount(resourceType, cache_currentPath);
|
||||||
for (int i = 0; i < dirCount; i++) {
|
for (int i = 0; i < dirCount; i++) {
|
||||||
UI::drawIconCentered("folder", 64);
|
UI::drawIconCentered("folder", 64);
|
||||||
|
|
||||||
if (UI::isItemClicked(0) and UI::isMouseDoubleClicked(0)) {
|
if (UI::isItemClicked(0) and UI::isMouseDoubleClicked(0)) {
|
||||||
Engine::print(Resource::getDirPathById(ResourceType::Mesh, cache_currentPath, i));
|
Engine::print(Assets::getDirPathById(AssetType::Mesh, cache_currentPath, i));
|
||||||
currentPath = Resource::getDirPathById(ResourceType::Mesh, cache_currentPath, i);
|
currentPath = Assets::getDirPathById(AssetType::Mesh, cache_currentPath, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
UI::textCenter(Resource::getDirNameById(ResourceType::Mesh, cache_currentPath, i));
|
UI::textCenter(Assets::getDirNameById(AssetType::Mesh, cache_currentPath, i));
|
||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
int meshCount = Resource::getResourceCount(ResourceType::Mesh, cache_currentPath);
|
int meshCount = Assets::getAssetCount(AssetType::Mesh, cache_currentPath);
|
||||||
for (int i = 0; i < meshCount; i++) {
|
for (int i = 0; i < meshCount; i++) {
|
||||||
UI::drawIconCentered("file", 64);
|
UI::drawIconCentered("file", 64);
|
||||||
UI::dragDropSource("MESH",
|
UI::dragDropSource("MESH",
|
||||||
any(Resource::getResourcePathById(ResourceType::Mesh, cache_currentPath, i)),
|
any(Assets::getAssetTypePathById(AssetType::Mesh, cache_currentPath, i)),
|
||||||
Resource::getResourcePathById(ResourceType::Mesh, cache_currentPath, i));
|
Assets::getAssetTypePathById(AssetType::Mesh, cache_currentPath, i));
|
||||||
|
|
||||||
UI::textCenter(Resource::getResourceNameById(ResourceType::Mesh, cache_currentPath, i));
|
UI::textCenter(Assets::getAssetNameById(AssetType::Mesh, cache_currentPath, i));
|
||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
UI::endColumns();
|
UI::endColumns();
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
class ShaderExplorer : DockPanel {
|
class ShaderExplorer : DockPanel {
|
||||||
string currentPath = "";
|
string currentPath = "";
|
||||||
|
|
||||||
@ -16,31 +15,30 @@ class ShaderExplorer : DockPanel {
|
|||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceType resourceType = ResourceType::Shader;
|
AssetType resourceType = AssetType::Shader;
|
||||||
int dirCount = Resource::getDirCount(resourceType, cache_currentPath);
|
int dirCount = Assets::getDirCount(resourceType, cache_currentPath);
|
||||||
for (int i = 0; i < dirCount; i++) {
|
for (int i = 0; i < dirCount; i++) {
|
||||||
UI::drawIconCentered("folder", 64);
|
UI::drawIconCentered("folder", 64);
|
||||||
|
|
||||||
if (UI::isItemClicked(0) and UI::isMouseDoubleClicked(0)) {
|
if (UI::isItemClicked(0) and UI::isMouseDoubleClicked(0)) {
|
||||||
Engine::print(Resource::getDirPathById(resourceType, cache_currentPath, i));
|
Engine::print(Assets::getDirPathById(resourceType, cache_currentPath, i));
|
||||||
currentPath = Resource::getDirPathById(resourceType, cache_currentPath, i);
|
currentPath = Assets::getDirPathById(resourceType, cache_currentPath, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
UI::textCenter(Resource::getDirNameById(resourceType, cache_currentPath, i));
|
UI::textCenter(Assets::getDirNameById(resourceType, cache_currentPath, i));
|
||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
int meshCount = Resource::getResourceCount(resourceType, cache_currentPath);
|
int meshCount = Assets::getAssetCount(resourceType, cache_currentPath);
|
||||||
for (int i = 0; i < meshCount; i++) {
|
for (int i = 0; i < meshCount; i++) {
|
||||||
UI::drawIconCentered("file", 64);
|
UI::drawIconCentered("file", 64);
|
||||||
UI::dragDropSource("SHADER",
|
UI::dragDropSource("SHADER",
|
||||||
any(Resource::getResourcePathById(resourceType, cache_currentPath, i)),
|
any(Assets::getAssetTypePathById(resourceType, cache_currentPath, i)),
|
||||||
Resource::getResourcePathById(resourceType, cache_currentPath, i));
|
Assets::getAssetTypePathById(resourceType, cache_currentPath, i));
|
||||||
|
|
||||||
|
UI::textCenter(Assets::getAssetNameById(resourceType, cache_currentPath, i));
|
||||||
UI::textCenter(Resource::getResourceNameById(resourceType, cache_currentPath, i));
|
|
||||||
UI::nextColumn();
|
UI::nextColumn();
|
||||||
}
|
}
|
||||||
UI::endColumns();
|
UI::endColumns();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -65,9 +65,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -381,12 +382,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -467,9 +468,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -783,12 +785,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -804,3 +806,4 @@ namespace UI { void dragDropSource(const string&in, any@, const string&in); }
|
|||||||
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
||||||
namespace ActiveEntity { Entity getActiveEntity(); }
|
namespace ActiveEntity { Entity getActiveEntity(); }
|
||||||
namespace ActiveEntity { void setActiveEntity(Entity); }
|
namespace ActiveEntity { void setActiveEntity(Entity); }
|
||||||
|
namespace ActiveEntity { void renameEntity(any@); }
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dockPanelModule" : {
|
"dockPanelModule" : {
|
||||||
"name" : "Explorers",
|
"name" : "Asset Explorer",
|
||||||
"author" : "Chewico",
|
"author" : "Chewico",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"services" : []
|
"services" : []
|
@ -6,9 +6,6 @@ class PropertiesPannel : DockPanel {
|
|||||||
void onRender() {
|
void onRender() {
|
||||||
Entity entity = ActiveEntity::getActiveEntity();
|
Entity entity = ActiveEntity::getActiveEntity();
|
||||||
|
|
||||||
// We don't want to change root options
|
|
||||||
if (entity.isRoot)
|
|
||||||
return;
|
|
||||||
// NAME
|
// NAME
|
||||||
// -------
|
// -------
|
||||||
// Id:0 [+ add component]
|
// Id:0 [+ add component]
|
||||||
@ -18,6 +15,10 @@ class PropertiesPannel : DockPanel {
|
|||||||
UI::separator();
|
UI::separator();
|
||||||
UI::textColor(0.5, 0.5, 0.5f, "Id : " + entity.id);
|
UI::textColor(0.5, 0.5, 0.5f, "Id : " + entity.id);
|
||||||
|
|
||||||
|
// We don't want to change root options
|
||||||
|
if (entity.isRoot)
|
||||||
|
return;
|
||||||
|
|
||||||
UI::sameline();
|
UI::sameline();
|
||||||
if (UI::buttonEnd("Add Component")) {
|
if (UI::buttonEnd("Add Component")) {
|
||||||
UI::openPopup("ADD_COMPONENT", any(entity));
|
UI::openPopup("ADD_COMPONENT", any(entity));
|
||||||
@ -48,7 +49,7 @@ class PropertiesPannel : DockPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UI::simplePopup("ADD_COMPONENT", addComponentPopup);
|
UI::simplePopup("ADD_COMPONENT", addComponentPopup);
|
||||||
UI::modalPopup("Rename entity", renameEntity);
|
UI::modalPopup("Rename entity", ActiveEntity::renameEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void renameEntityMenu(any@ data) {
|
void renameEntityMenu(any@ data) {
|
@ -65,9 +65,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -381,12 +382,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -467,9 +468,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -783,12 +785,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -804,3 +806,4 @@ namespace UI { void dragDropSource(const string&in, any@, const string&in); }
|
|||||||
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
||||||
namespace ActiveEntity { Entity getActiveEntity(); }
|
namespace ActiveEntity { Entity getActiveEntity(); }
|
||||||
namespace ActiveEntity { void setActiveEntity(Entity); }
|
namespace ActiveEntity { void setActiveEntity(Entity); }
|
||||||
|
namespace ActiveEntity { void renameEntity(any@); }
|
@ -3,17 +3,25 @@ class TreePannel : DockPanel {
|
|||||||
Entity root = Engine::getRoot();
|
Entity root = Engine::getRoot();
|
||||||
UI::contextMenuPopup("Window popup", any(root), ReciverFunc(this.entityContextMenu));
|
UI::contextMenuPopup("Window popup", any(root), ReciverFunc(this.entityContextMenu));
|
||||||
|
|
||||||
renderNode(any(root));
|
if (root.childs.count == 0) {
|
||||||
|
// END OF THE TREE
|
||||||
|
UI::treeNodeLeaf("Scene Environment", false);
|
||||||
|
entityInteraction(root);
|
||||||
|
} else {
|
||||||
|
// ADD ANOTHER NODE
|
||||||
|
bool opened = UI::treeNode("Scene Environment", false, any(root), ReciverFunc(this.renderNode));
|
||||||
|
if (!opened) {
|
||||||
|
entityInteraction(root);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UI::modalPopup("Rename entity", renameEntity);
|
UI::modalPopup("Rename entity", ActiveEntity::renameEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void renderNode(any@ data) {
|
void renderNode(any@ data) {
|
||||||
Entity entity;
|
Entity entity;
|
||||||
data.retrieve(entity);
|
data.retrieve(entity);
|
||||||
|
entityInteraction(entity);
|
||||||
if (!entity.isRoot)
|
|
||||||
entityInteraction(entity);
|
|
||||||
|
|
||||||
// Maybe we deleted the entity in the context menu
|
// Maybe we deleted the entity in the context menu
|
||||||
if (!entity.exists)
|
if (!entity.exists)
|
@ -65,9 +65,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -381,12 +382,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -467,9 +468,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -783,12 +785,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -804,3 +806,4 @@ namespace UI { void dragDropSource(const string&in, any@, const string&in); }
|
|||||||
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
||||||
namespace ActiveEntity { Entity getActiveEntity(); }
|
namespace ActiveEntity { Entity getActiveEntity(); }
|
||||||
namespace ActiveEntity { void setActiveEntity(Entity); }
|
namespace ActiveEntity { void setActiveEntity(Entity); }
|
||||||
|
namespace ActiveEntity { void renameEntity(any@); }
|
13
roe/Editor/Panels/TreeExplorer/dockPanelModule.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"dockPanelModule" : {
|
||||||
|
"name" : "Tree explorer",
|
||||||
|
"author" : "Chewico",
|
||||||
|
"version" : "1.0.0",
|
||||||
|
"services" : [
|
||||||
|
{
|
||||||
|
"name" : "ActiveEntity",
|
||||||
|
"version" : "1.0.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -65,9 +65,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -381,12 +382,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -467,9 +468,10 @@ enum key {
|
|||||||
MouseRight = 642,
|
MouseRight = 642,
|
||||||
MouseMiddle = 643
|
MouseMiddle = 643
|
||||||
}
|
}
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
None = 0,
|
||||||
Shader = 2
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
}
|
}
|
||||||
class string {
|
class string {
|
||||||
~string();
|
~string();
|
||||||
@ -783,12 +785,12 @@ namespace UI { void setupAutomaticColumns(int); }
|
|||||||
namespace UI { void setupColumns(int); }
|
namespace UI { void setupColumns(int); }
|
||||||
namespace UI { void endColumns(); }
|
namespace UI { void endColumns(); }
|
||||||
namespace UI { void nextColumn(); }
|
namespace UI { void nextColumn(); }
|
||||||
namespace Resource { int getResourceCount(ResourceType, const string&in); }
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getResourceNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getResourcePathById(ResourceType, const string&in, int); }
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { int getDirCount(ResourceType, const string&in); }
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
namespace Resource { string getDirPathById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
namespace Resource { string getDirNameById(ResourceType, const string&in, int); }
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
namespace Engine { void print(const string&in); }
|
namespace Engine { void print(const string&in); }
|
||||||
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
@ -804,3 +806,4 @@ namespace UI { void dragDropSource(const string&in, any@, const string&in); }
|
|||||||
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
||||||
namespace ActiveEntity { Entity getActiveEntity(); }
|
namespace ActiveEntity { Entity getActiveEntity(); }
|
||||||
namespace ActiveEntity { void setActiveEntity(Entity); }
|
namespace ActiveEntity { void setActiveEntity(Entity); }
|
||||||
|
namespace ActiveEntity { void renameEntity(any@); }
|
@ -1,17 +0,0 @@
|
|||||||
class ActiveEntity : ServiceScript {
|
|
||||||
Entity entity;
|
|
||||||
|
|
||||||
void onInit() {
|
|
||||||
entity = Engine::getMainEnvironment().getRootEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
[ServiceAPI]
|
|
||||||
Entity getActiveEntity() {
|
|
||||||
return entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
[ServiceAPI]
|
|
||||||
void setActiveEntity(Entity ent) {
|
|
||||||
entity = ent;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,542 +0,0 @@
|
|||||||
//This file was generated automatically
|
|
||||||
funcdef void ReciverFunc(any@);
|
|
||||||
funcdef void TransferFunc(any@, any@);
|
|
||||||
enum key {
|
|
||||||
A = 546,
|
|
||||||
B = 547,
|
|
||||||
C = 548,
|
|
||||||
D = 549,
|
|
||||||
E = 550,
|
|
||||||
F = 551,
|
|
||||||
G = 552,
|
|
||||||
H = 553,
|
|
||||||
I = 554,
|
|
||||||
J = 555,
|
|
||||||
K = 556,
|
|
||||||
L = 557,
|
|
||||||
M = 558,
|
|
||||||
N = 559,
|
|
||||||
O = 560,
|
|
||||||
P = 561,
|
|
||||||
Q = 562,
|
|
||||||
R = 563,
|
|
||||||
S = 564,
|
|
||||||
T = 565,
|
|
||||||
U = 566,
|
|
||||||
V = 567,
|
|
||||||
W = 568,
|
|
||||||
X = 569,
|
|
||||||
Y = 570,
|
|
||||||
Z = 571,
|
|
||||||
K0 = 536,
|
|
||||||
K1 = 537,
|
|
||||||
K2 = 538,
|
|
||||||
K3 = 539,
|
|
||||||
K4 = 540,
|
|
||||||
K5 = 541,
|
|
||||||
K6 = 542,
|
|
||||||
K7 = 543,
|
|
||||||
K8 = 544,
|
|
||||||
K9 = 545,
|
|
||||||
Tab = 512,
|
|
||||||
Enter = 525,
|
|
||||||
Escape = 526,
|
|
||||||
Backspace = 523,
|
|
||||||
Space = 524,
|
|
||||||
Delete = 522,
|
|
||||||
Insert = 521,
|
|
||||||
Home = 519,
|
|
||||||
End = 520,
|
|
||||||
PageUp = 517,
|
|
||||||
PageDown = 518,
|
|
||||||
Right = 514,
|
|
||||||
Up = 515,
|
|
||||||
Down = 516,
|
|
||||||
Left = 513,
|
|
||||||
RightCtrl = 531,
|
|
||||||
LeftShift = 528,
|
|
||||||
RightShift = 532,
|
|
||||||
LeftAlt = 529,
|
|
||||||
RightAlt = 533,
|
|
||||||
LeftSuper = 530,
|
|
||||||
RightSuper = 534,
|
|
||||||
LeftCtrl = 527,
|
|
||||||
MouseLeft = 641,
|
|
||||||
MouseRight = 642,
|
|
||||||
MouseMiddle = 643
|
|
||||||
}
|
|
||||||
enum ResourceType {
|
|
||||||
Mesh = 1,
|
|
||||||
Shader = 2
|
|
||||||
}
|
|
||||||
class string {
|
|
||||||
~string();
|
|
||||||
string();
|
|
||||||
string(const string&in);
|
|
||||||
string& opAssign(const string&in);
|
|
||||||
string& opAddAssign(const string&in);
|
|
||||||
bool opEquals(const string&in) const;
|
|
||||||
int opCmp(const string&in) const;
|
|
||||||
string opAdd(const string&in) const;
|
|
||||||
uint length() const;
|
|
||||||
void resize(uint);
|
|
||||||
bool isEmpty() const;
|
|
||||||
uint8& opIndex(uint);
|
|
||||||
const uint8& opIndex(uint) const;
|
|
||||||
string& opAssign(double);
|
|
||||||
string& opAddAssign(double);
|
|
||||||
string opAdd(double) const;
|
|
||||||
string opAdd_r(double) const;
|
|
||||||
string& opAssign(float);
|
|
||||||
string& opAddAssign(float);
|
|
||||||
string opAdd(float) const;
|
|
||||||
string opAdd_r(float) const;
|
|
||||||
string& opAssign(int64);
|
|
||||||
string& opAddAssign(int64);
|
|
||||||
string opAdd(int64) const;
|
|
||||||
string opAdd_r(int64) const;
|
|
||||||
string& opAssign(uint64);
|
|
||||||
string& opAddAssign(uint64);
|
|
||||||
string opAdd(uint64) const;
|
|
||||||
string opAdd_r(uint64) const;
|
|
||||||
string& opAssign(bool);
|
|
||||||
string& opAddAssign(bool);
|
|
||||||
string opAdd(bool) const;
|
|
||||||
string opAdd_r(bool) const;
|
|
||||||
string substr(uint start = 0, int count = -1) const;
|
|
||||||
int findFirst(const string&in, uint start = 0) const;
|
|
||||||
int findFirstOf(const string&in, uint start = 0) const;
|
|
||||||
int findFirstNotOf(const string&in, uint start = 0) const;
|
|
||||||
int findLast(const string&in, int start = -1) const;
|
|
||||||
int findLastOf(const string&in, int start = -1) const;
|
|
||||||
int findLastNotOf(const string&in, int start = -1) const;
|
|
||||||
void insert(uint pos, const string&in other);
|
|
||||||
void erase(uint pos, int count = -1);
|
|
||||||
}
|
|
||||||
class array<T> {
|
|
||||||
funcdef bool less(const T&in a, const T&in b);
|
|
||||||
T[]@ array(int&in);
|
|
||||||
T[]@ array(int&in, uint length);
|
|
||||||
T[]@ array(int&in, uint length, const T&in value);
|
|
||||||
T& opIndex(uint index);
|
|
||||||
const T& opIndex(uint index) const;
|
|
||||||
T[]& opAssign(const T[]&in);
|
|
||||||
void insertAt(uint index, const T&in value);
|
|
||||||
void insertAt(uint index, const T[]&inout arr);
|
|
||||||
void insertLast(const T&in value);
|
|
||||||
void removeAt(uint index);
|
|
||||||
void removeLast();
|
|
||||||
void removeRange(uint start, uint count);
|
|
||||||
uint length() const;
|
|
||||||
void reserve(uint length);
|
|
||||||
void resize(uint length);
|
|
||||||
void sortAsc();
|
|
||||||
void sortAsc(uint startAt, uint count);
|
|
||||||
void sortDesc();
|
|
||||||
void sortDesc(uint startAt, uint count);
|
|
||||||
void reverse();
|
|
||||||
int find(const T&in value) const;
|
|
||||||
int find(uint startAt, const T&in value) const;
|
|
||||||
int findByRef(const T&in value) const;
|
|
||||||
int findByRef(uint startAt, const T&in value) const;
|
|
||||||
bool opEquals(const T[]&in) const;
|
|
||||||
bool isEmpty() const;
|
|
||||||
void sort(T[]::less&in, uint startAt = 0, uint count = uint ( - 1 ));
|
|
||||||
funcdef bool less(const T&in, const T&in);
|
|
||||||
}
|
|
||||||
class dictionaryValue {
|
|
||||||
~dictionaryValue();
|
|
||||||
dictionaryValue();
|
|
||||||
dictionaryValue& opAssign(const dictionaryValue&in);
|
|
||||||
dictionaryValue& opHndlAssign(const ?&in);
|
|
||||||
dictionaryValue& opHndlAssign(const dictionaryValue&in);
|
|
||||||
dictionaryValue& opAssign(const ?&in);
|
|
||||||
dictionaryValue& opAssign(double);
|
|
||||||
dictionaryValue& opAssign(int64);
|
|
||||||
void opCast(?&out);
|
|
||||||
void opConv(?&out);
|
|
||||||
int64 opConv();
|
|
||||||
double opConv();
|
|
||||||
}
|
|
||||||
class dictionary {
|
|
||||||
dictionary@ dictionary();
|
|
||||||
dictionary& opAssign(const dictionary&in);
|
|
||||||
void set(const string&in, const ?&in);
|
|
||||||
bool get(const string&in, ?&out) const;
|
|
||||||
void set(const string&in, const int64&in);
|
|
||||||
bool get(const string&in, int64&out) const;
|
|
||||||
void set(const string&in, const double&in);
|
|
||||||
bool get(const string&in, double&out) const;
|
|
||||||
bool exists(const string&in) const;
|
|
||||||
bool isEmpty() const;
|
|
||||||
uint getSize() const;
|
|
||||||
bool delete(const string&in);
|
|
||||||
void deleteAll();
|
|
||||||
string[]@ getKeys() const;
|
|
||||||
dictionaryValue& opIndex(const string&in);
|
|
||||||
const dictionaryValue& opIndex(const string&in) const;
|
|
||||||
}
|
|
||||||
class ref {
|
|
||||||
~ref();
|
|
||||||
ref();
|
|
||||||
ref(const ref&in);
|
|
||||||
ref(const ?&in);
|
|
||||||
void opCast(?&out);
|
|
||||||
ref& opHndlAssign(const ref&in);
|
|
||||||
ref& opHndlAssign(const ?&in);
|
|
||||||
bool opEquals(const ref&in) const;
|
|
||||||
bool opEquals(const ?&in) const;
|
|
||||||
}
|
|
||||||
class any {
|
|
||||||
any@ any();
|
|
||||||
any@ any(?&in);
|
|
||||||
any@ any(const int64&in);
|
|
||||||
any@ any(const double&in);
|
|
||||||
any& opAssign(any&in);
|
|
||||||
void store(?&in);
|
|
||||||
void store(const int64&in);
|
|
||||||
void store(const double&in);
|
|
||||||
bool retrieve(?&out);
|
|
||||||
bool retrieve(int64&out);
|
|
||||||
bool retrieve(double&out);
|
|
||||||
}
|
|
||||||
class DockPanel {
|
|
||||||
void onRender();
|
|
||||||
}
|
|
||||||
class ServiceScript {
|
|
||||||
}
|
|
||||||
class Entity {
|
|
||||||
string get_name() const property;
|
|
||||||
void set_name(string&in) property;
|
|
||||||
int get_id() const property;
|
|
||||||
Entity createChild(const string&in);
|
|
||||||
bool get_isRoot() const property;
|
|
||||||
void destroy();
|
|
||||||
bool get_exists() const property;
|
|
||||||
Entity get_parent() property;
|
|
||||||
void set_parent(Entity) property;
|
|
||||||
bool isDescendantOf(Entity);
|
|
||||||
bool opEquals(const Entity&in) const;
|
|
||||||
EntityChilds get_childs() const property;
|
|
||||||
TransformComponent get_transform() const property;
|
|
||||||
MeshComponent getMeshComponent();
|
|
||||||
MeshComponent createMeshComponent();
|
|
||||||
bool hasMeshComponent();
|
|
||||||
void removeMeshComponent();
|
|
||||||
ShaderComponent getShaderComponent();
|
|
||||||
ShaderComponent createShaderComponent();
|
|
||||||
bool hasShaderComponent();
|
|
||||||
void removeShaderComponent();
|
|
||||||
CameraComponent getCameraComponent();
|
|
||||||
CameraComponent createCameraComponent();
|
|
||||||
bool hasCameraComponent();
|
|
||||||
void removeCameraComponent();
|
|
||||||
}
|
|
||||||
class EntityChilds {
|
|
||||||
int get_count() const property;
|
|
||||||
Entity opIndex(int) const;
|
|
||||||
}
|
|
||||||
class TransformComponent {
|
|
||||||
vec3 get_position() const property;
|
|
||||||
vec3 get_scale() const property;
|
|
||||||
vec3 get_rotation() const property;
|
|
||||||
void set_position(const vec3) property;
|
|
||||||
void set_scale(const vec3) property;
|
|
||||||
void set_rotation(const vec3) property;
|
|
||||||
}
|
|
||||||
class MeshComponent {
|
|
||||||
bool get_isActive() const property;
|
|
||||||
bool get_hasMesh() const property;
|
|
||||||
void clear();
|
|
||||||
string getMesh();
|
|
||||||
void setMesh(string&in);
|
|
||||||
void set_isActive(const bool) property;
|
|
||||||
}
|
|
||||||
class ShaderComponent {
|
|
||||||
bool get_hasShader() const property;
|
|
||||||
void clear();
|
|
||||||
string getShader();
|
|
||||||
void setShader(const string&in);
|
|
||||||
}
|
|
||||||
class CameraComponent {
|
|
||||||
float get_fov() const property;
|
|
||||||
float get_aspectRatio() const property;
|
|
||||||
float get_nearZ() const property;
|
|
||||||
float get_farZ() const property;
|
|
||||||
void set_fov(float) property;
|
|
||||||
void set_aspectRatio(float) property;
|
|
||||||
void set_nearZ(float) property;
|
|
||||||
void set_farZ(float) property;
|
|
||||||
}
|
|
||||||
class vec3 {
|
|
||||||
vec3();
|
|
||||||
vec3(float, float = 0, float = 0);
|
|
||||||
vec3 opAdd(const vec3&in);
|
|
||||||
vec3 opSub(const vec3&in) const;
|
|
||||||
vec3 opNeg() const;
|
|
||||||
vec3 opMul(float) const;
|
|
||||||
vec3 opMul_r(float) const;
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
}
|
|
||||||
class quat {
|
|
||||||
~quat();
|
|
||||||
quat();
|
|
||||||
quat(float, float, float, float);
|
|
||||||
quat opMul(const quat&in) const;
|
|
||||||
vec3 getEuler() const;
|
|
||||||
void setEuler(vec3);
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
float w;
|
|
||||||
}
|
|
||||||
class Transform {
|
|
||||||
Transform();
|
|
||||||
vec3 relative(vec3);
|
|
||||||
vec3 position;
|
|
||||||
vec3 scale;
|
|
||||||
quat rotation;
|
|
||||||
}
|
|
||||||
class Camera {
|
|
||||||
Camera();
|
|
||||||
float fov;
|
|
||||||
float aspect;
|
|
||||||
float nearZ;
|
|
||||||
float farZ;
|
|
||||||
}
|
|
||||||
class SceneCamera {
|
|
||||||
SceneCamera();
|
|
||||||
Camera camera;
|
|
||||||
Transform transform;
|
|
||||||
}
|
|
||||||
class FrameBuffer {
|
|
||||||
FrameBuffer();
|
|
||||||
void clearRGBA(int, int, int, int);
|
|
||||||
int get_height() const property;
|
|
||||||
void resize(int, int);
|
|
||||||
string get_name() const property;
|
|
||||||
bool isValid();
|
|
||||||
}
|
|
||||||
class Environment {
|
|
||||||
void render(FrameBuffer, SceneCamera&in);
|
|
||||||
Entity getRootEntity();
|
|
||||||
Entity getEntity(int);
|
|
||||||
}
|
|
||||||
string formatInt(int64 val, const string&in options = "", uint width = 0);
|
|
||||||
string formatUInt(uint64 val, const string&in options = "", uint width = 0);
|
|
||||||
string formatFloat(double val, const string&in options = "", uint width = 0, uint precision = 0);
|
|
||||||
int64 parseInt(const string&in, uint base = 10, uint&out byteCount = 0);
|
|
||||||
uint64 parseUInt(const string&in, uint base = 10, uint&out byteCount = 0);
|
|
||||||
double parseFloat(const string&in, uint&out byteCount = 0);
|
|
||||||
namespace Engine {
|
|
||||||
Entity getRoot();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool button(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool buttonCenter(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool buttonEnd(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool checkbox(const string&in, bool);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool checkboxDisabled(const string&in, bool);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void drawFrameBuffer(FrameBuffer, int, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void drawFrameBufferCentered(FrameBuffer, int, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void drawIcon(const string&in, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void drawIconCentered(const string&in, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool inputText(const string&in, const string&in, string&out);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isItemClicked(int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isMouseDoubleClicked(int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float magicSlider(const string&in, float, float);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
vec3 magicSlider3(const string&in, vec3, float);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool menuItem(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void menuItemDisabled(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void menuSpace(const string&in, any@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void sameline();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void separator();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void space();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void space(int, int = 10);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void text(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void textCenter(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void textColor(float, float, float, const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void textEnd(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void title(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void titleCenter(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void titleCenterY(const string&in, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void titleEnd(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isKeyDown(key);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isKeyPressed(key);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isMouseDraggin(key);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool isPannelActive();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float getMouseDragDeltaX();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float getMouseDragDeltaY();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float getMouseDeltaX();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float getMouseDeltaY();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
int getAvailableSizeX();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
int getAvailableSizeY();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void disablePannelPadding(bool);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
int sliderInt(string&in, int, int, int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
float slider(string&in, float, float, float);
|
|
||||||
}
|
|
||||||
namespace Engine {
|
|
||||||
FrameBuffer createRGBA8FrameBuffer(const string&in, int, int);
|
|
||||||
}
|
|
||||||
namespace Engine {
|
|
||||||
FrameBuffer getFrameBuffer(const string&in);
|
|
||||||
}
|
|
||||||
namespace Engine {
|
|
||||||
Environment getMainEnvironment();
|
|
||||||
}
|
|
||||||
namespace Engine {
|
|
||||||
Environment createEnvironment();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void setupAutomaticColumns(int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void setupColumns(int);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void endColumns();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void nextColumn();
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
int getResourceCount(ResourceType, const string&in);
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
string getResourceNameById(ResourceType, const string&in, int);
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
string getResourcePathById(ResourceType, const string&in, int);
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
int getDirCount(ResourceType, const string&in);
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
string getDirPathById(ResourceType, const string&in, int);
|
|
||||||
}
|
|
||||||
namespace Resource {
|
|
||||||
string getDirNameById(ResourceType, const string&in, int);
|
|
||||||
}
|
|
||||||
namespace Engine {
|
|
||||||
void print(const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void treeNodeLeaf(const string&in, bool);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool treeNode(const string&in, bool, any@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool componentNode(const string&in, any@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
bool componentNode_contextMenu(const string&in, any@, ReciverFunc@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void contextItemPopup(const string&in, any@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void contextMenuPopup(const string&in, any@, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void modalPopup(const string&in, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void simplePopup(const string&in, ReciverFunc@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void openPopup(const string&in, any@);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void closePopup();
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void dragDropSource(const string&in, any@, const string&in);
|
|
||||||
}
|
|
||||||
namespace UI {
|
|
||||||
void dragDropTarget(const string&in, any@, TransferFunc@);
|
|
||||||
}
|
|
33
roe/Editor/Services/ActiveEntity/ActiveEntity.as
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
class ActiveEntity : ServiceScript {
|
||||||
|
Entity entity;
|
||||||
|
|
||||||
|
void onInit() {
|
||||||
|
entity = Engine::getMainEnvironment().getRootEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
[ServiceAPI]
|
||||||
|
Entity getActiveEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
[ServiceAPI]
|
||||||
|
void setActiveEntity(Entity ent) {
|
||||||
|
entity = ent;
|
||||||
|
}
|
||||||
|
|
||||||
|
[ServiceAPI]
|
||||||
|
void renameEntity(any@ data) {
|
||||||
|
Entity entity;
|
||||||
|
data.retrieve(entity);
|
||||||
|
|
||||||
|
string name = entity.name;
|
||||||
|
if (UI::inputText("##RENAME", name, name)) {
|
||||||
|
entity.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
UI::sameline();
|
||||||
|
if (UI::button("Accept")) {
|
||||||
|
UI::closePopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
403
roe/Editor/Services/ActiveEntity/as.predefined
Normal file
@ -0,0 +1,403 @@
|
|||||||
|
//This file was generated automatically
|
||||||
|
funcdef void ReciverFunc(any@);
|
||||||
|
funcdef void TransferFunc(any@, any@);
|
||||||
|
enum key {
|
||||||
|
A = 546,
|
||||||
|
B = 547,
|
||||||
|
C = 548,
|
||||||
|
D = 549,
|
||||||
|
E = 550,
|
||||||
|
F = 551,
|
||||||
|
G = 552,
|
||||||
|
H = 553,
|
||||||
|
I = 554,
|
||||||
|
J = 555,
|
||||||
|
K = 556,
|
||||||
|
L = 557,
|
||||||
|
M = 558,
|
||||||
|
N = 559,
|
||||||
|
O = 560,
|
||||||
|
P = 561,
|
||||||
|
Q = 562,
|
||||||
|
R = 563,
|
||||||
|
S = 564,
|
||||||
|
T = 565,
|
||||||
|
U = 566,
|
||||||
|
V = 567,
|
||||||
|
W = 568,
|
||||||
|
X = 569,
|
||||||
|
Y = 570,
|
||||||
|
Z = 571,
|
||||||
|
K0 = 536,
|
||||||
|
K1 = 537,
|
||||||
|
K2 = 538,
|
||||||
|
K3 = 539,
|
||||||
|
K4 = 540,
|
||||||
|
K5 = 541,
|
||||||
|
K6 = 542,
|
||||||
|
K7 = 543,
|
||||||
|
K8 = 544,
|
||||||
|
K9 = 545,
|
||||||
|
Tab = 512,
|
||||||
|
Enter = 525,
|
||||||
|
Escape = 526,
|
||||||
|
Backspace = 523,
|
||||||
|
Space = 524,
|
||||||
|
Delete = 522,
|
||||||
|
Insert = 521,
|
||||||
|
Home = 519,
|
||||||
|
End = 520,
|
||||||
|
PageUp = 517,
|
||||||
|
PageDown = 518,
|
||||||
|
Right = 514,
|
||||||
|
Up = 515,
|
||||||
|
Down = 516,
|
||||||
|
Left = 513,
|
||||||
|
RightCtrl = 531,
|
||||||
|
LeftShift = 528,
|
||||||
|
RightShift = 532,
|
||||||
|
LeftAlt = 529,
|
||||||
|
RightAlt = 533,
|
||||||
|
LeftSuper = 530,
|
||||||
|
RightSuper = 534,
|
||||||
|
LeftCtrl = 527,
|
||||||
|
MouseLeft = 641,
|
||||||
|
MouseRight = 642,
|
||||||
|
MouseMiddle = 643
|
||||||
|
}
|
||||||
|
enum AssetType {
|
||||||
|
None = 0,
|
||||||
|
Shader = 2,
|
||||||
|
Mesh = 1
|
||||||
|
}
|
||||||
|
class string {
|
||||||
|
~string();
|
||||||
|
string();
|
||||||
|
string(const string&in);
|
||||||
|
string& opAssign(const string&in);
|
||||||
|
string& opAddAssign(const string&in);
|
||||||
|
bool opEquals(const string&in) const;
|
||||||
|
int opCmp(const string&in) const;
|
||||||
|
string opAdd(const string&in) const;
|
||||||
|
uint length() const;
|
||||||
|
void resize(uint);
|
||||||
|
bool isEmpty() const;
|
||||||
|
uint8& opIndex(uint);
|
||||||
|
const uint8& opIndex(uint) const;
|
||||||
|
string& opAssign(double);
|
||||||
|
string& opAddAssign(double);
|
||||||
|
string opAdd(double) const;
|
||||||
|
string opAdd_r(double) const;
|
||||||
|
string& opAssign(float);
|
||||||
|
string& opAddAssign(float);
|
||||||
|
string opAdd(float) const;
|
||||||
|
string opAdd_r(float) const;
|
||||||
|
string& opAssign(int64);
|
||||||
|
string& opAddAssign(int64);
|
||||||
|
string opAdd(int64) const;
|
||||||
|
string opAdd_r(int64) const;
|
||||||
|
string& opAssign(uint64);
|
||||||
|
string& opAddAssign(uint64);
|
||||||
|
string opAdd(uint64) const;
|
||||||
|
string opAdd_r(uint64) const;
|
||||||
|
string& opAssign(bool);
|
||||||
|
string& opAddAssign(bool);
|
||||||
|
string opAdd(bool) const;
|
||||||
|
string opAdd_r(bool) const;
|
||||||
|
string substr(uint start = 0, int count = - 1) const;
|
||||||
|
int findFirst(const string&in, uint start = 0) const;
|
||||||
|
int findFirstOf(const string&in, uint start = 0) const;
|
||||||
|
int findFirstNotOf(const string&in, uint start = 0) const;
|
||||||
|
int findLast(const string&in, int start = - 1) const;
|
||||||
|
int findLastOf(const string&in, int start = - 1) const;
|
||||||
|
int findLastNotOf(const string&in, int start = - 1) const;
|
||||||
|
void insert(uint pos, const string&in other);
|
||||||
|
void erase(uint pos, int count = - 1);
|
||||||
|
}
|
||||||
|
class array<T> {
|
||||||
|
funcdef bool less(const T&in a, const T&in b);
|
||||||
|
T[]@ array(int&in);
|
||||||
|
T[]@ array(int&in, uint length);
|
||||||
|
T[]@ array(int&in, uint length, const T&in value);
|
||||||
|
T& opIndex(uint index);
|
||||||
|
const T& opIndex(uint index) const;
|
||||||
|
T[]& opAssign(const T[]&in);
|
||||||
|
void insertAt(uint index, const T&in value);
|
||||||
|
void insertAt(uint index, const T[]&inout arr);
|
||||||
|
void insertLast(const T&in value);
|
||||||
|
void removeAt(uint index);
|
||||||
|
void removeLast();
|
||||||
|
void removeRange(uint start, uint count);
|
||||||
|
uint length() const;
|
||||||
|
void reserve(uint length);
|
||||||
|
void resize(uint length);
|
||||||
|
void sortAsc();
|
||||||
|
void sortAsc(uint startAt, uint count);
|
||||||
|
void sortDesc();
|
||||||
|
void sortDesc(uint startAt, uint count);
|
||||||
|
void reverse();
|
||||||
|
int find(const T&in value) const;
|
||||||
|
int find(uint startAt, const T&in value) const;
|
||||||
|
int findByRef(const T&in value) const;
|
||||||
|
int findByRef(uint startAt, const T&in value) const;
|
||||||
|
bool opEquals(const T[]&in) const;
|
||||||
|
bool isEmpty() const;
|
||||||
|
void sort(T[]::less&in, uint startAt = 0, uint count = uint ( - 1 ));
|
||||||
|
funcdef bool less(const T&in, const T&in);
|
||||||
|
}
|
||||||
|
class dictionaryValue {
|
||||||
|
~dictionaryValue();
|
||||||
|
dictionaryValue();
|
||||||
|
dictionaryValue& opAssign(const dictionaryValue&in);
|
||||||
|
dictionaryValue& opHndlAssign(const ?&in);
|
||||||
|
dictionaryValue& opHndlAssign(const dictionaryValue&in);
|
||||||
|
dictionaryValue& opAssign(const ?&in);
|
||||||
|
dictionaryValue& opAssign(double);
|
||||||
|
dictionaryValue& opAssign(int64);
|
||||||
|
void opCast(?&out);
|
||||||
|
void opConv(?&out);
|
||||||
|
int64 opConv();
|
||||||
|
double opConv();
|
||||||
|
}
|
||||||
|
class dictionary {
|
||||||
|
dictionary@ dictionary();
|
||||||
|
dictionary& opAssign(const dictionary&in);
|
||||||
|
void set(const string&in, const ?&in);
|
||||||
|
bool get(const string&in, ?&out) const;
|
||||||
|
void set(const string&in, const int64&in);
|
||||||
|
bool get(const string&in, int64&out) const;
|
||||||
|
void set(const string&in, const double&in);
|
||||||
|
bool get(const string&in, double&out) const;
|
||||||
|
bool exists(const string&in) const;
|
||||||
|
bool isEmpty() const;
|
||||||
|
uint getSize() const;
|
||||||
|
bool delete(const string&in);
|
||||||
|
void deleteAll();
|
||||||
|
string[]@ getKeys() const;
|
||||||
|
dictionaryValue& opIndex(const string&in);
|
||||||
|
const dictionaryValue& opIndex(const string&in) const;
|
||||||
|
}
|
||||||
|
class ref {
|
||||||
|
~ref();
|
||||||
|
ref();
|
||||||
|
ref(const ref&in);
|
||||||
|
ref(const ?&in);
|
||||||
|
void opCast(?&out);
|
||||||
|
ref& opHndlAssign(const ref&in);
|
||||||
|
ref& opHndlAssign(const ?&in);
|
||||||
|
bool opEquals(const ref&in) const;
|
||||||
|
bool opEquals(const ?&in) const;
|
||||||
|
}
|
||||||
|
class any {
|
||||||
|
any@ any();
|
||||||
|
any@ any(?&in);
|
||||||
|
any@ any(const int64&in);
|
||||||
|
any@ any(const double&in);
|
||||||
|
any& opAssign(any&in);
|
||||||
|
void store(?&in);
|
||||||
|
void store(const int64&in);
|
||||||
|
void store(const double&in);
|
||||||
|
bool retrieve(?&out);
|
||||||
|
bool retrieve(int64&out);
|
||||||
|
bool retrieve(double&out);
|
||||||
|
}
|
||||||
|
class DockPanel {
|
||||||
|
void onRender();
|
||||||
|
}
|
||||||
|
class ServiceScript {
|
||||||
|
}
|
||||||
|
class Entity {
|
||||||
|
string get_name() const property;
|
||||||
|
void set_name(string&in) property;
|
||||||
|
int get_id() const property;
|
||||||
|
Entity createChild(const string&in);
|
||||||
|
bool get_isRoot() const property;
|
||||||
|
void destroy();
|
||||||
|
bool get_exists() const property;
|
||||||
|
Entity get_parent() property;
|
||||||
|
void set_parent(Entity) property;
|
||||||
|
bool isDescendantOf(Entity);
|
||||||
|
bool opEquals(const Entity&in) const;
|
||||||
|
EntityChilds get_childs() const property;
|
||||||
|
TransformComponent get_transform() const property;
|
||||||
|
MeshComponent getMeshComponent();
|
||||||
|
MeshComponent createMeshComponent();
|
||||||
|
bool hasMeshComponent();
|
||||||
|
void removeMeshComponent();
|
||||||
|
ShaderComponent getShaderComponent();
|
||||||
|
ShaderComponent createShaderComponent();
|
||||||
|
bool hasShaderComponent();
|
||||||
|
void removeShaderComponent();
|
||||||
|
CameraComponent getCameraComponent();
|
||||||
|
CameraComponent createCameraComponent();
|
||||||
|
bool hasCameraComponent();
|
||||||
|
void removeCameraComponent();
|
||||||
|
}
|
||||||
|
class EntityChilds {
|
||||||
|
int get_count() const property;
|
||||||
|
Entity opIndex(int) const;
|
||||||
|
}
|
||||||
|
class TransformComponent {
|
||||||
|
vec3 get_position() const property;
|
||||||
|
vec3 get_scale() const property;
|
||||||
|
vec3 get_rotation() const property;
|
||||||
|
void set_position(const vec3) property;
|
||||||
|
void set_scale(const vec3) property;
|
||||||
|
void set_rotation(const vec3) property;
|
||||||
|
}
|
||||||
|
class MeshComponent {
|
||||||
|
bool get_isActive() const property;
|
||||||
|
bool get_hasMesh() const property;
|
||||||
|
void clear();
|
||||||
|
string getMesh();
|
||||||
|
void setMesh(string&in);
|
||||||
|
void set_isActive(const bool) property;
|
||||||
|
}
|
||||||
|
class ShaderComponent {
|
||||||
|
bool get_hasShader() const property;
|
||||||
|
void clear();
|
||||||
|
string getShader();
|
||||||
|
void setShader(const string&in);
|
||||||
|
}
|
||||||
|
class CameraComponent {
|
||||||
|
float get_fov() const property;
|
||||||
|
float get_aspectRatio() const property;
|
||||||
|
float get_nearZ() const property;
|
||||||
|
float get_farZ() const property;
|
||||||
|
void set_fov(float) property;
|
||||||
|
void set_aspectRatio(float) property;
|
||||||
|
void set_nearZ(float) property;
|
||||||
|
void set_farZ(float) property;
|
||||||
|
}
|
||||||
|
class vec3 {
|
||||||
|
vec3();
|
||||||
|
vec3(float, float = 0, float = 0);
|
||||||
|
vec3 opAdd(const vec3&in);
|
||||||
|
vec3 opSub(const vec3&in) const;
|
||||||
|
vec3 opNeg() const;
|
||||||
|
vec3 opMul(float) const;
|
||||||
|
vec3 opMul_r(float) const;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
}
|
||||||
|
class quat {
|
||||||
|
~quat();
|
||||||
|
quat();
|
||||||
|
quat(float, float, float, float);
|
||||||
|
quat opMul(const quat&in) const;
|
||||||
|
vec3 getEuler() const;
|
||||||
|
void setEuler(vec3);
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
float w;
|
||||||
|
}
|
||||||
|
class Transform {
|
||||||
|
Transform();
|
||||||
|
vec3 relative(vec3);
|
||||||
|
vec3 position;
|
||||||
|
vec3 scale;
|
||||||
|
quat rotation;
|
||||||
|
}
|
||||||
|
class Camera {
|
||||||
|
Camera();
|
||||||
|
float fov;
|
||||||
|
float aspect;
|
||||||
|
float nearZ;
|
||||||
|
float farZ;
|
||||||
|
}
|
||||||
|
class SceneCamera {
|
||||||
|
SceneCamera();
|
||||||
|
Camera camera;
|
||||||
|
Transform transform;
|
||||||
|
}
|
||||||
|
class FrameBuffer {
|
||||||
|
FrameBuffer();
|
||||||
|
void clearRGBA(int, int, int, int);
|
||||||
|
int get_height() const property;
|
||||||
|
void resize(int, int);
|
||||||
|
string get_name() const property;
|
||||||
|
bool isValid();
|
||||||
|
}
|
||||||
|
class Environment {
|
||||||
|
void render(FrameBuffer, SceneCamera&in);
|
||||||
|
Entity getRootEntity();
|
||||||
|
Entity getEntity(int);
|
||||||
|
}
|
||||||
|
string formatInt(int64 val, const string&in options = "", uint width = 0);
|
||||||
|
string formatUInt(uint64 val, const string&in options = "", uint width = 0);
|
||||||
|
string formatFloat(double val, const string&in options = "", uint width = 0, uint precision = 0);
|
||||||
|
int64 parseInt(const string&in, uint base = 10, uint&out byteCount = 0);
|
||||||
|
uint64 parseUInt(const string&in, uint base = 10, uint&out byteCount = 0);
|
||||||
|
double parseFloat(const string&in, uint&out byteCount = 0);
|
||||||
|
namespace Engine { Entity getRoot(); }
|
||||||
|
namespace UI { bool button(const string&in); }
|
||||||
|
namespace UI { bool buttonCenter(const string&in); }
|
||||||
|
namespace UI { bool buttonEnd(const string&in); }
|
||||||
|
namespace UI { bool checkbox(const string&in, bool); }
|
||||||
|
namespace UI { bool checkboxDisabled(const string&in, bool); }
|
||||||
|
namespace UI { void drawFrameBuffer(FrameBuffer, int, int); }
|
||||||
|
namespace UI { void drawFrameBufferCentered(FrameBuffer, int, int); }
|
||||||
|
namespace UI { void drawIcon(const string&in, int); }
|
||||||
|
namespace UI { void drawIconCentered(const string&in, int); }
|
||||||
|
namespace UI { bool inputText(const string&in, const string&in, string&out); }
|
||||||
|
namespace UI { bool isItemClicked(int); }
|
||||||
|
namespace UI { bool isMouseDoubleClicked(int); }
|
||||||
|
namespace UI { float magicSlider(const string&in, float, float); }
|
||||||
|
namespace UI { vec3 magicSlider3(const string&in, vec3, float); }
|
||||||
|
namespace UI { bool menuItem(const string&in); }
|
||||||
|
namespace UI { void menuItemDisabled(const string&in); }
|
||||||
|
namespace UI { void menuSpace(const string&in, any@, ReciverFunc@); }
|
||||||
|
namespace UI { void sameline(); }
|
||||||
|
namespace UI { void separator(); }
|
||||||
|
namespace UI { void space(); }
|
||||||
|
namespace UI { void space(int, int = 10); }
|
||||||
|
namespace UI { void text(const string&in); }
|
||||||
|
namespace UI { void textCenter(const string&in); }
|
||||||
|
namespace UI { void textColor(float, float, float, const string&in); }
|
||||||
|
namespace UI { void textEnd(const string&in); }
|
||||||
|
namespace UI { void title(const string&in); }
|
||||||
|
namespace UI { void titleCenter(const string&in); }
|
||||||
|
namespace UI { void titleCenterY(const string&in, int); }
|
||||||
|
namespace UI { void titleEnd(const string&in); }
|
||||||
|
namespace UI { bool isKeyDown(key); }
|
||||||
|
namespace UI { bool isKeyPressed(key); }
|
||||||
|
namespace UI { bool isMouseDraggin(key); }
|
||||||
|
namespace UI { bool isPannelActive(); }
|
||||||
|
namespace UI { float getMouseDragDeltaX(); }
|
||||||
|
namespace UI { float getMouseDragDeltaY(); }
|
||||||
|
namespace UI { float getMouseDeltaX(); }
|
||||||
|
namespace UI { float getMouseDeltaY(); }
|
||||||
|
namespace UI { int getAvailableSizeX(); }
|
||||||
|
namespace UI { int getAvailableSizeY(); }
|
||||||
|
namespace UI { void disablePannelPadding(bool); }
|
||||||
|
namespace UI { int sliderInt(string&in, int, int, int); }
|
||||||
|
namespace UI { float slider(string&in, float, float, float); }
|
||||||
|
namespace Engine { FrameBuffer createRGBA8FrameBuffer(const string&in, int, int); }
|
||||||
|
namespace Engine { FrameBuffer getFrameBuffer(const string&in); }
|
||||||
|
namespace Engine { Environment getMainEnvironment(); }
|
||||||
|
namespace Engine { Environment createEnvironment(); }
|
||||||
|
namespace UI { void setupAutomaticColumns(int); }
|
||||||
|
namespace UI { void setupColumns(int); }
|
||||||
|
namespace UI { void endColumns(); }
|
||||||
|
namespace UI { void nextColumn(); }
|
||||||
|
namespace Assets { int getAssetCount(AssetType, const string&in); }
|
||||||
|
namespace Assets { string getAssetNameById(AssetType, const string&in, int); }
|
||||||
|
namespace Assets { string getAssetTypePathById(AssetType, const string&in, int); }
|
||||||
|
namespace Assets { int getDirCount(AssetType, const string&in); }
|
||||||
|
namespace Assets { string getDirPathById(AssetType, const string&in, int); }
|
||||||
|
namespace Assets { string getDirNameById(AssetType, const string&in, int); }
|
||||||
|
namespace Engine { void print(const string&in); }
|
||||||
|
namespace UI { void treeNodeLeaf(const string&in, bool); }
|
||||||
|
namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); }
|
||||||
|
namespace UI { bool componentNode(const string&in, any@, ReciverFunc@); }
|
||||||
|
namespace UI { bool componentNode_contextMenu(const string&in, any@, ReciverFunc@, ReciverFunc@); }
|
||||||
|
namespace UI { void contextItemPopup(const string&in, any@, ReciverFunc@); }
|
||||||
|
namespace UI { void contextMenuPopup(const string&in, any@, ReciverFunc@); }
|
||||||
|
namespace UI { void modalPopup(const string&in, ReciverFunc@); }
|
||||||
|
namespace UI { void simplePopup(const string&in, ReciverFunc@); }
|
||||||
|
namespace UI { void openPopup(const string&in, any@); }
|
||||||
|
namespace UI { void closePopup(); }
|
||||||
|
namespace UI { void dragDropSource(const string&in, any@, const string&in); }
|
||||||
|
namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }
|
@ -18,7 +18,7 @@ enum key
|
|||||||
};
|
};
|
||||||
|
|
||||||
//This file was generated automatically
|
//This file was generated automatically
|
||||||
enum ResourceType {
|
enum AssetType {
|
||||||
Mesh = 1,
|
Mesh = 1,
|
||||||
Shader = 2
|
Shader = 2
|
||||||
}
|
}
|
||||||
@ -343,18 +343,18 @@ namespace Engine {
|
|||||||
|
|
||||||
namespace Resource {
|
namespace Resource {
|
||||||
// Get the number of resources of a given type and category
|
// Get the number of resources of a given type and category
|
||||||
int getResourceCount(ResourceType type, const string& in category);
|
int getAssetCount(AssetType type, const string& in category);
|
||||||
// Get the name of a resource by type, category, and resource ID
|
// Get the name of a resource by type, category, and resource ID
|
||||||
string getResourceNameById(ResourceType type, const string& in category, int id);
|
string getAssetNameById(AssetType type, const string& in category, int id);
|
||||||
// Get the file path of a resource by type, category, and resource ID
|
// Get the file path of a resource by type, category, and resource ID
|
||||||
string getResourcePathById(ResourceType type, const string& in category, int id);
|
string getAssetTypePathById(AssetType type, const string& in category, int id);
|
||||||
|
|
||||||
// Get the number of directories of a given resource type and category
|
// Get the number of directories of a given resource type and category
|
||||||
int getDirCount(ResourceType type, const string& in category);
|
int getDirCount(AssetType type, const string& in category);
|
||||||
// Get the path of a directory by resource type, category, and directory ID
|
// Get the path of a directory by resource type, category, and directory ID
|
||||||
string getDirPathById(ResourceType type, const string& in category, int id);
|
string getDirPathById(AssetType type, const string& in category, int id);
|
||||||
// Get the name of a directory by resource type, category, and directory ID
|
// Get the name of a directory by resource type, category, and directory ID
|
||||||
string getDirNameById(ResourceType type, const string& in category, int id);
|
string getDirNameById(AssetType type, const string& in category, int id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
# Blender 3.4.1
|
|
||||||
# www.blender.org
|
|
||||||
mtllib cube.mtl
|
|
||||||
o Cube
|
|
||||||
v -1.000000 -1.000000 1.000000
|
|
||||||
v -1.000000 1.000000 1.000000
|
|
||||||
v -1.000000 -1.000000 -1.000000
|
|
||||||
v -1.000000 1.000000 -1.000000
|
|
||||||
v 1.000000 -1.000000 1.000000
|
|
||||||
v 1.000000 1.000000 1.000000
|
|
||||||
v 1.000000 -1.000000 -1.000000
|
|
||||||
v 1.000000 1.000000 -1.000000
|
|
||||||
vn -1.0000 -0.0000 -0.0000
|
|
||||||
vn -0.0000 -0.0000 -1.0000
|
|
||||||
vn 1.0000 -0.0000 -0.0000
|
|
||||||
vn -0.0000 -0.0000 1.0000
|
|
||||||
vn -0.0000 -1.0000 -0.0000
|
|
||||||
vn -0.0000 1.0000 -0.0000
|
|
||||||
vt 0.375000 0.000000
|
|
||||||
vt 0.375000 1.000000
|
|
||||||
vt 0.125000 0.750000
|
|
||||||
vt 0.625000 0.000000
|
|
||||||
vt 0.625000 1.000000
|
|
||||||
vt 0.875000 0.750000
|
|
||||||
vt 0.375000 0.250000
|
|
||||||
vt 0.125000 0.500000
|
|
||||||
vt 0.625000 0.250000
|
|
||||||
vt 0.875000 0.500000
|
|
||||||
vt 0.375000 0.750000
|
|
||||||
vt 0.625000 0.750000
|
|
||||||
vt 0.375000 0.500000
|
|
||||||
vt 0.625000 0.500000
|
|
||||||
s 0
|
|
||||||
f 1/1/1 2/4/1 4/9/1 3/7/1
|
|
||||||
f 3/7/2 4/9/2 8/14/2 7/13/2
|
|
||||||
f 7/13/3 8/14/3 6/12/3 5/11/3
|
|
||||||
f 5/11/4 6/12/4 2/5/4 1/2/4
|
|
||||||
f 3/8/5 7/13/5 5/11/5 1/3/5
|
|
||||||
f 8/14/6 4/10/6 2/6/6 6/12/6
|
|
@ -1,293 +0,0 @@
|
|||||||
{
|
|
||||||
"scene": {
|
|
||||||
"main_environment": {
|
|
||||||
"entities": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Scene Root",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 0,
|
|
||||||
"childrensUIDs": [
|
|
||||||
2,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
9
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Scenary",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": [
|
|
||||||
3,
|
|
||||||
4
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Base",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 10.0,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 2,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Top",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 10.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 10.0,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 2,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"name": "Enemy",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 9.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "PlayerScript"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"name": "Player",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": -9.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "PlayerScript"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"name": "Camera",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": -3.5067137105215809e-7,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": -25.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.9999988079071045,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.9999988079071045
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": true,
|
|
||||||
"cameraComponent": {
|
|
||||||
"aspect": 1.789162516593933,
|
|
||||||
"fov": 0.5714905858039856,
|
|
||||||
"farZ": 100.0,
|
|
||||||
"nearZ": 0.10000000149011612
|
|
||||||
},
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 9,
|
|
||||||
"name": "Ball",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "BallScript"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mainCameraUID": 7
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,201 +0,0 @@
|
|||||||
{
|
|
||||||
"scene": {
|
|
||||||
"main_environment": {
|
|
||||||
"entities": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Scene Root",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 0,
|
|
||||||
"childrensUIDs": [
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Skull1",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": -1.1876044273376465,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/cube.obj",
|
|
||||||
"shader": "assets/Shaders/SimpleShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": true,
|
|
||||||
"textureBindingComponent": {
|
|
||||||
"bindings": [
|
|
||||||
{
|
|
||||||
"texturePath": "assets/Skull.jpg",
|
|
||||||
"bindingID": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Skull2",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 4.1646552085876469,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/skull.obj",
|
|
||||||
"shader": "assets/Shaders/SimpleShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": true,
|
|
||||||
"textureBindingComponent": {
|
|
||||||
"bindings": [
|
|
||||||
{
|
|
||||||
"texturePath": "assets/test_texture.png",
|
|
||||||
"bindingID": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Skull2 (duplicated)",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 1.608313798904419,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/skull.obj",
|
|
||||||
"shader": "assets/Shaders/SimpleShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": true,
|
|
||||||
"textureBindingComponent": {
|
|
||||||
"bindings": [
|
|
||||||
{
|
|
||||||
"texturePath": "assets/Skull.jpg",
|
|
||||||
"bindingID": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"name": "Camera",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 1.266955018043518,
|
|
||||||
"y": 1.3802015781402588,
|
|
||||||
"z": 6.402083873748779
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.9999963045120239,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.9999963045120239
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.9979519844055176,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 0.06396745890378952
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": true,
|
|
||||||
"cameraComponent": {
|
|
||||||
"aspect": 1.6891757249832154,
|
|
||||||
"fov": 0.8116129636764526,
|
|
||||||
"farZ": 100.0,
|
|
||||||
"nearZ": 0.10000000149011612
|
|
||||||
},
|
|
||||||
"hasTextureBindingComponent": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mainCameraUID": 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,109 +0,0 @@
|
|||||||
{
|
|
||||||
"scene": {
|
|
||||||
"main_environment": {
|
|
||||||
"entities": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Scene Root",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 0,
|
|
||||||
"childrensUIDs": [
|
|
||||||
2
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"has_meshRenderComponent": false,
|
|
||||||
"has_cameraComponent": false,
|
|
||||||
"has_textureBindingComponent": false,
|
|
||||||
"has_scriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Scene Root",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 0,
|
|
||||||
"childrensUIDs": [
|
|
||||||
2
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"has_meshRenderComponent": false,
|
|
||||||
"has_cameraComponent": false,
|
|
||||||
"has_textureBindingComponent": false,
|
|
||||||
"has_scriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Camera",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 1.9156945943832398,
|
|
||||||
"y": 11.272941589355469,
|
|
||||||
"z": 45.95248794555664
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.000001072883606,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.000001072883606
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.9542083144187927,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 0.2991430163383484
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"has_meshRenderComponent": false,
|
|
||||||
"has_cameraComponent": true,
|
|
||||||
"cameraComponent": {
|
|
||||||
"aspect": 1.6326905488967896,
|
|
||||||
"fov": 0.8726646304130554,
|
|
||||||
"farZ": 100.0,
|
|
||||||
"nearZ": 0.10000000149011612
|
|
||||||
},
|
|
||||||
"has_textureBindingComponent": false,
|
|
||||||
"has_scriptComponent": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mainCameraUID": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,293 +0,0 @@
|
|||||||
{
|
|
||||||
"scene": {
|
|
||||||
"main_environment": {
|
|
||||||
"entities": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Scene Root",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 0,
|
|
||||||
"childrensUIDs": [
|
|
||||||
2,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
9
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Scenary",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 1.0,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 1.0
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": [
|
|
||||||
3,
|
|
||||||
4
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Base",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 10.0,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 2,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"name": "Top",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 10.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 10.0,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 2,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"name": "Enemy",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 4.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "PlayerScript"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"name": "Player",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": -9.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "PlayerScript"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"name": "Camera",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": -3.5067137105215809e-7,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": -25.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.9999988079071045,
|
|
||||||
"y": 1.0,
|
|
||||||
"z": 0.9999988079071045
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": false,
|
|
||||||
"hasCameraComponent": true,
|
|
||||||
"cameraComponent": {
|
|
||||||
"aspect": 1.095049500465393,
|
|
||||||
"fov": 0.5714905858039856,
|
|
||||||
"farZ": 100.0,
|
|
||||||
"nearZ": 0.10000000149011612
|
|
||||||
},
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 9,
|
|
||||||
"name": "Ball",
|
|
||||||
"transform": {
|
|
||||||
"position": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 5.0,
|
|
||||||
"z": 0.0
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"x": 0.25,
|
|
||||||
"y": 0.25,
|
|
||||||
"z": 0.25
|
|
||||||
},
|
|
||||||
"rotation": {
|
|
||||||
"x": 0.0,
|
|
||||||
"y": 0.0,
|
|
||||||
"z": 0.0,
|
|
||||||
"w": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"relationship": {
|
|
||||||
"parentUID": 1,
|
|
||||||
"childrensUIDs": []
|
|
||||||
},
|
|
||||||
"hasMeshRenderComponent": true,
|
|
||||||
"meshRenderComponent": {
|
|
||||||
"mesh": "assets/3dObjects/cube.obj",
|
|
||||||
"shader": "assets/Shaders/FancyShader.glsl"
|
|
||||||
},
|
|
||||||
"hasCameraComponent": false,
|
|
||||||
"hasTextureBindingComponent": false,
|
|
||||||
"hasScriptComponent": true,
|
|
||||||
"scriptComponent": {
|
|
||||||
"scriptID": "BallScript"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mainCameraUID": 7
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
#type vertex
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 a_position;
|
|
||||||
layout(location = 1) in vec2 a_uv;
|
|
||||||
layout(location = 2) in vec3 a_normal;
|
|
||||||
|
|
||||||
out vec2 textCoord;
|
|
||||||
out vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform mat4 u_viewMatrix;
|
|
||||||
uniform mat4 u_worldMatrix;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = u_viewMatrix * u_worldMatrix * vec4(a_position,1.0);
|
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(u_worldMatrix)));
|
|
||||||
vec3 transformedNormal = normalize(normalMatrix * a_normal);
|
|
||||||
|
|
||||||
worldNormal = transformedNormal;
|
|
||||||
textCoord = a_uv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#type fragment
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 fragColor;
|
|
||||||
layout(location = 1) out int objectID;
|
|
||||||
|
|
||||||
in vec2 textCoord;
|
|
||||||
in vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform int u_objectID;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
float light = clamp(dot(worldNormal, normalize(vec3(1,2,3))), 0.1, 1.0);
|
|
||||||
|
|
||||||
fragColor = vec4(light, light, light, 1.0);
|
|
||||||
objectID = u_objectID;
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
#type vertex
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 a_position;
|
|
||||||
layout(location = 1) in vec2 a_uv;
|
|
||||||
layout(location = 2) in vec3 a_normal;
|
|
||||||
|
|
||||||
out vec2 textCoord;
|
|
||||||
out vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform mat4 u_viewMatrix;
|
|
||||||
uniform mat4 u_worldMatrix;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = u_viewMatrix * u_worldMatrix * vec4(a_position,1.0);
|
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(u_worldMatrix)));
|
|
||||||
vec3 transformedNormal = normalize(normalMatrix * a_normal);
|
|
||||||
|
|
||||||
worldNormal = transformedNormal;
|
|
||||||
textCoord = a_uv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#type fragment
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 fragColor;
|
|
||||||
layout(location = 1) out int objectID;
|
|
||||||
|
|
||||||
in vec2 textCoord;
|
|
||||||
in vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform int u_objectID;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
//float light = clamp(dot(worldNormal, normalize(vec3(1,2,3))), 0.1, 1.0);
|
|
||||||
|
|
||||||
fragColor = vec4(1,1,1, 1.0);
|
|
||||||
objectID = u_objectID;
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
#type vertex
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 a_position;
|
|
||||||
layout(location = 1) in vec2 a_uv;
|
|
||||||
layout(location = 2) in vec3 a_normal;
|
|
||||||
|
|
||||||
out vec2 textCoord;
|
|
||||||
out vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform mat4 u_viewMatrix;
|
|
||||||
uniform mat4 u_worldMatrix;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
//gl_Position = vec4(a_position, 1.0) * u_projectionMatrix * u_viewMatrix;
|
|
||||||
gl_Position = u_viewMatrix * u_worldMatrix * vec4(a_position,1.0);
|
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(u_worldMatrix)));
|
|
||||||
vec3 transformedNormal = normalize(normalMatrix * a_normal);
|
|
||||||
|
|
||||||
worldNormal = transformedNormal;
|
|
||||||
textCoord = a_uv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#type fragment
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 fragColor;
|
|
||||||
layout(location = 1) out int objectID;
|
|
||||||
|
|
||||||
in vec2 textCoord;
|
|
||||||
in vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
uniform int u_objectID;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
fragColor = texture(u_texture, textCoord);
|
|
||||||
objectID = u_objectID;
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
#type vertex
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 a_position;
|
|
||||||
layout(location = 1) in vec2 a_uv;
|
|
||||||
layout(location = 2) in vec3 a_normal;
|
|
||||||
|
|
||||||
out vec2 textCoord;
|
|
||||||
out vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform mat4 u_viewMatrix;
|
|
||||||
uniform mat4 u_worldMatrix;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
//gl_Position = vec4(a_position, 1.0) * u_projectionMatrix * u_viewMatrix;
|
|
||||||
gl_Position = u_viewMatrix * u_worldMatrix * vec4(a_position,1.0);
|
|
||||||
|
|
||||||
mat3 normalMatrix = transpose(inverse(mat3(u_worldMatrix)));
|
|
||||||
vec3 transformedNormal = normalize(normalMatrix * a_normal);
|
|
||||||
|
|
||||||
worldNormal = transformedNormal;
|
|
||||||
textCoord = a_uv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#type fragment
|
|
||||||
#version 410 core
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 fragColor;
|
|
||||||
layout(location = 1) out int objectID;
|
|
||||||
|
|
||||||
in vec2 textCoord;
|
|
||||||
in vec3 worldNormal;
|
|
||||||
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
uniform int u_objectID;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
float v = clamp(dot(worldNormal, normalize(vec3(1,2,-3))), 0.1, 1.0);
|
|
||||||
fragColor = texture(u_texture, textCoord) * v;
|
|
||||||
objectID = u_objectID;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 97 KiB |