676 {
678 ParticleParamsOverrideData particleParamsData;
679
680
681 if ( !
g_Game.IsHeadlessOrDedicatedServer() )
682 {
684 {
686 {
688 particleParamsData.m_FloatModifiers.InsertAt(carSpeed, 0);
691 }
692
694 {
697 else
698 {
701 else
703 }
704 }
705 else
707 }
708 else
709 {
712 }
713
714 string surface;
715
716 if (carSpeed > EffVehicleDust.WHEEL_DUST_THRESHOLD)
717 {
719 particleParamsData.m_FloatModifiers.InsertAt(carSpeed, 0);
720 particleParamsData.m_FloatModifiers.InsertAt(
GetWeightCoef(), 1);
722 }
723 else
725
726
729
730 int i;
731 for (i = 0; i < wheelCount; ++i)
732 wheelsPosition.InsertAt(
Vector(-1, -1, -1), i);
733
734 for (i = 0; i < wheelCount; ++i)
735 {
737 if (!wheel)
738 break;
739
740 vector wheelPos;
741 if (
m_VFXComponent.CanPlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE))
742 {
744 {
747 wheelPos = WorldToModel(wheelPos);
748 wheelsPosition.Set(i, wheelPos);
749
751
752 vector transform[3];
754 transform[1] = vector.
Up;
755 transform[0] = transform[2] * transform[1];
756
758
759 float bodySpeed = wheelVel[2];
760
761 bool applyWheelSmokeEffect = false;
762
763 if ((wheelSpeed > 0 && bodySpeed > 0) || (wheelSpeed < 0 && bodySpeed < 0))
764 applyWheelSmokeEffect = Math.AbsFloat(wheelSpeed) > Math.AbsFloat(bodySpeed) + EffWheelSmoke.WHEEL_SMOKE_THRESHOLD;
765 else
766 applyWheelSmokeEffect = Math.AbsFloat(wheelSpeed) > EffWheelSmoke.WHEEL_SMOKE_THRESHOLD;
767
768 if (applyWheelSmokeEffect)
769 {
770 m_VFXComponent.SetEffectGroupPositions(EVehicleVFXEffectGroup.WHEEL_SMOKE, wheelsPosition);
771 m_VFXComponent.PlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE);
772 }
773 else
774 m_VFXComponent.StopEffectGroup(EVehicleVFXEffectGroup.WHEEL_SMOKE);
775 }
776 }
777
778
780 wheelsPosition.Set(i, wheelPos);
781
782
784 {
785 if (
m_VFXComponent.CanPlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT))
786 {
787 bool applyWheelContactEffect = Math.AbsFloat(wheelSpeed) > EffWheelContact.SPEED_THRESHOLD;
788
789 if (wheel && applyWheelContactEffect)
790 {
791 particleParamsData =
m_VFXComponent.GetEffectGroupParticleParamsOverrideData(EVehicleVFXEffectGroup.WHEEL_CONTACT);
792 particleParamsData.m_FloatModifiers.InsertAt(carSpeed, 0);
793 particleParamsData.m_FloatModifiers.InsertAt(
GetWeightCoef(), 1);
795 m_VFXComponent.SetEffectGroupPositions(EVehicleVFXEffectGroup.WHEEL_CONTACT, wheelsPosition);
796
797 m_VFXComponent.PlayEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT);
798 }
799 else
800 m_VFXComponent.StopEffectGroup(EVehicleVFXEffectGroup.WHEEL_CONTACT);
801 }
802 }
803 }
804 }
805 }
ReplaceWheelLambda CarWheel
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
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 float GetFluidFraction(MotorbikeFluid fluid)
proto native vector WheelGetContactPosition(int wheelIdx)
proto native SurfaceInfo WheelGetSurface(int wheelIdx)
proto native float WheelGetAngularVelocity(int wheelIdx)
override float GetWeightCoef()
ref VehicleVFXComponent m_VFXComponent
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.
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.