4 ref array<ResourceName> m_aDefaultParticles;
7 ref array<ResourceName> m_aWaterParticles;
47 void OnImpact(notnull IEntity other, notnull Contact contact)
52 int responseIndex = contact.Physics2.GetResponseIndex();
80 Math3D.MatrixIdentity4(transform);
81 transform[3] = contact.Position;
85 ResourceName resourceName = effectInfo.GetBlastResource(magnitude);
87 if (resourceName.IsEmpty())
102 Physics physics =
GetOwner().GetPhysics();
107 float impulse = Math.AbsFloat(physics.GetVelocity()[1]) * physics.GetMass();
122 vector ownerTransform[4];
123 GetOwner().GetTransform(ownerTransform);
127 float waterHeight =
SCR_WorldTools.GetWaterSurfaceY(
GetGame().GetWorld(), ownerTransform[3], surfaceType, lakeArea);
130 Math3D.MatrixIdentity3(transform);
131 vector particleOrigin = {ownerTransform[3][0], waterHeight, ownerTransform[3][2]};
132 transform[3] = particleOrigin;
137 if (resourceName.IsEmpty())
148 protected void EmitParticles(vector transform[4], ResourceName particleResource)
167 [
RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
171 Math3D.MatrixIdentity4(transform);
172 transform[3] = contactPos;
174 TraceParam trace =
new TraceParam();
175 trace.Start = contactPos + contactNormal;
176 trace.End = contactPos - contactNormal;
177 trace.Flags = TraceFlags.WORLD | TraceFlags.ENTS;
183 ResourceName resourceName = effectInfo.GetBlastResource(magnitude);
185 if (resourceName.IsEmpty())
192 [
RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
198 if (resourceName.IsEmpty())
220 SCR_VehicleBuoyancyComponent buoyancyComp = SCR_VehicleBuoyancyComponent.Cast(
GetOwner().FindComponent(SCR_VehicleBuoyancyComponent));
230 SetEventMask(
GetOwner(), EntityEvent.INIT);