10 #ifndef CAR_SOUND_DATA_H 11 #define CAR_SOUND_DATA_H 43 bool mainSurfaceIsOffroad,
45 tdble otherRoughnessFreq,
46 tdble& dirtRoughnessFreq,
50 tdble dirtContribution,
51 tdble dirtRoughnessFreq,
58 bool mainSurfaceIsOffroad,
59 tdble roadContribution,
61 tdble otherRoughnessFreq,
72 tdble otherSurfaceContribution,
73 tdble curbRoughnessFreq,
74 tdble otherRoughnessFreq,
111 for (
int i=0; i<3; i++) {
117 for (
int i=0; i<3; i++) {
123 for (
int i=0; i<3; i++) {
129 for (
int i=0; i<3; i++) {
135 for (
int i=0; i<3; i++) {
struct WheelSoundData_ WheelSoundData
void setListenerPosition(sgVec3 p)
QSoundChar engine_backfire
CarSoundData(int id, SoundInterface *sound_interface)
void handleDirtContribution(tdble dirtContribution, tdble dirtRoughnessFreq, tdble dirtRoughness, tdble wheelSkid, tdble tmpvol, tdble ride)
float turbo_rpm
when turbo comes in
TorcsSound * getEngineSound()
void setEngineSound(TorcsSound *engine_sound, float rpm_scale)
void setCarPosition(sgVec3 p)
Manages the source sound of each individual car.
TorcsSound * engine_sound
bool turbo_on
use turbo sound
void setCarSpeed(sgVec3 u)
float base_frequency
engine base frequency for ~ 6000 rpm
void calculateBackfireSound(tCarElt *car)
Calculate the frequency and amplitude of a looped backfiring sound.
void calculateCollisionSound(tCarElt *car)
void calculateEngineSound(tCarElt *car)
Calculate characteristics of the engine sound.
void calculateTyreSound(tCarElt *car)
float attenuation
global distance attenuation
float tdble
Floating point type used in TORCS.
bool isOffRoadSurface(const tTrackSeg *const seg)
QSoundChar drag_collision
tdble calculateRoughnessFreqency(const tTrackSeg *const seg)
void getCarPosition(sgVec3 p)
void handleRoadContribution(bool mainSurfaceIsOffroad, tdble roadContribution, tdble roughnessFreq, tdble otherRoughnessFreq, tdble tmpvol, tdble ride, int wheelIndex, tdble wheelSkid, tdble wheelSlipAccel, tdble wheelReaction)
void setTurboParameters(bool turbo_on, float turbo_rpm, float turbo_lag)
Track segment (tTrackSeg) The segments can be straights (type TR_STR): (the track goes from the right...
void getCarSpeed(sgVec3 u)
void copyEngPri(SoundPri &epri)
void calculateGearChangeSound(tCarElt *car)
void handleCurbContribution(tPrivCar *car, bool onOtherSurface, tdble otherSurfaceContribution, tdble curbRoughnessFreq, tdble otherRoughnessFreq, tdble tmpvol, tdble ride, int wheelIndex, tdble wheelReaction)
float smooth_accel
smoothed acceleration input
void update(tCarElt *car)
Data known only by the driver.
void getDirtRoughnessParams(tCarElt *car, int wheelIndex, bool mainSurfaceIsOffroad, tdble roughnessFreq, tdble otherRoughnessFreq, tdble &dirtRoughnessFreq, tdble &dirtRoughness)
float pre_axle
axle related
void calculateAttenuation(tCarElt *car)
Use inverse distance to calculate attenuation of sounds originating from this car. Useful for prioritisation of sounds.
SoundInterface * sound_interface
Sound priority, used to sort cars according to amplitude attenuation.
float turbo_ilag
how fast turbo catches up with engine