diff --git a/Source/Engine/Networking/Drivers/ENetDriver.cpp b/Source/Engine/Networking/Drivers/ENetDriver.cpp index 0126dfd2a..517584eed 100644 --- a/Source/Engine/Networking/Drivers/ENetDriver.cpp +++ b/Source/Engine/Networking/Drivers/ENetDriver.cpp @@ -205,7 +205,7 @@ bool ENetDriver::PopEvent(NetworkEvent* eventPtr) case ENET_EVENT_TYPE_RECEIVE: eventPtr->EventType = NetworkEventType::Message; - // Acquire message and copy message data + // Acquire message and copy message data eventPtr->Message = _networkHost->CreateMessage(); eventPtr->Message.Length = event.packet->dataLength; Memory::CopyItems(eventPtr->Message.Buffer, event.packet->data, event.packet->dataLength); diff --git a/Source/Engine/Networking/Drivers/ENetDriver.h b/Source/Engine/Networking/Drivers/ENetDriver.h index 37d848ac5..a58b49bca 100644 --- a/Source/Engine/Networking/Drivers/ENetDriver.h +++ b/Source/Engine/Networking/Drivers/ENetDriver.h @@ -15,11 +15,14 @@ /// API_CLASS(Namespace="FlaxEngine.Networking", Sealed) class FLAXENGINE_API ENetDriver : public ScriptingObject, public INetworkDriver { -DECLARE_SCRIPTING_TYPE(ENetDriver); + DECLARE_SCRIPTING_TYPE(ENetDriver); public: - // [INetworkDriver] - String DriverName() override { return String("ENetDriver"); } + String DriverName() override + { + return String("ENetDriver"); + } + bool Initialize(NetworkPeer* host, const NetworkConfig& config) override; void Dispose() override; bool Listen() override; @@ -32,14 +35,12 @@ public: void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array& targets) override; private: - bool IsServer() const { return _host != nullptr && _peer == nullptr; } private: - NetworkConfig _config; NetworkPeer* _networkHost; void* _host = nullptr; diff --git a/Source/Engine/Particles/Graph/ParticleEmitterGraph.h b/Source/Engine/Particles/Graph/ParticleEmitterGraph.h index a1cc06cb9..1cbd226b8 100644 --- a/Source/Engine/Particles/Graph/ParticleEmitterGraph.h +++ b/Source/Engine/Particles/Graph/ParticleEmitterGraph.h @@ -27,7 +27,6 @@ template class ParticleEmitterGraphNode : public Base { public: - /// /// True if node is used by the particles graph (is connected to the any module input or its a enabled module). /// @@ -56,7 +55,6 @@ template class ParticleEmitterGraph : public BaseType { public: - typedef ValueType Value; enum class ModuleType @@ -68,7 +66,6 @@ public: }; protected: - // Attributes cache int32 _attrPosition; int32 _attrVelocity; @@ -84,7 +81,6 @@ protected: int32 _attrRadius; public: - /// /// The Particle Emitter Graph data version number. Used to sync the Particle Emitter Graph data with the instances state. Handles graph reloads to ensure data is valid. /// @@ -116,7 +112,6 @@ public: Array> AttributesDefaults; public: - /// /// The particles modules for Spawn context. /// @@ -175,18 +170,18 @@ public: switch (node->Type) { - // == Tools == + // == Tools == - // Get Gameplay Global + // Get Gameplay Global case GRAPH_NODE_MAKE_TYPE(7, 16): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[0]); break; } - // === Particles === + // === Particles === - // Particle Attribute + // Particle Attribute case GRAPH_NODE_MAKE_TYPE(14, 100): case GRAPH_NODE_MAKE_TYPE(14, 303): { @@ -201,7 +196,7 @@ public: static_assert(PARTICLE_EMITTER_MAX_ATTRIBUTES_REFS_PER_NODE >= 2, "Invalid node attributes count. Need more space for some data here."); break; } - // Particle Position + // Particle Position case GRAPH_NODE_MAKE_TYPE(14, 101): case GRAPH_NODE_MAKE_TYPE(14, 212): { @@ -209,62 +204,62 @@ public: USE_ATTRIBUTE(Position, Float3, 0); break; } - // Particle Lifetime + // Particle Lifetime case GRAPH_NODE_MAKE_TYPE(14, 102): { node->UsesParticleData = true; USE_ATTRIBUTE(Lifetime, Float, 0); break; } - // Particle Age + // Particle Age case GRAPH_NODE_MAKE_TYPE(14, 103): { node->UsesParticleData = true; USE_ATTRIBUTE(Age, Float, 0); break; } - // Particle Color + // Particle Color case GRAPH_NODE_MAKE_TYPE(14, 104): { node->UsesParticleData = true; USE_ATTRIBUTE(Color, Float4, 0); break; } - // Particle Velocity + // Particle Velocity case GRAPH_NODE_MAKE_TYPE(14, 105): { node->UsesParticleData = true; USE_ATTRIBUTE(Velocity, Float3, 0); break; } - // Particle Sprite Size + // Particle Sprite Size case GRAPH_NODE_MAKE_TYPE(14, 106): { node->UsesParticleData = true; USE_ATTRIBUTE(SpriteSize, Float2, 0); break; } - // Particle Mass + // Particle Mass case GRAPH_NODE_MAKE_TYPE(14, 107): { node->UsesParticleData = true; USE_ATTRIBUTE(Mass, Float, 0); break; } - // Particle Rotation + // Particle Rotation case GRAPH_NODE_MAKE_TYPE(14, 108): { node->UsesParticleData = true; USE_ATTRIBUTE(Rotation, Float3, 0); break; } - // Particle Angular Velocity + // Particle Angular Velocity case GRAPH_NODE_MAKE_TYPE(14, 109): { USE_ATTRIBUTE(AngularVelocity, Float3, 0); break; } - // Particle Normalized Age + // Particle Normalized Age case GRAPH_NODE_MAKE_TYPE(14, 110): { node->UsesParticleData = true; @@ -272,14 +267,14 @@ public: USE_ATTRIBUTE(Lifetime, Float, 1); break; } - // Particle Mass + // Particle Mass case GRAPH_NODE_MAKE_TYPE(14, 111): { node->UsesParticleData = true; USE_ATTRIBUTE(Radius, Float, 0); break; } - // Random + // Random case GRAPH_NODE_MAKE_TYPE(14, 208): case GRAPH_NODE_MAKE_TYPE(14, 209): case GRAPH_NODE_MAKE_TYPE(14, 210): @@ -292,19 +287,19 @@ public: node->IsConstant = false; break; } - // Particle Emitter Function + // Particle Emitter Function case GRAPH_NODE_MAKE_TYPE(14, 300): node->Assets[0] = Content::LoadAsync((Guid)node->Values[0]); node->UsesParticleData = true; // TODO: analyze emitter function graph to detect if it's actually using any particle data at all (even from inputs after inline) break; - // Particle Index + // Particle Index case GRAPH_NODE_MAKE_TYPE(14, 301): node->UsesParticleData = true; break; - // === Particle Modules === + // === Particle Modules === - // Orient Sprite + // Orient Sprite case GRAPH_NODE_MAKE_TYPE(15, 201): case GRAPH_NODE_MAKE_TYPE(15, 303): { @@ -316,27 +311,27 @@ public: } break; } - // Orient Model + // Orient Model case GRAPH_NODE_MAKE_TYPE(15, 213): case GRAPH_NODE_MAKE_TYPE(15, 309): { USE_ATTRIBUTE(ModelFacingMode, Int, 0); break; } - // Update Age + // Update Age case GRAPH_NODE_MAKE_TYPE(15, 300): { USE_ATTRIBUTE(Age, Float, 0); break; } - // Gravity/Force + // Gravity/Force case GRAPH_NODE_MAKE_TYPE(15, 301): case GRAPH_NODE_MAKE_TYPE(15, 304): { USE_ATTRIBUTE(Velocity, Float3, 0); break; } - // Linear Drag + // Linear Drag case GRAPH_NODE_MAKE_TYPE(15, 310): { USE_ATTRIBUTE(Velocity, Float3, 0); @@ -347,7 +342,7 @@ public: } break; } - // Turbulence + // Turbulence case GRAPH_NODE_MAKE_TYPE(15, 311): { USE_ATTRIBUTE(Position, Float3, 0); @@ -355,7 +350,7 @@ public: USE_ATTRIBUTE(Mass, Float, 2); break; } - // Position (plane/box surface/box volume/cylinder/line/sphere/circle/disc/torus/Global SDF) + // Position (plane/box surface/box volume/cylinder/line/sphere/circle/disc/torus/Global SDF) case GRAPH_NODE_MAKE_TYPE(15, 202): case GRAPH_NODE_MAKE_TYPE(15, 203): case GRAPH_NODE_MAKE_TYPE(15, 204): @@ -371,21 +366,21 @@ public: USE_ATTRIBUTE(Position, Float3, 0); break; } - // Position (depth) + // Position (depth) case GRAPH_NODE_MAKE_TYPE(15, 212): { USE_ATTRIBUTE(Position, Float3, 0); USE_ATTRIBUTE(Lifetime, Float, 1); break; } - // Position (spiral) + // Position (spiral) case GRAPH_NODE_MAKE_TYPE(15, 214): { USE_ATTRIBUTE(Position, Float3, 0); USE_ATTRIBUTE(Velocity, Float3, 1); break; } - // Set Attribute + // Set Attribute case GRAPH_NODE_MAKE_TYPE(15, 200): case GRAPH_NODE_MAKE_TYPE(15, 302): { @@ -397,7 +392,7 @@ public: node->Attributes[0] = idx; break; } - // Set Position/Lifetime/Age/.. + // Set Position/Lifetime/Age/.. #define CASE_SET_PARTICLE_ATTRIBUTE(id0, id1, name, type) case GRAPH_NODE_MAKE_TYPE(15, id0): case GRAPH_NODE_MAKE_TYPE(15, id1): USE_ATTRIBUTE(name, type, 0); break CASE_SET_PARTICLE_ATTRIBUTE(250, 350, Position, Float3); CASE_SET_PARTICLE_ATTRIBUTE(251, 351, Lifetime, Float); @@ -414,7 +409,7 @@ public: CASE_SET_PARTICLE_ATTRIBUTE(262, 362, RibbonFacingVector, Float3); CASE_SET_PARTICLE_ATTRIBUTE(263, 363, Radius, Float); #undef CASE_SET_PARTICLE_ATTRIBUTE - // Conform to Sphere + // Conform to Sphere case GRAPH_NODE_MAKE_TYPE(15, 305): case GRAPH_NODE_MAKE_TYPE(15, 335): // Conform to Global SDF { @@ -423,14 +418,14 @@ public: USE_ATTRIBUTE(Mass, Float, 2); break; } - // Kill (sphere/box) + // Kill (sphere/box) case GRAPH_NODE_MAKE_TYPE(15, 306): case GRAPH_NODE_MAKE_TYPE(15, 307): { USE_ATTRIBUTE(Position, Float3, 0); break; } - // Collision (plane/sphere/box/cylinder/depth/Global SDF) + // Collision (plane/sphere/box/cylinder/depth/Global SDF) case GRAPH_NODE_MAKE_TYPE(15, 330): case GRAPH_NODE_MAKE_TYPE(15, 331): case GRAPH_NODE_MAKE_TYPE(15, 332): @@ -443,7 +438,7 @@ public: USE_ATTRIBUTE(Age, Float, 2); break; } - // Sprite Rendering + // Sprite Rendering case GRAPH_NODE_MAKE_TYPE(15, 400): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -452,7 +447,7 @@ public: USE_ATTRIBUTE(SpriteSize, Float2, 2); break; } - // Sort + // Sort case GRAPH_NODE_MAKE_TYPE(15, 402): { const auto sortMode = static_cast(node->Values[2].AsInt); @@ -480,7 +475,7 @@ public: } break; } - // Model Rendering + // Model Rendering case GRAPH_NODE_MAKE_TYPE(15, 403): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -490,7 +485,7 @@ public: USE_ATTRIBUTE(Scale, Float3, 2); break; } - // Ribbon Rendering + // Ribbon Rendering case GRAPH_NODE_MAKE_TYPE(15, 404): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -499,7 +494,7 @@ public: USE_ATTRIBUTE(Age, Float, 1); break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case GRAPH_NODE_MAKE_TYPE(15, 405): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -531,7 +526,6 @@ public: } public: - // [Graph] void Clear() override { @@ -623,7 +617,7 @@ public: ASSERT(!Root); Root = n; } - // Particle Modules (only if module is enabled) + // Particle Modules (only if module is enabled) else if (n->GroupID == 15 && n->Values[0].AsBool) { const auto moduleType = static_cast(n->Values[1].AsInt); diff --git a/Source/Engine/Particles/ParticleEffect.h b/Source/Engine/Particles/ParticleEffect.h index c91c22e16..aea57360c 100644 --- a/Source/Engine/Particles/ParticleEffect.h +++ b/Source/Engine/Particles/ParticleEffect.h @@ -14,10 +14,9 @@ /// API_CLASS(NoSpawn) class ParticleEffectParameter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParticleEffectParameter); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParticleEffectParameter); friend ParticleEffect; private: - ParticleEffect* _effect = nullptr; int32 _emitterIndex; int32 _paramIndex; @@ -25,7 +24,6 @@ private: void Init(ParticleEffect* effect, int32 emitterIndex, int32 paramIndex); public: - /// /// Initializes a new instance of the class. /// @@ -137,9 +135,8 @@ public: /// API_CLASS() class FLAXENGINE_API ParticleEffect : public Actor { -DECLARE_SCENE_OBJECT(ParticleEffect); + DECLARE_SCENE_OBJECT(ParticleEffect); public: - /// /// The particles simulation update modes. /// @@ -161,7 +158,7 @@ public: /// API_STRUCT() struct ParameterOverride { - DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParameterOverride); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParameterOverride); /// /// The name of the track that has overriden parameter. @@ -180,7 +177,6 @@ public: }; private: - uint64 _lastUpdateFrame; Real _lastMinDstSqr; Matrix _world; @@ -190,7 +186,6 @@ private: Array _parametersOverrides; // Cached parameter modifications to be applied to the parameters public: - /// /// The particle system to play. /// @@ -209,7 +204,6 @@ public: ScriptingObjectReference CustomViewRenderTask; public: - /// /// The particles simulation update mode. Defines how to update particles emitter. /// @@ -262,7 +256,6 @@ public: } public: - /// /// Gets the effect parameters collection. Those parameters are instanced from the that contains a linear list of emitters and every emitter has a list of own parameters. /// @@ -311,7 +304,6 @@ public: API_FUNCTION() void ResetParameters(); public: - /// /// Gets the current time position of the particle system timeline animation playback (in seconds). /// @@ -370,7 +362,6 @@ protected: #endif private: - void Update(); #if USE_EDITOR void UpdateExecuteInEditor(); @@ -381,7 +372,6 @@ private: void OnParticleSystemLoaded(); public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -400,7 +390,6 @@ public: #endif protected: - // [Actor] void EndPlay() override; void OnEnable() override; diff --git a/Source/Engine/Particles/ParticleEmitter.h b/Source/Engine/Particles/ParticleEmitter.h index fb59a39dc..57d58f2ae 100644 --- a/Source/Engine/Particles/ParticleEmitter.h +++ b/Source/Engine/Particles/ParticleEmitter.h @@ -18,9 +18,8 @@ class ParticleEmitterInstance; /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleEmitter : public ShaderAssetTypeBase { -DECLARE_BINARY_ASSET_HEADER(ParticleEmitter, ShadersSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(ParticleEmitter, ShadersSerializedVersion); public: - /// /// The loaded particle graph. /// @@ -76,7 +75,6 @@ public: #endif public: - /// /// Tries to load surface graph from the asset. /// @@ -96,7 +94,6 @@ public: #endif public: - /// /// Spawns the particles at the given location. /// @@ -172,7 +169,6 @@ public: API_FUNCTION() ParticleEffect* Spawn(Actor* parent, const Transform& transform, float duration = MAX_float, bool autoDestroy = false); public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override @@ -185,7 +181,6 @@ public: #endif protected: - // [ParticleEmitterBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/ParticleEmitterFunction.h b/Source/Engine/Particles/ParticleEmitterFunction.h index 6b468b9f3..41df28fdf 100644 --- a/Source/Engine/Particles/ParticleEmitterFunction.h +++ b/Source/Engine/Particles/ParticleEmitterFunction.h @@ -13,9 +13,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleEmitterFunction : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(ParticleEmitterFunction, 1); + DECLARE_BINARY_ASSET_HEADER(ParticleEmitterFunction, 1); public: - /// /// The loaded CPU particle function graph. /// @@ -79,7 +78,6 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/ParticleSystem.h b/Source/Engine/Particles/ParticleSystem.h index e69929059..68d3cfacb 100644 --- a/Source/Engine/Particles/ParticleSystem.h +++ b/Source/Engine/Particles/ParticleSystem.h @@ -12,9 +12,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleSystem : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(ParticleSystem, 1); + DECLARE_BINARY_ASSET_HEADER(ParticleSystem, 1); public: - /// /// The particle system timeline track data. /// @@ -100,7 +99,6 @@ public: typedef Pair EmitterParameterOverrideKey; public: - /// /// The asset data version number. Used to sync the data with the instances state. Incremented each time asset gets loaded. /// @@ -140,7 +138,6 @@ public: Array Tracks; public: - /// /// Initializes the particle system that plays a single particles emitter. This can be used only for virtual assets. /// @@ -167,7 +164,6 @@ public: #endif public: - /// /// Spawns the particles at the given location. /// @@ -237,7 +233,6 @@ public: API_FUNCTION() ParticleEffect* Spawn(Actor* parent, const Transform& transform, bool autoDestroy = false); public: - // [BinaryAsset] void InitAsVirtual() override; #if USE_EDITOR @@ -245,7 +240,6 @@ public: #endif protected: - // [ParticleSystemBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/Particles.cpp b/Source/Engine/Particles/Particles.cpp index ed5b044e2..306adee02 100644 --- a/Source/Engine/Particles/Particles.cpp +++ b/Source/Engine/Particles/Particles.cpp @@ -38,14 +38,12 @@ struct SpriteParticleVertex class SpriteParticleRenderer { public: - GPUBuffer* VB = nullptr; GPUBuffer* IB = nullptr; const static int32 VertexCount = 4; const static int32 IndexCount = 6; public: - bool Init() { if (VB) @@ -120,7 +118,6 @@ namespace ParticlesDrawCPU class ParticleManagerService : public EngineService { public: - ParticleManagerService() : EngineService(TEXT("Particle Manager"), 65) { @@ -251,7 +248,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa } #if !BUILD_RELEASE default: - CRASH; + CRASH; #endif } @@ -406,7 +403,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -420,7 +417,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -446,7 +443,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { if (ribbonModulesDrawIndicesCount[ribbonModuleIndex] == 0) @@ -504,7 +501,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -666,7 +663,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa } #if !BUILD_RELEASE default: - CRASH; + CRASH; return; #endif } @@ -691,13 +688,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa auto module = emitter->Graph.RenderModules[moduleIndex]; switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { drawCalls++; break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -717,13 +714,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -749,7 +746,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa auto module = emitter->Graph.RenderModules[moduleIndex]; switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { GPUDrawIndexedIndirectArgs indirectArgsBufferInitData{ SpriteParticleRenderer::IndexCount, 1, 0, 0, 0 }; @@ -760,7 +757,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa indirectDrawCallIndex++; break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -784,13 +781,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -809,7 +806,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -826,7 +823,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -855,13 +852,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -921,7 +918,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -935,7 +932,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -954,7 +951,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -968,7 +965,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { const auto material = (MaterialBase*)module->Assets[0].Get(); diff --git a/Source/Engine/Particles/Particles.h b/Source/Engine/Particles/Particles.h index a0290a1ae..80dc82823 100644 --- a/Source/Engine/Particles/Particles.h +++ b/Source/Engine/Particles/Particles.h @@ -20,7 +20,7 @@ class Actor; /// API_CLASS(Static) class FLAXENGINE_API Particles { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); /// /// The system for Particles update. @@ -28,7 +28,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); API_FIELD(ReadOnly) static TaskGraphSystem* System; public: - /// /// Updates the effect during next particles simulation tick. /// @@ -42,7 +41,6 @@ public: static void OnEffectDestroy(ParticleEffect* effect); public: - /// /// Draws the particles. /// @@ -51,7 +49,6 @@ public: static void DrawParticles(RenderContext& renderContext, ParticleEffect* effect); public: - /// /// Enables or disables particle buffer pooling. /// diff --git a/Source/Engine/Particles/ParticlesData.cpp b/Source/Engine/Particles/ParticlesData.cpp index e2a81bedf..bd836638e 100644 --- a/Source/Engine/Particles/ParticlesData.cpp +++ b/Source/Engine/Particles/ParticlesData.cpp @@ -71,7 +71,7 @@ bool ParticleBuffer::Init(ParticleEmitter* emitter) } #endif default: - CRASH; + CRASH; } return false; @@ -107,7 +107,7 @@ bool ParticleBuffer::AllocateSortBuffer() } #endif default: - CRASH; + CRASH; return true; } @@ -133,6 +133,6 @@ void ParticleBuffer::Clear() } #endif default: - CRASH; + CRASH; } } diff --git a/Source/Engine/Particles/ParticlesData.h b/Source/Engine/Particles/ParticlesData.h index df9b8bf21..328caa03c 100644 --- a/Source/Engine/Particles/ParticlesData.h +++ b/Source/Engine/Particles/ParticlesData.h @@ -78,7 +78,6 @@ struct ParticleAttribute class ParticleLayout { public: - /// /// The total particle data stride size (in bytes). Defines the required memory amount for a single particle. /// @@ -90,7 +89,6 @@ public: Array> Attributes; public: - /// /// Clears the layout data. /// @@ -217,7 +215,6 @@ public: class FLAXENGINE_API ParticleBuffer { public: - /// /// The emitter graph version (cached on Init). Used to discard pooled buffers that has been created for older emitter graph. /// @@ -331,7 +328,6 @@ public: } GPU; public: - /// /// Initializes a new instance of the class. /// @@ -384,12 +380,10 @@ public: struct ParticleBufferCPUDataAccessorBase { protected: - ParticleBuffer* _buffer; int32 _offset; public: - ParticleBufferCPUDataAccessorBase() : _buffer(nullptr) , _offset(-1) @@ -403,7 +397,6 @@ public: } public: - FORCE_INLINE bool IsValid() const { return _buffer != nullptr && _offset != -1; @@ -414,7 +407,6 @@ template struct ParticleBufferCPUDataAccessor : ParticleBufferCPUDataAccessorBase { public: - ParticleBufferCPUDataAccessor() { } @@ -425,7 +417,6 @@ public: } public: - FORCE_INLINE T operator[](int32 index) const { return Get(index); diff --git a/Source/Engine/Particles/ParticlesSimulation.h b/Source/Engine/Particles/ParticlesSimulation.h index 631a32367..d2181d5e5 100644 --- a/Source/Engine/Particles/ParticlesSimulation.h +++ b/Source/Engine/Particles/ParticlesSimulation.h @@ -18,7 +18,6 @@ class GPUBuffer; class FLAXENGINE_API ParticleSystemParameter : public GraphParameter { public: - ParticleSystemParameter() : GraphParameter(SpawnParams(Guid::New(), TypeInitializer)) { @@ -47,7 +46,6 @@ public: class FLAXENGINE_API ParticleEmitterInstance { public: - struct SpawnerData { /// @@ -62,7 +60,6 @@ public: }; public: - /// /// The instance data version number. Used to sync the Particle Emitter Graph data with the instance state. Handles Particle Emitter reloads to enure data is valid. /// @@ -107,7 +104,6 @@ public: ParticleBuffer* Buffer = nullptr; public: - /// /// Initializes a new instance of the class. /// @@ -138,7 +134,6 @@ public: class FLAXENGINE_API ParticleSystemInstance { public: - /// /// The instance data version number. Used to sync the Particle System data with the instance state. Handles Particle System reloads to enure data is valid. /// @@ -170,7 +165,6 @@ public: mutable GPUBuffer* GPUParticlesCountReadback = nullptr; public: - /// /// Finalizes an instance of the class. /// diff --git a/Source/Engine/Physics/Actors/PhysicsColliderActor.h b/Source/Engine/Physics/Actors/PhysicsColliderActor.h index 0e254907a..5f0fbb4b9 100644 --- a/Source/Engine/Physics/Actors/PhysicsColliderActor.h +++ b/Source/Engine/Physics/Actors/PhysicsColliderActor.h @@ -13,9 +13,8 @@ struct Collision; /// API_CLASS(Abstract) class FLAXENGINE_API PhysicsColliderActor : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(PhysicsColliderActor); + DECLARE_SCENE_OBJECT_ABSTRACT(PhysicsColliderActor); public: - /// /// Occurs when a collision start gets registered for this collider (it collides with something). /// @@ -37,7 +36,6 @@ public: API_EVENT() Delegate TriggerExit; public: - /// /// Gets the attached rigid body. /// @@ -45,7 +43,6 @@ public: API_PROPERTY() virtual RigidBody* GetAttachedRigidBody() const = 0; public: - /// /// Called when a collision start gets registered for this collider (it collides with something). /// diff --git a/Source/Engine/Physics/Actors/RigidBody.h b/Source/Engine/Physics/Actors/RigidBody.h index 1837186b1..3b99d8899 100644 --- a/Source/Engine/Physics/Actors/RigidBody.h +++ b/Source/Engine/Physics/Actors/RigidBody.h @@ -16,9 +16,8 @@ class Collider; /// API_CLASS() class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor { -DECLARE_SCENE_OBJECT(RigidBody); + DECLARE_SCENE_OBJECT(RigidBody); protected: - void* _actor; Float3 _cachedScale; @@ -40,7 +39,6 @@ protected: int32 _isUpdatingTransform : 1; public: - /// /// Enables kinematic mode for the rigidbody. /// @@ -286,7 +284,6 @@ public: API_PROPERTY() void SetConstraints(const RigidbodyConstraints value); public: - /// /// Gets the linear velocity of the rigidbody. /// @@ -374,7 +371,6 @@ public: API_PROPERTY() bool IsSleeping() const; public: - /// /// Forces a rigidbody to sleep (for at least one frame). /// @@ -508,7 +504,6 @@ public: API_FUNCTION() void ClosestPoint(const Vector3& position, API_PARAM(Out) Vector3& result) const; public: - /// /// Occurs when a collision start gets registered for this rigidbody (it collides with something). /// @@ -530,7 +525,6 @@ public: API_EVENT() Delegate TriggerExit; public: - void OnCollisionEnter(const Collision& c); void OnCollisionExit(const Collision& c); @@ -551,7 +545,6 @@ public: void UpdateScale(); public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -561,7 +554,6 @@ public: void OnActiveTransformChanged() override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Physics/Actors/SplineRopeBody.h b/Source/Engine/Physics/Actors/SplineRopeBody.h index 31d03ec2d..c19785edc 100644 --- a/Source/Engine/Physics/Actors/SplineRopeBody.h +++ b/Source/Engine/Physics/Actors/SplineRopeBody.h @@ -13,10 +13,9 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineRopeBody : public Actor { -API_AUTO_SERIALIZATION(); -DECLARE_SCENE_OBJECT(SplineRopeBody); + API_AUTO_SERIALIZATION(); + DECLARE_SCENE_OBJECT(SplineRopeBody); private: - struct Mass { Vector3 Position; @@ -30,7 +29,6 @@ private: Array _masses; public: - /// /// The target actor too attach the rope end to. If unset the rope end will run freely. /// @@ -62,11 +60,9 @@ public: float SubstepTime = 0.02f; private: - void Tick(); public: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Physics/Actors/WheeledVehicle.h b/Source/Engine/Physics/Actors/WheeledVehicle.h index b1e858eaf..ac7f34973 100644 --- a/Source/Engine/Physics/Actors/WheeledVehicle.h +++ b/Source/Engine/Physics/Actors/WheeledVehicle.h @@ -13,7 +13,7 @@ API_CLASS() class FLAXENGINE_API WheeledVehicle : public RigidBody { friend class PhysicsBackend; -DECLARE_SCENE_OBJECT(WheeledVehicle); + DECLARE_SCENE_OBJECT(WheeledVehicle); /// /// Vehicle driving mode types. @@ -33,8 +33,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct EngineSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(EngineSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(EngineSettings); + API_AUTO_SERIALIZATION(); /// /// Moment of inertia of the engine around the axis of rotation. Specified in kilograms metres-squared (kg m^2). @@ -76,8 +76,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct DifferentialSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(DifferentialSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(DifferentialSettings); + API_AUTO_SERIALIZATION(); /// /// Type of differential. @@ -120,8 +120,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct GearboxSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(GearboxSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(GearboxSettings); + API_AUTO_SERIALIZATION(); /// /// If enabled the vehicle gears will be changes automatically, otherwise it's fully manual. @@ -163,8 +163,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct Wheel : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(Wheel); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(Wheel); + API_AUTO_SERIALIZATION(); /// /// Wheel placement type. @@ -257,7 +257,7 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct WheelState { - DECLARE_SCRIPTING_TYPE_MINIMAL(WheelState); + DECLARE_SCRIPTING_TYPE_MINIMAL(WheelState); /// /// True if suspension travel limits forbid the wheel from touching the drivable surface. @@ -313,7 +313,6 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); }; private: - struct WheelData { Collider* Collider; @@ -331,7 +330,6 @@ private: GearboxSettings _gearbox; public: - /// /// If checked, the negative throttle value will be used as brake and reverse to behave in a more arcade style where holding reverse also functions as brake. Disable it for more realistic driving controls. /// @@ -395,7 +393,6 @@ public: API_PROPERTY() void SetGearbox(const GearboxSettings& value); public: - /// /// Sets the input for vehicle throttle. It is the analog accelerator pedal value in range (0,1) where 1 represents the pedal fully pressed and 0 represents the pedal in its rest state. /// @@ -426,7 +423,6 @@ public: API_FUNCTION() void ClearInput(); public: - /// /// Gets the current forward vehicle movement speed (along forward vector of the actor transform). /// @@ -475,13 +471,11 @@ public: API_FUNCTION() void Setup(); private: - #if USE_EDITOR void DrawPhysicsDebug(RenderView& view); #endif public: - // [Vehicle] #if USE_EDITOR void OnDebugDrawSelected() override; diff --git a/Source/Engine/Physics/Colliders/BoxCollider.h b/Source/Engine/Physics/Colliders/BoxCollider.h index 965033661..d49ae33bd 100644 --- a/Source/Engine/Physics/Colliders/BoxCollider.h +++ b/Source/Engine/Physics/Colliders/BoxCollider.h @@ -11,14 +11,12 @@ /// API_CLASS() class FLAXENGINE_API BoxCollider : public Collider { -DECLARE_SCENE_OBJECT(BoxCollider); + DECLARE_SCENE_OBJECT(BoxCollider); private: - Float3 _size; OrientedBoundingBox _bounds; public: - /// /// Gets the size of the box, measured in the object's local space. /// @@ -48,7 +46,6 @@ public: } public: - // [Collider] #if USE_EDITOR void OnDebugDraw() override; @@ -59,7 +56,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] void UpdateBounds() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/CapsuleCollider.h b/Source/Engine/Physics/Colliders/CapsuleCollider.h index 116cc645a..f62bd4154 100644 --- a/Source/Engine/Physics/Colliders/CapsuleCollider.h +++ b/Source/Engine/Physics/Colliders/CapsuleCollider.h @@ -14,15 +14,13 @@ /// API_CLASS() class FLAXENGINE_API CapsuleCollider : public Collider { -DECLARE_SCENE_OBJECT(CapsuleCollider); + DECLARE_SCENE_OBJECT(CapsuleCollider); private: - float _radius; float _height; OrientedBoundingBox _orientedBox; public: - /// /// Gets the radius of the sphere, measured in the object's local space. /// @@ -64,7 +62,6 @@ public: API_PROPERTY() void SetHeight(float value); public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -74,7 +71,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] void UpdateBounds() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/CharacterController.h b/Source/Engine/Physics/Colliders/CharacterController.h index 2961fcd05..8087d61e8 100644 --- a/Source/Engine/Physics/Colliders/CharacterController.h +++ b/Source/Engine/Physics/Colliders/CharacterController.h @@ -11,9 +11,8 @@ /// API_CLASS() class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor { -DECLARE_SCENE_OBJECT(CharacterController); + DECLARE_SCENE_OBJECT(CharacterController); public: - /// /// Specifies which sides a character is colliding with. /// @@ -57,7 +56,6 @@ public: }; private: - void* _controller; float _stepOffset; float _slopeLimit; @@ -148,7 +146,6 @@ public: API_PROPERTY() void SetMinMoveDistance(float value); public: - /// /// Gets the linear velocity of the Character Controller. This allows tracking how fast the character is actually moving, for instance when it is stuck at a wall this value will be the near zero vector. /// @@ -165,7 +162,6 @@ public: API_PROPERTY() CollisionFlags GetFlags() const; public: - /// /// Moves the character with the given speed. Gravity is automatically applied. It will slide along colliders. Result collision flags is the summary of collisions that occurred during the Move. /// @@ -181,7 +177,6 @@ public: API_FUNCTION() CollisionFlags Move(const Vector3& displacement); protected: - /// /// Creates the physics actor. /// @@ -198,7 +193,6 @@ protected: void UpdateSize() const; public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -216,7 +210,6 @@ public: void* GetPhysicsActor() const override; protected: - // [PhysicsActor] void UpdateGeometry() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/Collider.h b/Source/Engine/Physics/Colliders/Collider.h index ecbb7746c..8bc3301e4 100644 --- a/Source/Engine/Physics/Colliders/Collider.h +++ b/Source/Engine/Physics/Colliders/Collider.h @@ -17,9 +17,8 @@ class RigidBody; /// API_CLASS(Abstract) class FLAXENGINE_API Collider : public PhysicsColliderActor { -DECLARE_SCENE_OBJECT_ABSTRACT(Collider); + DECLARE_SCENE_OBJECT_ABSTRACT(Collider); protected: - Vector3 _center; bool _isTrigger; void* _shape; @@ -30,7 +29,6 @@ protected: Quaternion _cachedLocalPoseRot; public: - /// /// Gets the native physics backend object. /// @@ -97,7 +95,6 @@ public: AssetReference Material; public: - /// /// Performs a raycast against this collider shape. /// @@ -146,7 +143,6 @@ public: API_FUNCTION() static bool ComputePenetration(const Collider* colliderA, const Collider* colliderB, API_PARAM(Out) Vector3& direction, API_PARAM(Out) float& distance); public: - /// /// Determines whether this collider can be attached the specified rigid body. /// @@ -167,7 +163,6 @@ public: void Attach(RigidBody* rigidBody); protected: - /// /// Updates the shape actor collisions/queries layer mask bits. /// @@ -209,18 +204,15 @@ protected: #endif private: - void OnMaterialChanged(); public: - // [PhysicsColliderActor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; RigidBody* GetAttachedRigidBody() const override; protected: - // [PhysicsColliderActor] #if USE_EDITOR void OnEnable() override; diff --git a/Source/Engine/Physics/Colliders/MeshCollider.h b/Source/Engine/Physics/Colliders/MeshCollider.h index 6faddf41d..a12746623 100644 --- a/Source/Engine/Physics/Colliders/MeshCollider.h +++ b/Source/Engine/Physics/Colliders/MeshCollider.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API MeshCollider : public Collider { -DECLARE_SCENE_OBJECT(MeshCollider); + DECLARE_SCENE_OBJECT(MeshCollider); public: - /// /// Linked collision data asset that contains convex mesh or triangle mesh used to represent a mesh collider shape. /// @@ -22,12 +21,10 @@ public: AssetReference CollisionData; private: - void OnCollisionDataChanged(); void OnCollisionDataLoaded(); public: - // [Collider] bool CanAttach(RigidBody* rigidBody) const override; bool CanBeTrigger() const override; @@ -39,7 +36,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/Colliders/SphereCollider.h b/Source/Engine/Physics/Colliders/SphereCollider.h index fa37195b9..1638300ff 100644 --- a/Source/Engine/Physics/Colliders/SphereCollider.h +++ b/Source/Engine/Physics/Colliders/SphereCollider.h @@ -10,13 +10,11 @@ /// API_CLASS() class FLAXENGINE_API SphereCollider : public Collider { -DECLARE_SCENE_OBJECT(SphereCollider); + DECLARE_SCENE_OBJECT(SphereCollider); private: - float _radius; public: - /// /// Gets the radius of the sphere, measured in the object's local space. /// @@ -38,7 +36,6 @@ public: API_PROPERTY() void SetRadius(float value); public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -48,7 +45,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/Colliders/SplineCollider.h b/Source/Engine/Physics/Colliders/SplineCollider.h index d254a7667..526040471 100644 --- a/Source/Engine/Physics/Colliders/SplineCollider.h +++ b/Source/Engine/Physics/Colliders/SplineCollider.h @@ -15,7 +15,7 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineCollider : public Collider { -DECLARE_SCENE_OBJECT(SplineCollider); + DECLARE_SCENE_OBJECT(SplineCollider); private: Spline* _spline = nullptr; void* _triangleMesh = nullptr; @@ -24,7 +24,6 @@ private: Transform _preTransform = Transform::Identity; public: - /// /// Linked collision data asset that contains convex mesh or triangle mesh used to represent a spline collider shape. /// @@ -50,13 +49,11 @@ public: void ExtractGeometry(Array& vertexBuffer, Array& indexBuffer) const; private: - void OnCollisionDataChanged(); void OnCollisionDataLoaded(); void OnSplineUpdated(); public: - // [Collider] bool CanAttach(RigidBody* rigidBody) const override; bool CanBeTrigger() const override; @@ -70,7 +67,6 @@ public: void EndPlay() override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/CollisionData.h b/Source/Engine/Physics/CollisionData.h index 02b95e762..458c6577d 100644 --- a/Source/Engine/Physics/CollisionData.h +++ b/Source/Engine/Physics/CollisionData.h @@ -94,7 +94,7 @@ DECLARE_ENUM_OPERATORS(ConvexMeshGenerationFlags); /// API_STRUCT() struct CollisionDataOptions { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); /// /// The data type. @@ -137,9 +137,8 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); /// API_CLASS(NoSpawn) class FLAXENGINE_API CollisionData : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(CollisionData, 1); + DECLARE_BINARY_ASSET_HEADER(CollisionData, 1); public: - /// /// A raw structure stored in the binary asset. It has fixed size so it's easier to add new parameters to it. It's loaded and changed into Options structure used at runtime. /// @@ -157,13 +156,11 @@ public: static_assert(sizeof(SerializedOptions) == 128, "Invalid collision data options size. Change the padding."); private: - CollisionDataOptions _options; void* _convexMesh; void* _triangleMesh; public: - /// /// Gets the options. /// @@ -189,7 +186,6 @@ public: } public: - #if COMPILE_WITH_PHYSICS_COOKING /// @@ -268,7 +264,6 @@ public: API_FUNCTION() void ExtractGeometry(API_PARAM(Out) Array& vertexBuffer, API_PARAM(Out) Array& indexBuffer) const; public: - // MeshCollider is drawing debug view of the collision data, allow to share it across instances #if USE_EDITOR private: @@ -282,11 +277,9 @@ public: #endif private: - LoadResult load(const SerializedOptions* options, byte* dataPtr, int32 dataSize); protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Physics/Collisions.h b/Source/Engine/Physics/Collisions.h index 53531b975..3e6ffc5af 100644 --- a/Source/Engine/Physics/Collisions.h +++ b/Source/Engine/Physics/Collisions.h @@ -11,7 +11,7 @@ class PhysicsColliderActor; /// API_STRUCT() struct FLAXENGINE_API ContactPoint { -DECLARE_SCRIPTING_TYPE_MINIMAL(ContactPoint); + DECLARE_SCRIPTING_TYPE_MINIMAL(ContactPoint); /// /// The contact point location in the world space. @@ -43,7 +43,7 @@ struct TIsPODType /// API_STRUCT() struct FLAXENGINE_API Collision { -DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); + DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); /// /// The first collider (this instance). @@ -84,7 +84,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); API_FIELD(Private, NoArray) ContactPoint Contacts[COLLISION_NAX_CONTACT_POINTS]; public: - /// /// Gets the relative linear velocity of the two colliding objects. /// diff --git a/Source/Engine/Physics/Joints/D6Joint.h b/Source/Engine/Physics/Joints/D6Joint.h index a348a9cd6..66819bb0b 100644 --- a/Source/Engine/Physics/Joints/D6Joint.h +++ b/Source/Engine/Physics/Joints/D6Joint.h @@ -124,7 +124,7 @@ API_ENUM() enum class D6JointDriveType /// API_STRUCT() struct D6JointDrive { -DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); + DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); /// /// The spring strength. Force proportional to the position error. @@ -147,7 +147,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); API_FIELD() bool Acceleration = false; public: - bool operator==(const D6JointDrive& other) const { return Stiffness == other.Stiffness && Damping == other.Damping && ForceLimit == other.ForceLimit && Acceleration == other.Acceleration; @@ -163,9 +162,8 @@ public: /// API_CLASS() class FLAXENGINE_API D6Joint : public Joint { -DECLARE_SCENE_OBJECT(D6Joint); + DECLARE_SCENE_OBJECT(D6Joint); private: - D6JointMotion _motion[static_cast(D6JointAxis::MAX)]; D6JointDrive _drive[static_cast(D6JointDriveType::MAX)]; LimitLinear _limitLinear; @@ -173,7 +171,6 @@ private: LimitConeRange _limitSwing; public: - /// /// Gets the motion type around the specified axis. /// @@ -215,7 +212,6 @@ public: API_FUNCTION() void SetDrive(const D6JointDriveType index, const D6JointDrive& value); public: - /// /// Determines the linear limit used for constraining translation degrees of freedom. /// @@ -259,7 +255,6 @@ public: API_PROPERTY() void SetLimitSwing(const LimitConeRange& value); public: - /// /// Gets the drive's target position relative to the joint's first body. /// @@ -301,7 +296,6 @@ public: API_PROPERTY() void SetDriveAngularVelocity(const Vector3& value); public: - /// /// Gets the twist angle of the joint (in the range (-2*Pi, 2*Pi]). /// @@ -318,7 +312,6 @@ public: API_PROPERTY() float GetCurrentSwingZ() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -327,7 +320,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/DistanceJoint.h b/Source/Engine/Physics/Joints/DistanceJoint.h index de7071a62..cb31b8215 100644 --- a/Source/Engine/Physics/Joints/DistanceJoint.h +++ b/Source/Engine/Physics/Joints/DistanceJoint.h @@ -39,9 +39,8 @@ DECLARE_ENUM_OPERATORS(DistanceJointFlag); /// API_CLASS() class FLAXENGINE_API DistanceJoint : public Joint { -DECLARE_SCENE_OBJECT(DistanceJoint); + DECLARE_SCENE_OBJECT(DistanceJoint); private: - DistanceJointFlag _flags; float _minDistance; float _maxDistance; @@ -49,7 +48,6 @@ private: SpringParameters _spring; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -139,14 +137,12 @@ public: API_PROPERTY() void SetSpringParameters(const SpringParameters& value); public: - /// /// Gets the current distance of the joint. /// API_PROPERTY() float GetCurrentDistance() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -155,7 +151,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/FixedJoint.h b/Source/Engine/Physics/Joints/FixedJoint.h index d689fa195..9e6280023 100644 --- a/Source/Engine/Physics/Joints/FixedJoint.h +++ b/Source/Engine/Physics/Joints/FixedJoint.h @@ -10,16 +10,14 @@ /// API_CLASS() class FLAXENGINE_API FixedJoint : public Joint { -DECLARE_SCENE_OBJECT(FixedJoint); + DECLARE_SCENE_OBJECT(FixedJoint); public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; #endif protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/HingeJoint.h b/Source/Engine/Physics/Joints/HingeJoint.h index dcf2d2991..14e3198e5 100644 --- a/Source/Engine/Physics/Joints/HingeJoint.h +++ b/Source/Engine/Physics/Joints/HingeJoint.h @@ -33,7 +33,7 @@ DECLARE_ENUM_OPERATORS(HingeJointFlag); /// API_STRUCT() struct HingeJointDrive { -DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); + DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); /// /// Target velocity of the joint. @@ -57,7 +57,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); API_FIELD() bool FreeSpin = false; public: - /// /// Compares two objects. /// @@ -78,15 +77,13 @@ public: /// API_CLASS() class FLAXENGINE_API HingeJoint : public Joint { -DECLARE_SCENE_OBJECT(HingeJoint); + DECLARE_SCENE_OBJECT(HingeJoint); private: - HingeJointFlag _flags; LimitAngularRange _limit; HingeJointDrive _drive; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -142,7 +139,6 @@ public: API_PROPERTY() void SetDrive(const HingeJointDrive& value); public: - /// /// Gets the current angle of the joint (in radians, in the range (-Pi, Pi]). /// @@ -154,7 +150,6 @@ public: API_PROPERTY() float GetCurrentVelocity() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -163,7 +158,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/Joint.h b/Source/Engine/Physics/Joints/Joint.h index 7d2ef20c4..6e2d7ac4c 100644 --- a/Source/Engine/Physics/Joints/Joint.h +++ b/Source/Engine/Physics/Joints/Joint.h @@ -18,9 +18,8 @@ class IPhysicsActor; /// API_CLASS(Abstract) class FLAXENGINE_API Joint : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(Joint); + DECLARE_SCENE_OBJECT_ABSTRACT(Joint); protected: - void* _joint; float _breakForce; float _breakTorque; @@ -30,7 +29,6 @@ protected: bool _enableAutoAnchor = false; public: - /// /// The target actor for the joint. It has to be IPhysicsActor type (eg. RigidBody or CharacterController). /// @@ -131,7 +129,6 @@ public: API_PROPERTY() void SetTargetAnchorRotation(const Quaternion& value); public: - /// /// Gets the native physics backend object. /// @@ -174,7 +171,6 @@ public: virtual void OnJointBreak(); protected: - Vector3 GetTargetPosition() const; Quaternion GetTargetOrientation() const; virtual void* CreateJoint(const struct PhysicsJointDesc& desc) = 0; @@ -183,13 +179,11 @@ protected: #endif private: - void Delete(); void SetActors(); void OnTargetChanged(); public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -198,7 +192,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Physics/Joints/Limits.h b/Source/Engine/Physics/Joints/Limits.h index cda2ceb48..65247567e 100644 --- a/Source/Engine/Physics/Joints/Limits.h +++ b/Source/Engine/Physics/Joints/Limits.h @@ -10,7 +10,7 @@ /// API_STRUCT() struct SpringParameters { -DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); + DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); /// /// The spring strength. Force proportional to the position error. @@ -23,7 +23,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); API_FIELD() float Damping; public: - /// /// Constructs a spring with no force. /// @@ -45,7 +44,6 @@ public: } public: - bool operator==(const SpringParameters& other) const { return Stiffness == other.Stiffness && Damping == other.Damping; @@ -57,7 +55,7 @@ public: /// API_STRUCT() struct LimitLinearRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -85,7 +83,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); API_FIELD() float Upper = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -122,7 +119,6 @@ public: } public: - bool operator==(const LimitLinearRange& other) const { return Lower == other.Lower && Upper == other.Upper && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -134,7 +130,7 @@ public: /// API_STRUCT() struct LimitLinear { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -157,7 +153,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); API_FIELD() float Extent = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -190,7 +185,6 @@ public: } public: - bool operator==(const LimitLinear& other) const { return Extent == other.Extent && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -202,7 +196,7 @@ public: /// API_STRUCT() struct LimitAngularRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -230,7 +224,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); API_FIELD() float Upper = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -267,7 +260,6 @@ public: } public: - bool operator==(const LimitAngularRange& other) const { return Lower == other.Lower && Upper == other.Upper && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -279,7 +271,7 @@ public: /// API_STRUCT() struct LimitConeRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -307,7 +299,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); API_FIELD(Attributes="Limit(0.0f, 180.0f)") float ZLimitAngle = 90.0f; public: - /// /// Constructs a limit with a 45 degree cone. /// @@ -344,7 +335,6 @@ public: } public: - bool operator==(const LimitConeRange& other) const { return YLimitAngle == other.YLimitAngle && ZLimitAngle == other.ZLimitAngle && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; diff --git a/Source/Engine/Physics/Joints/SliderJoint.h b/Source/Engine/Physics/Joints/SliderJoint.h index ea39a17cb..b909ee925 100644 --- a/Source/Engine/Physics/Joints/SliderJoint.h +++ b/Source/Engine/Physics/Joints/SliderJoint.h @@ -29,14 +29,12 @@ DECLARE_ENUM_OPERATORS(SliderJointFlag); /// API_CLASS() class FLAXENGINE_API SliderJoint : public Joint { -DECLARE_SCENE_OBJECT(SliderJoint); + DECLARE_SCENE_OBJECT(SliderJoint); private: - SliderJointFlag _flags; LimitLinearRange _limit; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -72,7 +70,6 @@ public: API_PROPERTY() void SetLimit(const LimitLinearRange& value); public: - /// /// Gets the current displacement of the joint along its axis. /// @@ -84,7 +81,6 @@ public: API_PROPERTY() float GetCurrentVelocity() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -93,7 +89,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/SphericalJoint.h b/Source/Engine/Physics/Joints/SphericalJoint.h index 39ec10445..328575fa2 100644 --- a/Source/Engine/Physics/Joints/SphericalJoint.h +++ b/Source/Engine/Physics/Joints/SphericalJoint.h @@ -31,14 +31,12 @@ DECLARE_ENUM_OPERATORS(SphericalJointFlag); /// API_CLASS() class FLAXENGINE_API SphericalJoint : public Joint { -DECLARE_SCENE_OBJECT(SphericalJoint); + DECLARE_SCENE_OBJECT(SphericalJoint); private: - SphericalJointFlag _flags; LimitConeRange _limit; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -74,7 +72,6 @@ public: API_PROPERTY() void SetLimit(const LimitConeRange& value); public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -83,7 +80,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h b/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h index d871591b4..964c1c97e 100644 --- a/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h +++ b/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h @@ -14,7 +14,6 @@ class MultiThreadStepper; class PhysicsStepper { public: - PhysicsStepper() { } @@ -24,7 +23,6 @@ public: } public: - virtual bool advance(PxScene* scene, PxReal dt, void* scratchBlock, PxU32 scratchBlockSize) = 0; virtual void wait(PxScene* scene) = 0; virtual void substepStrategy(const PxReal stepSize, PxU32& substepCount, PxReal& substepSize) = 0; @@ -41,7 +39,6 @@ public: class StepperTask : public PxLightCpuTask { public: - void setStepper(MultiThreadStepper* stepper) { mStepper = stepper; @@ -58,7 +55,6 @@ public: } public: - // [PxLightCpuTask] const char* getName() const override { @@ -68,7 +64,6 @@ public: void run() override; protected: - MultiThreadStepper* mStepper = nullptr; }; @@ -79,7 +74,6 @@ protected: class StepperTaskSimulate : public StepperTask { public: - /// /// Initializes a new instance of the class. /// @@ -88,7 +82,6 @@ public: } public: - // [StepperTask] void run() override; }; @@ -96,7 +89,6 @@ public: class MultiThreadStepper : public PhysicsStepper { public: - MultiThreadStepper() : mFirstCompletionPending(false) , mScene(nullptr) @@ -135,7 +127,6 @@ public: } protected: - void substep(StepperTask& completionTask); // we need two completion tasks because when multistepping we can't submit completion0 from the @@ -170,13 +161,11 @@ protected: class FixedStepper : public MultiThreadStepper { protected: - PxReal mAccumulator; PxReal mFixedSubStepSize; PxU32 mMaxSubSteps; public: - /// /// Initializes a new instance of the class. /// @@ -189,7 +178,6 @@ public: } public: - /// /// Setups the specified step size and the maximum amount of them. /// @@ -202,7 +190,6 @@ public: } public: - // [MultiThreadStepper] void substepStrategy(const PxReal stepSize, PxU32& substepCount, PxReal& substepSize) override; diff --git a/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h b/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h index c6f3019c5..e0f16d140 100644 --- a/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h +++ b/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h @@ -17,7 +17,6 @@ class SimulationEventCallback : public PxSimulationEventCallback { public: - typedef Pair CollidersPair; typedef Dictionary CollisionsPool; @@ -57,7 +56,6 @@ public: Array BrokenJoints; public: - /// /// Clears the data. /// @@ -98,7 +96,6 @@ public: void OnJointRemoved(Joint* joint); public: - // [PxSimulationEventCallback] void onConstraintBreak(PxConstraintInfo* constraints, PxU32 count) override; void onWake(PxActor** actors, PxU32 count) override; diff --git a/Source/Engine/Physics/PhysicalMaterial.h b/Source/Engine/Physics/PhysicalMaterial.h index ed7b0829a..0d8356546 100644 --- a/Source/Engine/Physics/PhysicalMaterial.h +++ b/Source/Engine/Physics/PhysicalMaterial.h @@ -10,14 +10,12 @@ /// API_CLASS() class FLAXENGINE_API PhysicalMaterial final : public ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicalMaterial); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicalMaterial); private: - void* _material; public: - /// /// Initializes a new instance of the class. /// @@ -29,7 +27,6 @@ public: ~PhysicalMaterial(); public: - /// /// The friction value of surface, controls how easily things can slide on this surface. /// @@ -73,7 +70,6 @@ public: float Density = 1000.0f; public: - /// /// Gets the PhysX material. /// diff --git a/Source/Engine/Physics/PhysicsSettings.h b/Source/Engine/Physics/PhysicsSettings.h index 799b6ffde..63649cc8b 100644 --- a/Source/Engine/Physics/PhysicsSettings.h +++ b/Source/Engine/Physics/PhysicsSettings.h @@ -11,9 +11,8 @@ /// API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings", NoConstructor) class FLAXENGINE_API PhysicsSettings : public SettingsBase { -DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsSettings); + DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsSettings); public: - /// /// The default gravity force value (in cm^2/s). /// @@ -93,14 +92,12 @@ public: bool SupportCookingAtRuntime = false; public: - /// /// The collision layers masks. Used to define layer-based collision detection. /// uint32 LayerMasks[32]; public: - /// /// Initializes a new instance of the class. ///