diff --git a/Assets/Scenes/M2Scene.shade b/Assets/Scenes/M2Scene.shade index 60dbb5f9..443d4a87 100644 --- a/Assets/Scenes/M2Scene.shade +++ b/Assets/Scenes/M2Scene.shade @@ -50,7 +50,7 @@ Colliders: - Is Trigger: false Type: Box - Half Extents: {x: 0.00427246094, y: 0.000122070312, z: 0.00427246094} + Half Extents: {x: 24.7399445, y: 0.25, z: 8.75} Friction: 0.400000006 Bounciness: 0 Density: 1 @@ -85,12 +85,28 @@ Colliders: - Is Trigger: false Type: Box - Half Extents: {x: 0.000244140625, y: 0.000244140625, z: 0.000244140625} + Half Extents: {x: 1, y: 1, z: 1} Friction: 0.400000006 Bounciness: 0 Density: 1 Position Offset: {x: 0, y: 0.5, z: 0} - Scripts: ~ + Scripts: + - Type: PlayerController + drag: 2 + currentState: 0 + maxMoveVel: 2 + moveForce: 50 + sprintMultiplier: 2 + rotationFactorPerFrame: 1 + maxJumpHeight: 4 + maxJumpTime: 0.75 + fallMultipler: 2 + lightMultiper: 0.75 + mediumMultiper: 0.5 + heavyMultiper: 0.25 + - Type: PickAndThrow + throwForce: [200, 300, 200] + item: 5 - EID: 3 Name: Default IsActive: true @@ -110,7 +126,12 @@ Translate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} - Scripts: ~ + Scripts: + - Type: SHADE_Scripting.ThirdPersonCamera + armLength: 2 + turnSpeedPitch: 0.300000012 + turnSpeedYaw: 0.5 + pitchClamp: 45 - EID: 9 Name: Default IsActive: true @@ -135,7 +156,7 @@ Scale: {x: 2, y: 2, z: 2} Renderable Component: Mesh: 144838771 - Material: 126974645 + Material: 123745521 RigidBody Component: Type: Dynamic Mass: 1 @@ -153,19 +174,21 @@ Colliders: - Is Trigger: false Type: Box - Half Extents: {x: 0.000244140625, y: 0.000244140625, z: 0.000244140625} + Half Extents: {x: 1, y: 1, z: 1} Friction: 0.400000006 Bounciness: 0 Density: 1 Position Offset: {x: 0, y: 0.5, z: 0} - Is Trigger: true Type: Box - Half Extents: {x: 0.00048828125, y: 0.00048828125, z: 0.00048828125} + Half Extents: {x: 2, y: 2, z: 2} Friction: 0.400000006 Bounciness: 0 Density: 1 Position Offset: {x: 0, y: 0.5, z: 0} - Scripts: ~ + Scripts: + - Type: Item + currCategory: 0 - EID: 6 Name: AI IsActive: true @@ -174,7 +197,7 @@ Transform Component: Translate: {x: -8, y: -2, z: 2.5} Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 2, y: 2, z: 2} + Scale: {x: 1, y: 1, z: 1} Renderable Component: Mesh: 149697411 Material: 126974645 @@ -195,21 +218,28 @@ Colliders: - Is Trigger: false Type: Box - Half Extents: {x: 0.000244140625, y: 0.000244140625, z: 0.000244140625} + Half Extents: {x: 0.5, y: 0.5, z: 0.5} Friction: 0.400000006 Bounciness: 0 Density: 1 Position Offset: {x: 0, y: 0.5, z: 0} - Scripts: ~ + Scripts: + - Type: AIPrototype + movementForceMultiplier: 100 + patrolSpeed: 0.400000006 + chaseSpeed: 0.800000012 + distanceToCapture: 1.20000005 + distanceToStartChase: 2 + distanceToEndChase: 2.5 - EID: 7 Name: Default IsActive: true NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 3, y: -1, z: -1} - Rotate: {x: 0, y: 0, z: 0} - Scale: {x: 5, y: 5, z: 5} + Translate: {x: 0, y: -16.8647861, z: -14.039052} + Rotate: {x: -0, y: 0, z: -0} + Scale: {x: 28.1434975, y: 28.1434975, z: 28.1434975} Renderable Component: Mesh: 149697411 Material: 126974645 diff --git a/SHADE_Engine/src/Assets/Asset Types/SHFontAsset.h b/SHADE_Engine/src/Assets/Asset Types/SHFontAsset.h new file mode 100644 index 00000000..3f79547e --- /dev/null +++ b/SHADE_Engine/src/Assets/Asset Types/SHFontAsset.h @@ -0,0 +1,40 @@ +/*************************************************************************//** + * \file SHFontAsset.h + * \author Brandon Mak + * \date 5 November 2022 + * \brief + * + * Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or + * disclosure of this file or its contents without the prior written consent + * of DigiPen Institute of Technology is prohibited. + *****************************************************************************/ +#pragma once + +#include "SHAssetData.h" +#include "SH_API.h" +#include +#include +#include "msdf-atlas-gen/msdf-atlas-gen.h" +#include "math/SHMatrix.h" + +namespace SHADE +{ + struct SH_API SHFontAsset : SHAssetData + { + using GlyphData = std::tuple; + + /*-----------------------------------------------------------------------*/ + /* MEMBER VARIABLES */ + /*-----------------------------------------------------------------------*/ + //! Name of the shader file (without parent path) + //std::string fontName; + + //! Data containing character and uv transformation data and other misc data + std::vector glyphTransformations; + + //! The actual data of the atlas to go into the binary + std::unique_ptr bitmapData; + + + }; +} diff --git a/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.cpp b/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.cpp new file mode 100644 index 00000000..dc9a8c97 --- /dev/null +++ b/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.cpp @@ -0,0 +1,217 @@ +#include "SHpch.h" +#include "SHFontCompiler.h" +#include "Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h" +#include "Assets/Asset Types/SHFontAsset.h" +#include "Math/Vector/SHVec2.h" + +#include +#include + +namespace SHADE +{ + /***************************************************************************/ + /*! + + \brief + Given a valid ptr to a font asset and relevant data, initialize the data + inside the font asset. See SHFontAsset for details. + + \param fontAsset + The ptr to the font asset. + + \param glyphData + Individual glyph data. + + \param fontBitmap + Actual bitmap data + + \param fontGeometry + Font geometry required to get advance + + */ + /***************************************************************************/ + void SHFontCompiler::WriteToFontAsset(SHFontAsset* fontAsset, std::vector const& glyphData, msdfgen::Bitmap const& fontBitmap, msdf_atlas::FontGeometry const& fontGeometry) noexcept + { + if (!fontAsset) + return; + + uint32_t numGlyphs = static_cast(glyphData.size()); + for (uint32_t i = 0; i < numGlyphs; ++i) + { + // bounding box of the glyph in atlas + double atlasL = 0.0, atlasR = 0.0, atlasT = 0.0, atlasB = 0.0; + + // bounding box of glyph as it should be placed on the baseline + double atlasPL = 0.0, atlasPR = 0.0, atlasPT = 0.0, atlasPB = 0.0; + + // initialize the bounding boxes + glyphData[i].getQuadAtlasBounds(atlasL, atlasB, atlasR, atlasT); + glyphData[i].getQuadPlaneBounds(atlasPL, atlasPB, atlasPR, atlasPT); + + // normalize the bounding box to (0 - 1). + atlasL /= fontBitmap.width(); + atlasR /= fontBitmap.width(); + atlasT /= fontBitmap.height(); + atlasB /= fontBitmap.height(); + + // Normalized texture dimensions + SHVec2 const NORMALIZED_TEX_DIMS{ static_cast (atlasR - atlasL), static_cast (atlasT - atlasB) }; + + // When we render the quad, it has to correctly scale depending on what letter/glyph we are rendering. This is for that scale. + SHVec2 const QUAD_SCALE { static_cast (atlasPR - atlasL), static_cast (atlasT - atlasB) }; + + // initialize a matrix for uv and quad transformation data + SHMatrix transformData + { + // For scaling the tex coords + NORMALIZED_TEX_DIMS[0], 0.0f, 0.0f, 0.0f, + 0.0f, NORMALIZED_TEX_DIMS[1], 0.0f, 0.0f, + + // For translating the tex coords + static_cast(atlasL), static_cast(atlasB), 1.0f, 0.0f, + + // Stores the transformation for a quad to correctly shape the glyph (first 2 values) and the bearing (last 2) + QUAD_SCALE[0], QUAD_SCALE[1], static_cast(atlasPL), static_cast(atlasPB) + }; + + // Initialize new data (we want the matrix transposed for shader use) + SHFontAsset::GlyphData newData = std::make_tuple(glyphData[i].getCodepoint(), SHMatrix::Transpose(transformData)); + + // Push 1 set of data for a character/glyph into the asset. + fontAsset->glyphTransformations.push_back(newData); + } + + // copy data from bitmap to asset. Each channel is a 32 bit float and there are 3 channels. + fontAsset->bitmapData = std::make_unique(fontBitmap.width() * fontBitmap.height() * 3 * sizeof (float)); + } + + /***************************************************************************/ + /*! + + \brief + Loads and compiles a font to binary format. Returns a path to the binary + data (XQ please confirm kor kor thanks <3). + + \param path + Path to the font file (truetype font file) to load. + + \return + Path to newly created binary data. + + */ + /***************************************************************************/ + std::optional SHFontCompiler::LoadAndCompileFont(AssetPath path) noexcept + { + msdfgen::FontHandle* fontHandle = nullptr; + + // XQ I need your help for path manipulation to actually load the msdfgen::FontHandle here. Am I doing this correctly? + fontHandle = msdfgen::loadFont(SHFreetypeInstance::GetFreetypeHandle(), path.string().c_str()); + + // Compile a font asset + auto* fontAsset = CompileFontToMemory(fontHandle); + + // No path to binary format + if (!fontAsset) + return {}; + + CompileFontToBinary(path, *fontAsset); + + return {}; + } + + /***************************************************************************/ + /*! + + \brief + This function takes in a font handle and generates a font asset from it. + It first geneates an atlas and all relevant data before creating the + asset. + + \param fontHandle + MSDF font handle required to initialize member variables in SHFontAsset. + + \return + A pointer to a brand new font asset. + + */ + /***************************************************************************/ + SHADE::SHFontAsset const* SHFontCompiler::CompileFontToMemory(msdfgen::FontHandle* fontHandle) noexcept + { + // Individual glyph geometry + std::vector glyphData; + + // Actual bitmap data + msdfgen::Bitmap fontBitmap; + + // Font geometry required to get advance + msdf_atlas::FontGeometry fontGeometry (&glyphData); + + // Load char set + fontGeometry.loadCharset(fontHandle, 1.0, msdf_atlas::Charset::ASCII); + + // Apply MSDF edge coloring + const double maxCornerAngle = 3.0; + for (msdf_atlas::GlyphGeometry& glyph : glyphData) + glyph.edgeColoring(&msdfgen::edgeColoringInkTrap, maxCornerAngle, 0); + + // configure parameters for atlas generation + msdf_atlas::TightAtlasPacker atlasPacker; + atlasPacker.setDimensionsConstraint(msdf_atlas::TightAtlasPacker::DimensionsConstraint::SQUARE); + + atlasPacker.setMinimumScale(64.0); + atlasPacker.setPixelRange(2.0); + atlasPacker.setMiterLimit(1.0); + atlasPacker.pack(glyphData.data(), static_cast(glyphData.size())); + + // Get the dimensions after applying parameters + int width = 0, height = 0; + atlasPacker.getDimensions(width, height); + + // generate the atlas + msdf_atlas::ImmediateAtlasGenerator> generator(width, height); + msdf_atlas::GeneratorAttributes genAttribs; + generator.setAttributes(genAttribs); + generator.setThreadCount(4); + generator.generate(glyphData.data(), static_cast(glyphData.size())); + + fontBitmap = std::move(((msdfgen::Bitmap&&)generator.atlasStorage())); + + // at this point we have all the required data to initialize a font asset. + + // Dynamically allocate new asset + SHFontAsset* newAsset = new SHFontAsset(); + + // Now we populate it with data + WriteToFontAsset(newAsset, glyphData, fontBitmap, fontGeometry); + + return newAsset; + } + + std::string SHFontCompiler::CompileFontToBinary(AssetPath path, SHFontAsset const& asset) noexcept + { + std::string newPath{ path.string() }; + newPath = newPath.substr(0, newPath.find_last_of('.')); + newPath += SHADER_BUILT_IN_EXTENSION.data(); + + std::ofstream file{ newPath, std::ios::binary | std::ios::out | std::ios::trunc }; + + //file.write( + // reinterpret_cast(&data.shaderType), sizeof(uint8_t) + //); + + //size_t const byteCount = sizeof(uint32_t) * data.spirvBinary.size(); + + //file.write( + // reinterpret_cast(&byteCount), sizeof(size_t) + //); + + //file.write( + // reinterpret_cast(data.spirvBinary.data()), byteCount + //); + + file.close(); + + return newPath; + } + +} \ No newline at end of file diff --git a/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.h b/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.h new file mode 100644 index 00000000..c5e68aa6 --- /dev/null +++ b/SHADE_Engine/src/Assets/Libraries/Compilers/SHFontCompiler.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Assets/SHAssetMacros.h" +#include "msdf-atlas-gen/msdf-atlas-gen.h" + + +namespace SHADE +{ + class SHFontAsset; + + class SHFontCompiler + { + private: + static void WriteToFontAsset (SHFontAsset* fontAsset, std::vector const& glyphData, msdfgen::Bitmap const& fontBitmap, msdf_atlas::FontGeometry const& fontGeometry) noexcept; + + public: + static std::optional LoadAndCompileFont (AssetPath path) noexcept; + static SHFontAsset const* CompileFontToMemory (msdfgen::FontHandle* fontHandle) noexcept; + static std::string CompileFontToBinary (AssetPath path, SHFontAsset const& asset) noexcept; + + }; +} diff --git a/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.cpp b/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.cpp new file mode 100644 index 00000000..93de789b --- /dev/null +++ b/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.cpp @@ -0,0 +1,25 @@ +#include "SHpch.h" +#include "SHFontLoader.h" +#include "Assets/Asset Types/SHFontAsset.h" +#include "Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h" + +namespace SHADE +{ + SHADE::SHAssetData* SHFontLoader::Load(AssetPath path) + { + return nullptr; + } + + void SHFontLoader::Write(SHAssetData const* data, AssetPath path) + { + /* + Stuff to write to binary file : + - Interleaved per character data + - codepoint (actual character) + - 4x4 Matrix data (stores UV transform + extra data) + - Actual atlas texture + */ + + } + +} \ No newline at end of file diff --git a/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.h b/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.h new file mode 100644 index 00000000..7221d2f2 --- /dev/null +++ b/SHADE_Engine/src/Assets/Libraries/Loaders/SHFontLoader.h @@ -0,0 +1,24 @@ +/*************************************************************************//** + * \file SHSFontLoader.h + * \author Loh Xiao Qi + * \date 23 10 2022 + * \brief + * + * Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or + * disclosure of this file or its contents without the prior written consent + * of DigiPen Institute of Technology is prohibited. + *****************************************************************************/ + +#pragma once + +#include "Assets/Libraries/Loaders/SHAssetLoader.h" + +namespace SHADE +{ + struct SHFontLoader : SHAssetLoader + { + + SHAssetData* Load(AssetPath path) override; + void Write(SHAssetData const* data, AssetPath path) override; + }; +} diff --git a/SHADE_Engine/src/Assets/SHAssetMacros.h b/SHADE_Engine/src/Assets/SHAssetMacros.h index 92c4b69e..b89fcb07 100644 --- a/SHADE_Engine/src/Assets/SHAssetMacros.h +++ b/SHADE_Engine/src/Assets/SHAssetMacros.h @@ -79,7 +79,8 @@ constexpr std::string_view META_EXTENSION {".shmeta"}; constexpr std::string_view AUDIO_EXTENSION {".ogg"}; constexpr std::string_view AUDIO_WAV_EXTENSION {".wav"}; constexpr std::string_view SHADER_EXTENSION{ ".shshader" }; -constexpr std::string_view SHADER_BUILT_IN_EXTENSION{".shshaderb"}; +constexpr std::string_view SHADER_BUILT_IN_EXTENSION{ ".shshaderb" }; +constexpr std::string_view FONT_EXTENSION{ ".shfont" }; constexpr std::string_view SCRIPT_EXTENSION {".cs"}; constexpr std::string_view SCENE_EXTENSION {".shade"}; constexpr std::string_view PREFAB_EXTENSION {".shprefab"}; @@ -90,7 +91,8 @@ constexpr std::string_view MODEL_EXTENSION {".shmodel"}; constexpr std::string_view EXTENSIONS[] = { AUDIO_EXTENSION, SHADER_EXTENSION, - SHADER_BUILT_IN_EXTENSION, + SHADER_BUILT_IN_EXTENSION, + FONT_EXTENSION, MATERIAL_EXTENSION, TEXTURE_EXTENSION, MODEL_EXTENSION, diff --git a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp index af2d5517..c18f0c8c 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp @@ -117,16 +117,22 @@ namespace SHADE auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); scriptEngine->GenerateScriptsCsProjFile(); } + ImGui::BeginDisabled(SHSystemManager::GetSystem()->editorState != SHEditor::State::STOP); if (ImGui::Selectable("Build Scripts - Debug")) { auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); scriptEngine->BuildScriptAssembly(true, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); } if (ImGui::Selectable("Build Scripts - Release")) { auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - scriptEngine->BuildScriptAssembly(false, true); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); + scriptEngine->BuildScriptAssembly(false, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); } + ImGui::EndDisabled(); ImGui::EndMenu(); } diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 573c7f7f..26befb28 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -42,6 +42,7 @@ of DigiPen Institute of Technology is prohibited. #include "Graphics/SHVkUtil.h" #include "Graphics/RenderGraph/SHRenderGraphNodeCompute.h" #include "../Meshes/SHPrimitiveGenerator.h" +#include "Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h" namespace SHADE { @@ -310,6 +311,8 @@ namespace SHADE lightingSubSystem = resourceManager.Create(); lightingSubSystem->Init(device, descPool); + + SHFreetypeInstance::Init(); } void SHGraphicsSystem::InitBuiltInResources(void) @@ -380,6 +383,7 @@ namespace SHADE void SHGraphicsSystem::Exit(void) { + SHFreetypeInstance::Exit(); } #pragma endregion INIT_EXIT diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.cpp new file mode 100644 index 00000000..6ea1bceb --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.cpp @@ -0,0 +1,7 @@ +#include "SHpch.h" +#include "SHFontAtlasData.h" + +namespace SHADE +{ + +} diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.h b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.h new file mode 100644 index 00000000..1e6e7470 --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFontAtlasData.h @@ -0,0 +1,7 @@ +#pragma once + + +namespace SHADE +{ + +} diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.cpp new file mode 100644 index 00000000..9e629020 --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.cpp @@ -0,0 +1,27 @@ +#include "SHpch.h" +#include "SHFreetypeInstance.h" +#include "msdf-atlas-gen/msdf-atlas-gen.h" +#include "msdfgen-ext.h" + +namespace SHADE +{ + + msdfgen::FreetypeHandle* SHFreetypeInstance::freetypeHandle = nullptr; + + void SHFreetypeInstance::Init(void) noexcept + { + // initialize freetype + freetypeHandle = msdfgen::initializeFreetype(); + } + + void SHFreetypeInstance::Exit(void) noexcept + { + msdfgen::deinitializeFreetype(freetypeHandle); + } + + msdfgen::FreetypeHandle* SHFreetypeInstance::GetFreetypeHandle(void) noexcept + { + return freetypeHandle; + } + +} \ No newline at end of file diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h new file mode 100644 index 00000000..4d1bed9c --- /dev/null +++ b/SHADE_Engine/src/Graphics/MiddleEnd/TextRendering/SHFreetypeInstance.h @@ -0,0 +1,23 @@ +#pragma once + +namespace msdfgen +{ + class FreetypeHandle; +} + +namespace SHADE +{ + class SHFreetypeInstance + { + private: + //! Only need this to be initialized once + static msdfgen::FreetypeHandle* freetypeHandle; + + public: + static void Init (void) noexcept; + static void Exit (void) noexcept; + + static msdfgen::FreetypeHandle* GetFreetypeHandle(void) noexcept; + + }; +} diff --git a/SHADE_Engine/src/Serialization/SHYAMLConverters.h b/SHADE_Engine/src/Serialization/SHYAMLConverters.h index af0b280b..d4b97244 100644 --- a/SHADE_Engine/src/Serialization/SHYAMLConverters.h +++ b/SHADE_Engine/src/Serialization/SHYAMLConverters.h @@ -168,7 +168,7 @@ namespace YAML case SHCollider::Type::BOX: { if (node[HalfExtents].IsDefined()) - rhs.SetBoundingBox(node[HalfExtents].as()); + rhs.SetBoundingBox(node[HalfExtents].as() * 2.0f); } break; case SHCollider::Type::SPHERE: diff --git a/TempScriptsFolder/PlayerController.cs b/TempScriptsFolder/PlayerController.cs index bcdf24d1..86ba7c98 100644 --- a/TempScriptsFolder/PlayerController.cs +++ b/TempScriptsFolder/PlayerController.cs @@ -15,7 +15,7 @@ public class PlayerController : Script TOTAL } - public RigidBody rb; + public RigidBody rb { get; set; } private Transform tranform; private Camera cam; private PickAndThrow pat;