LeviLamina
Loading...
Searching...
No Matches
ParticleMotionCollisionComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/particlesystem/particle/components/ParticleMotionComponentBase.h"
7#include "mc/deps/core/math/Vec3.h"
8#include "mc/deps/core/string/HashedString.h"
9#include "mc/util/molang/ExpressionNode.h"
10
11// auto generated forward declare list
12// clang-format off
13class AABB;
14class RenderParams;
16namespace Json { class Value; }
17namespace ParticleSystem { class ComponentAccessParticleEmitter; }
18namespace ParticleSystem { struct CommonParticle; }
19namespace SharedTypes::v1_20_80 { struct ParticleEffectComponent; }
20// clang-format on
21
22namespace ParticleSystem {
23
24class ParticleMotionCollisionComponent : public ::ParticleSystem::ParticleMotionComponentBase {
25public:
26 // ParticleMotionCollisionComponent inner types declare
27 // clang-format off
28 struct SweepResult;
29 // clang-format on
30
31 // ParticleMotionCollisionComponent inner types define
32 struct SweepResult {
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<4, 12, ::Vec3> mFrom;
37 ::ll::TypedStorage<4, 12, ::Vec3> mTo;
38 ::ll::TypedStorage<4, 12, ::Vec3> mVelocity;
39 ::ll::TypedStorage<4, 12, ::Vec3> mIntersectionNorm;
40 ::ll::TypedStorage<1, 1, bool> mHit;
41 // NOLINTEND
42 };
43
44public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<8, 16, ::ExpressionNode> mCollisionEnabledExpr;
48 ::ll::TypedStorage<4, 4, float> mCollisionDrag;
49 ::ll::TypedStorage<4, 4, float> mCoefficientOfRestitution;
50 ::ll::TypedStorage<4, 12, ::Vec3> mCollisionRadius;
51 ::ll::TypedStorage<1, 1, bool> mExpireOnContact;
52 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<float, ::HashedString>>> mCollisionEvents;
53 // NOLINTEND
54
55public:
56 // virtual functions
57 // NOLINTBEGIN
58 virtual void initializeFromData(::SharedTypes::v1_20_80::ParticleEffectComponent& data) /*override*/;
59
60 virtual void upgradeToSharedTypes(::SharedTypes::v1_20_80::ParticleEffectComponent& data) /*override*/;
61
62 virtual void parseJson(::ConstDeserializeDataParams const& deserializeDataParams) /*override*/;
63
64 virtual void updateParticleMotion(
65 ::ParticleSystem::ComponentAccessParticleEmitter& emitter,
66 ::ParticleSystem::CommonParticle& particle,
67 ::RenderParams& renderParams,
68 ::std::chrono::nanoseconds const& dt
69 ) /*override*/;
70
71 virtual int getSortOrderNumber() const /*override*/;
72
73 virtual ~ParticleMotionCollisionComponent() /*override*/ = default;
74 // NOLINTEND
75
76public:
77 // member functions
78 // NOLINTBEGIN
79 MCAPI void _extractEvent(::Json::Value const& event);
80
81 MCAPI void _handleCollisions(
82 ::ParticleSystem::ComponentAccessParticleEmitter& emitter,
83 ::ParticleSystem::CommonParticle& particle,
84 ::std::chrono::nanoseconds const& dt
85 );
86
87 MCAPI ::ParticleSystem::ParticleMotionCollisionComponent::SweepResult _sweep(
88 ::ParticleSystem::ComponentAccessParticleEmitter& emitter,
89 ::ParticleSystem::ParticleMotionCollisionComponent::SweepResult const& previousRay,
90 ::Vec3 const& collisionRadius,
91 uint iteration
92 );
93
94 MCAPI void _sweepBB(
95 ::Vec3 const& currentPosition,
96 ::Vec3 const& lastPosition,
97 ::AABB const& aabb,
98 float& hitAlpha,
99 uchar& hitAxis
100 );
101 // NOLINTEND
102
103public:
104 // virtual function thunks
105 // NOLINTBEGIN
106 MCAPI void $initializeFromData(::SharedTypes::v1_20_80::ParticleEffectComponent& data);
107
108 MCAPI void $upgradeToSharedTypes(::SharedTypes::v1_20_80::ParticleEffectComponent& data);
109
110 MCAPI void $parseJson(::ConstDeserializeDataParams const& deserializeDataParams);
111
112 MCAPI void $updateParticleMotion(
113 ::ParticleSystem::ComponentAccessParticleEmitter& emitter,
114 ::ParticleSystem::CommonParticle& particle,
115 ::RenderParams& renderParams,
116 ::std::chrono::nanoseconds const& dt
117 );
118
119 MCFOLD int $getSortOrderNumber() const;
120 // NOLINTEND
121
122public:
123 // vftables
124 // NOLINTBEGIN
125 MCNAPI static void** $vftable();
126 // NOLINTEND
127};
128
129} // namespace ParticleSystem
Definition AABB.h:18
Definition Value.h:16
Definition ComponentAccessParticleEmitter.h:7
Definition ParticleMotionCollisionComponent.h:7
Definition RenderParams.h:30
Definition ConstDeserializeDataParams.h:13
Definition CommonParticle.h:7
Definition ParticleMotionCollisionComponent.h:15
Definition ParticleEffectComponent.h:12