613 {
614 if (!
g_Game.IsDedicatedServer())
615 {
617 ParticleParamsOverrideData particleParamsData;
618
620 {
622 {
624 particleParamsData.m_FloatModifiers.InsertAt(motorbikeSpeed, 0);
627 }
628 }
629 else
630 {
631 if (!
g_Game.IsDedicatedServer())
633 }
634
636 {
637 string surface;
638
640 {
641 if (particleParamsData)
642 {
643 particleParamsData.ClearAll();
645 particleParamsData.m_FloatModifiers.InsertAt(motorbikeSpeed, 0);
646 particleParamsData.m_FloatModifiers.InsertAt(
GetWeightCoef(), 1);
648 }
649 }
650 else
652
653
656
657 int i;
658 for (i = 0; i < wheelCount; ++i)
659 wheelsPosition.InsertAt(
Vector(-1, -1, -1), i);
660
661 for (i = 0; i < wheelCount; ++i)
662 {
664 if (!wheel)
665 break;
666
668 if (
m_VFXComponent.CanPlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE))
669 {
671 {
674 wheelPos = WorldToModel(wheelPos);
675 wheelsPosition.Set(i, wheelPos);
676
678
682 transform[0] = transform[2] * transform[1];
683
685
686 float bodySpeed = wheelVel[2];
687
688 bool applyWheelSmokeEffect = false;
689
690 if ((wheelSpeed > 0 && bodySpeed > 0) || (wheelSpeed < 0 && bodySpeed < 0))
692 else
694
695 if (applyWheelSmokeEffect)
696 {
697 m_VFXComponent.SetEffectGroupPositions(EVehicleVFXEffectGroup.WHEEL_SMOKE, wheelsPosition);
698 m_VFXComponent.PlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE);
699 }
700 else
701 m_VFXComponent.StopEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE);
702 }
703 }
704
705
707 wheelsPosition.Set(i, wheelPos);
708
710 {
711 if (
m_VFXComponent.CanPlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT))
712 {
714 if (wheel && applyWheelContactEffect)
715 {
716 particleParamsData =
m_VFXComponent.GetEffectGroupParticleParamsOverrideData(EVehicleVFXEffectGroup.WHEEL_CONTACT);
717 if (particleParamsData)
718 {
719 particleParamsData.m_FloatModifiers.InsertAt(motorbikeSpeed, 0);
720 particleParamsData.m_FloatModifiers.InsertAt(
GetWeightCoef(), 1);
721
723 m_VFXComponent.SetEffectGroupPositions(EVehicleVFXEffectGroup.WHEEL_CONTACT, wheelsPosition);
724
725 m_VFXComponent.PlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT);
726 }
727 }
728 else
729 m_VFXComponent.StopEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT);
730 }
731 }
732
733
734 }
735 }
736 }
737 }
EVehicleVFXEffect
Identifiers of individual vehicle VFX effects.
proto native vector WheelGetPositionLS(int wheelIdx)
proto native EntityAI WheelGetEntity(int wheelIdx)
proto native int WheelCount()
How many wheel can be attached to a motorbike (hubs only)
proto native bool WheelHasContact(int wheelIdx)
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
proto native vector WheelGetDirection(int wheelIdx)
proto native vector WheelGetContactPosition(int wheelIdx)
proto native SurfaceInfo WheelGetSurface(int wheelIdx)
proto native float WheelGetAngularVelocity(int wheelIdx)
ref VehicleVFXComponent m_VFXComponent
override float GetWeightCoef()
const float WHEEL_DUST_THRESHOLD
const float WHEEL_SMOKE_THRESHOLD
static const int HATCHBACK_EXHAUST_SMOKE
proto native float Length()
Returns length of vector (magnitude)
proto vector InvMultiply3(vector mat[3])
Invert-transforms vector.
array< vector > TVectorArray
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float AbsFloat(float f)
Returns absolute value.
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.