8enum SCR_EImpactSoundEvent
13 SOUND_VEHICLE_IMPACT_BOTTOM
19 ref array<ResourceName> m_aDefaultParticles;
24 [
Attribute(defvalue:
"-1",
desc:
"If set to -1 component will use impulse to determine effect intensity")]
95 float dV =
Math.AbsFloat(
vector.Dot(velocityBefore - velocityAfter, impactNormal));
102 float velocity = velocityBefore.Length();
117 float finalMass =
m_fMass + otherMass;
118 if (finalMass != 0.0)
120 float velocityAfterImpact =
m_fMass * velocity / finalMass;
121 dV = velocity - velocityAfterImpact;
139 m_iSurface = mat.GetSoundInfo().GetSignalValue();
179 float waterHeight =
SCR_WorldTools.GetWaterSurfaceY(
GetGame().GetWorld(), ownerTransform[3], surfaceType, lakeArea);
182 Math3D.MatrixIdentity3(transform);
183 vector particleOrigin = {ownerTransform[3][0], waterHeight, ownerTransform[3][2]};
184 transform[3] = particleOrigin;
205 Physics physics = other.GetPhysics();
209 int responseIndex = physics.GetResponseIndex();
272 float collisionDM =
m_fdM;
310 Math3D.MatrixIdentity4(transform);
340 int responseIndex = physics.GetResponseIndex();
342 if (responseIndex < SCR_EPhysicsResponseIndex.TINY_DESTRUCTIBLE || responseIndex >=
SCR_EPhysicsResponseIndex.NO_COLLISION)
358 normalLocal = normalLocal.VectorToAngles();
360 float pitch = normalLocal[1];
362 if (pitch > 225 && pitch <= 315)
364 return SCR_EImpactSoundEvent.SOUND_VEHICLE_IMPACT_TOP;
366 else if (pitch > 45 && pitch <= 135)
368 return SCR_EImpactSoundEvent.SOUND_VEHICLE_IMPACT_BOTTOM;
372 float yaw = normalLocal[0];
374 if ((yaw > 45 && yaw <= 135) || (yaw > 225 && yaw <= 315))
376 return SCR_EImpactSoundEvent.SOUND_VEHICLE_IMPACT_SIDE;
379 return SCR_EImpactSoundEvent.SOUND_VEHICLE_IMPACT_FRONT;
391 Math3D.MatrixIdentity4(transform);
392 transform[3] = contactPos;
395 trace.Start = contactPos + contactNormal;
396 trace.End = contactPos - contactNormal;
418 PlayImpactSound(eventIndex, impactPosition, impactSurface, collisionDM);
427 Math3D.MatrixIdentity4(transform);
428 transform[3] = impactPosition;
431 trace.Start = impactPosition + contactNormal;
432 trace.End = impactPosition - contactNormal;
467 if (physics && physics.IsActive())
494 if (!rpl || rpl.IsProxy())
497 SCR_VehicleBuoyancyComponent buoyancyComp = SCR_VehicleBuoyancyComponent.Cast(
GetOwner().
FindComponent(SCR_VehicleBuoyancyComponent));
ArmaReforgerScripted GetGame()
enum SCR_EAICombatMoveRequestType CHARACTER
ResourceName resourceName
SCR_CharacterSoundComponentClass GetComponentData()
SCR_DestructibleTreeV2Class impulse
enum SCR_EImpactSoundType SOUND_VEHICLE_IMPACT_SIDE
ref array< ResourceName > m_aWaterParticles
enum SCR_EImpactSoundType SOUND_VEHICLE_IMPACT_FRONT
enum SCR_EImpactSoundType SOUND_VEHICLE_IMPACT_TOP
void ParticleEffectEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_EPhysicsResponseIndex
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Physics GetPhysics()
proto external BaseWorld GetWorld()
proto external void GetTransform(out vector mat[])
proto external vector VectorToLocal(vector vec)
proto external IEntity GetRootParent()
const string IMPACT_SURFACE_SIGNAL_NAME
const float CHARACTER_IMPULSE_MINIMUM
void PlayImpactParticle(vector position, int magnitude, GameMaterial material)
void RPC_OnImpactSoundBroadcast(SCR_EImpactSoundEvent eventIndex, vector impactPosition, int impactSurface, float collisionDM)
array< ResourceName > GetWaterParticles()
SCR_EImpactSoundType m_eImpactType
bool m_bIsImpactEffectScheduled
void HandleImpactEffect()
const float SMALL_OBJECT_VOLUME_MAXIMUM
float GetAproximatedMass(IEntity entity)
const string COLLISION_D_M_SIGNAL_NAME
static const ref array< string > WATER_SOUNDS
void PlayImpactSound(SCR_EImpactSoundEvent eventIndex, vector position, int surface, float collisionDM)
array< ResourceName > GetDefaultParticles()
void ScheduleImpactEffect()
const float COLLISION_LAST_POSITION_REST_TIME
void RPC_OnImpactSoundAndParticlesBroadcast(vector impactPosition, float collisionDM, vector contactNormal, int magnitude)
const float MIN_SMALL_IMPULSE
const float MIN_HUGE_IMPULSE
void PlaySound(string soundEvent)
const float IMPACT_DIST_SQ_THRESHOLD
void EmitParticles(vector transform[4], ResourceName particleResource)
const float MIN_MEDIUM_IMPULSE
const float MIN_BIG_IMPULSE
void UpdateParticlesMagnitude(notnull IEntity other, float impulse)
const float VEHICLE_VELOCITY_MINIMUM
void OnImpact(notnull IEntity other, float impulse, vector impactPosition, vector impactNormal, GameMaterial mat, vector velocityBefore=vector.Zero, vector velocityAfter=vector.Zero)
void RPC_OnImpactParticlesBroadcast(vector contactPos, vector contactNormal, int magnitude)
const float SMALL_OBJECT_IMPULSE_MINIMUM
bool TraceFilter(notnull IEntity e)
void ResetContactLastPosition()
SCR_EImpactSoundEvent GetImpactSoundEventIndex(vector normal)
void RPC_OnWaterEnterBroadcast(vector transform[4], int magnitude)
static const int m_aAproximatedMasses[5]
const float DEFAULT_DENSITY
override void EOnInit(IEntity owner)
override void OnPostInit(IEntity owner)
const float VELOCITY_IMPACT_THRESHOLD
GameMaterial m_GameMaterial
ref ParticleEffectEntitySpawnParams m_ParticleSpawnParams
SignalsManagerComponent m_SignalsManagerComponent
SoundComponent m_SoundComponent
const float MIN_TINY_IMPULSE
proto external GenericEntity GetOwner()
Get owner entity.
@ DEFAULT
Use currently set main RT format (based on game options).
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
proto native bool IsEmpty()