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
struct QSoundChar_ QSoundChar
struct SoundPri_ SoundPri
Sound priority, used to sort cars according to amplitude attenuation.
struct CarElt tCarElt
Car structure (tCarElt).
float smooth_accel
smoothed acceleration input
bool turbo_on
use turbo sound
void calculateGearChangeSound(tCarElt *car)
QSoundChar engine_backfire
void copyEngPri(SoundPri &epri)
void calculateCollisionSound(tCarElt *car)
void calculateAttenuation(tCarElt *car)
Use inverse distance to calculate attenuation of sounds originating from this car....
float pre_axle
axle related
void setCarSpeed(sgVec3 u)
float turbo_ilag
how fast turbo catches up with engine
float attenuation
global distance attenuation
void getCarSpeed(sgVec3 u)
SoundInterface * sound_interface
float base_frequency
engine base frequency for ~ 6000 rpm
void setListenerPosition(sgVec3 p)
void calculateEngineSound(tCarElt *car)
Calculate characteristics of the engine sound.
void setEngineSound(TorcsSound *engine_sound, float rpm_scale)
void setTurboParameters(bool turbo_on, float turbo_rpm, float turbo_lag)
void handleDirtContribution(tdble dirtContribution, tdble dirtRoughnessFreq, tdble dirtRoughness, tdble wheelSkid, tdble tmpvol, tdble ride)
CarSoundData(int id, SoundInterface *sound_interface)
bool isOffRoadSurface(const tTrackSeg *const seg)
void getDirtRoughnessParams(tCarElt *car, int wheelIndex, bool mainSurfaceIsOffroad, tdble roughnessFreq, tdble otherRoughnessFreq, tdble &dirtRoughnessFreq, tdble &dirtRoughness)
float turbo_rpm
when turbo comes in
TorcsSound * engine_sound
TorcsSound * getEngineSound()
tdble calculateRoughnessFreqency(const tTrackSeg *const seg)
void calculateTyreSound(tCarElt *car)
QSoundChar drag_collision
void handleCurbContribution(tPrivCar *car, bool onOtherSurface, tdble otherSurfaceContribution, tdble curbRoughnessFreq, tdble otherRoughnessFreq, tdble tmpvol, tdble ride, int wheelIndex, tdble wheelReaction)
void handleRoadContribution(bool mainSurfaceIsOffroad, tdble roadContribution, tdble roughnessFreq, tdble otherRoughnessFreq, tdble tmpvol, tdble ride, int wheelIndex, tdble wheelSkid, tdble wheelSlipAccel, tdble wheelReaction)
void update(tCarElt *car)
void setCarPosition(sgVec3 p)
void getCarPosition(sgVec3 p)
void calculateBackfireSound(tCarElt *car)
Calculate the frequency and amplitude of a looped backfiring sound.
float tdble
Floating point type used in TORCS.
struct trackSeg tTrackSeg
Track segment (tTrackSeg) The segments can be straights (type TR_STR): (the track goes from the right...
Data known only by the driver.