SuperTuxKart
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
AbstractCharacteristic Class Referenceabstract

Characteristics are the properties of a kart that influence gameplay mechanics. More...

#include <abstract_characteristic.hpp>

Inheritance diagram for AbstractCharacteristic:
Inheritance graph
[legend]

Classes

union  Value
 

Public Types

enum  ValueType { TYPE_FLOAT, TYPE_BOOL, TYPE_FLOAT_VECTOR, TYPE_INTERPOLATION_ARRAY }
 
enum  CharacteristicType {
  SUSPENSION_STIFFNESS, SUSPENSION_REST, SUSPENSION_TRAVEL, SUSPENSION_EXP_SPRING_RESPONSE,
  SUSPENSION_MAX_FORCE, STABILITY_ROLL_INFLUENCE, STABILITY_CHASSIS_LINEAR_DAMPING, STABILITY_CHASSIS_ANGULAR_DAMPING,
  STABILITY_DOWNWARD_IMPULSE_FACTOR, STABILITY_TRACK_CONNECTION_ACCEL, STABILITY_ANGULAR_FACTOR, STABILITY_SMOOTH_FLYING_IMPULSE,
  TURN_RADIUS, TURN_TIME_RESET_STEER, TURN_TIME_FULL_STEER, ENGINE_POWER,
  ENGINE_MAX_SPEED, ENGINE_GENERIC_MAX_SPEED, ENGINE_BRAKE_FACTOR, ENGINE_BRAKE_TIME_INCREASE,
  ENGINE_MAX_SPEED_REVERSE_RATIO, GEAR_SWITCH_RATIO, GEAR_POWER_INCREASE, MASS,
  WHEELS_DAMPING_RELAXATION, WHEELS_DAMPING_COMPRESSION, CAMERA_DISTANCE, CAMERA_FORWARD_UP_ANGLE,
  CAMERA_BACKWARD_UP_ANGLE, JUMP_ANIMATION_TIME, LEAN_MAX, LEAN_SPEED,
  ANVIL_DURATION, ANVIL_WEIGHT, ANVIL_SPEED_FACTOR, PARACHUTE_FRICTION,
  PARACHUTE_DURATION, PARACHUTE_DURATION_OTHER, PARACHUTE_DURATION_RANK_MULT, PARACHUTE_DURATION_SPEED_MULT,
  PARACHUTE_LBOUND_FRACTION, PARACHUTE_UBOUND_FRACTION, PARACHUTE_MAX_SPEED, FRICTION_KART_FRICTION,
  BUBBLEGUM_DURATION, BUBBLEGUM_SPEED_FRACTION, BUBBLEGUM_TORQUE, BUBBLEGUM_FADE_IN_TIME,
  BUBBLEGUM_SHIELD_DURATION, ZIPPER_DURATION, ZIPPER_FORCE, ZIPPER_SPEED_GAIN,
  ZIPPER_MAX_SPEED_INCREASE, ZIPPER_FADE_OUT_TIME, SWATTER_DURATION, SWATTER_DISTANCE,
  SWATTER_SQUASH_DURATION, SWATTER_SQUASH_SLOWDOWN, PLUNGER_BAND_MAX_LENGTH, PLUNGER_BAND_FORCE,
  PLUNGER_BAND_DURATION, PLUNGER_BAND_SPEED_INCREASE, PLUNGER_BAND_FADE_OUT_TIME, PLUNGER_IN_FACE_TIME,
  STARTUP_TIME, STARTUP_BOOST, RESCUE_DURATION, RESCUE_VERT_OFFSET,
  RESCUE_HEIGHT, EXPLOSION_DURATION, EXPLOSION_RADIUS, EXPLOSION_INVULNERABILITY_TIME,
  NITRO_DURATION, NITRO_ENGINE_FORCE, NITRO_ENGINE_MULT, NITRO_CONSUMPTION,
  NITRO_SMALL_CONTAINER, NITRO_BIG_CONTAINER, NITRO_MAX_SPEED_INCREASE, NITRO_FADE_OUT_TIME,
  NITRO_MAX, SLIPSTREAM_DURATION_FACTOR, SLIPSTREAM_BASE_SPEED, SLIPSTREAM_LENGTH,
  SLIPSTREAM_WIDTH, SLIPSTREAM_INNER_FACTOR, SLIPSTREAM_MIN_COLLECT_TIME, SLIPSTREAM_MAX_COLLECT_TIME,
  SLIPSTREAM_ADD_POWER, SLIPSTREAM_MIN_SPEED, SLIPSTREAM_MAX_SPEED_INCREASE, SLIPSTREAM_FADE_OUT_TIME,
  SKID_INCREASE, SKID_DECREASE, SKID_MAX, SKID_TIME_TILL_MAX,
  SKID_VISUAL, SKID_VISUAL_TIME, SKID_REVERT_VISUAL_TIME, SKID_MIN_SPEED,
  SKID_TIME_TILL_BONUS, SKID_BONUS_SPEED, SKID_BONUS_TIME, SKID_BONUS_FORCE,
  SKID_PHYSICAL_JUMP_TIME, SKID_GRAPHICAL_JUMP_TIME, SKID_POST_SKID_ROTATE_FACTOR, SKID_REDUCE_TURN_MIN,
  SKID_REDUCE_TURN_MAX, SKID_ENABLED, CHARACTERISTIC_COUNT
}
 

Public Member Functions

virtual void copyFrom (const AbstractCharacteristic *other)=0
 
virtual void process (CharacteristicType type, Value value, bool *is_set) const
 The process function is the core of this characteristics system. More...
 
float getSuspensionStiffness () const
 
float getSuspensionRest () const
 
float getSuspensionTravel () const
 
bool getSuspensionExpSpringResponse () const
 
float getSuspensionMaxForce () const
 
float getStabilityRollInfluence () const
 
float getStabilityChassisLinearDamping () const
 
float getStabilityChassisAngularDamping () const
 
float getStabilityDownwardImpulseFactor () const
 
float getStabilityTrackConnectionAccel () const
 
std::vector< float > getStabilityAngularFactor () const
 
float getStabilitySmoothFlyingImpulse () const
 
InterpolationArray getTurnRadius () const
 
float getTurnTimeResetSteer () const
 
InterpolationArray getTurnTimeFullSteer () const
 
float getEnginePower () const
 
float getEngineMaxSpeed () const
 
float getEngineGenericMaxSpeed () const
 
float getEngineBrakeFactor () const
 
float getEngineBrakeTimeIncrease () const
 
float getEngineMaxSpeedReverseRatio () const
 
std::vector< float > getGearSwitchRatio () const
 
std::vector< float > getGearPowerIncrease () const
 
float getMass () const
 
float getWheelsDampingRelaxation () const
 
float getWheelsDampingCompression () const
 
float getCameraDistance () const
 
float getCameraForwardUpAngle () const
 
float getCameraBackwardUpAngle () const
 
float getJumpAnimationTime () const
 
float getLeanMax () const
 
float getLeanSpeed () const
 
float getAnvilDuration () const
 
float getAnvilWeight () const
 
float getAnvilSpeedFactor () const
 
float getParachuteFriction () const
 
int getParachuteDuration () const
 
int getParachuteDurationOther () const
 
float getParachuteDurationRankMult () const
 
float getParachuteDurationSpeedMult () const
 
float getParachuteLboundFraction () const
 
float getParachuteUboundFraction () const
 
float getParachuteMaxSpeed () const
 
float getFrictionKartFriction () const
 
float getBubblegumDuration () const
 
float getBubblegumSpeedFraction () const
 
float getBubblegumTorque () const
 
float getBubblegumFadeInTime () const
 
float getBubblegumShieldDuration () const
 
float getZipperDuration () const
 
float getZipperForce () const
 
float getZipperSpeedGain () const
 
float getZipperMaxSpeedIncrease () const
 
float getZipperFadeOutTime () const
 
float getSwatterDuration () const
 
float getSwatterDistance () const
 
float getSwatterSquashDuration () const
 
float getSwatterSquashSlowdown () const
 
float getPlungerBandMaxLength () const
 
float getPlungerBandForce () const
 
float getPlungerBandDuration () const
 
float getPlungerBandSpeedIncrease () const
 
float getPlungerBandFadeOutTime () const
 
float getPlungerInFaceTime () const
 
std::vector< float > getStartupTime () const
 
std::vector< float > getStartupBoost () const
 
float getRescueDuration () const
 
float getRescueVertOffset () const
 
float getRescueHeight () const
 
float getExplosionDuration () const
 
float getExplosionRadius () const
 
float getExplosionInvulnerabilityTime () const
 
float getNitroDuration () const
 
float getNitroEngineForce () const
 
float getNitroEngineMult () const
 
float getNitroConsumption () const
 
float getNitroSmallContainer () const
 
float getNitroBigContainer () const
 
float getNitroMaxSpeedIncrease () const
 
float getNitroFadeOutTime () const
 
float getNitroMax () const
 
float getSlipstreamDurationFactor () const
 
float getSlipstreamBaseSpeed () const
 
float getSlipstreamLength () const
 
float getSlipstreamWidth () const
 
float getSlipstreamInnerFactor () const
 
float getSlipstreamMinCollectTime () const
 
float getSlipstreamMaxCollectTime () const
 
float getSlipstreamAddPower () const
 
float getSlipstreamMinSpeed () const
 
float getSlipstreamMaxSpeedIncrease () const
 
float getSlipstreamFadeOutTime () const
 
float getSkidIncrease () const
 
float getSkidDecrease () const
 
float getSkidMax () const
 
float getSkidTimeTillMax () const
 
float getSkidVisual () const
 
float getSkidVisualTime () const
 
float getSkidRevertVisualTime () const
 
float getSkidMinSpeed () const
 
std::vector< float > getSkidTimeTillBonus () const
 
std::vector< float > getSkidBonusSpeed () const
 
std::vector< float > getSkidBonusTime () const
 
std::vector< float > getSkidBonusForce () const
 
float getSkidPhysicalJumpTime () const
 
float getSkidGraphicalJumpTime () const
 
float getSkidPostSkidRotateFactor () const
 
float getSkidReduceTurnMin () const
 
float getSkidReduceTurnMax () const
 
bool getSkidEnabled () const
 

Static Public Member Functions

static ValueType getType (CharacteristicType type)
 Returns the type of a given characteristic. More...
 
static std::string getName (CharacteristicType type)
 Converts the enum value to a string. More...
 

Detailed Description

Characteristics are the properties of a kart that influence gameplay mechanics.

The biggest parts are:

The documentation of these properties can be found in the kart_characteristics.xml file. Large parts of this file are generated by tools/create_kart_properties.py. Please don't change the generated code here, instead change the script, regenerate the code and overwrite the whole generated part with the result.

Member Function Documentation

◆ getName()

std::string AbstractCharacteristic::getName ( CharacteristicType  type)
static

Converts the enum value to a string.

◆ getType()

AbstractCharacteristic::ValueType AbstractCharacteristic::getType ( CharacteristicType  type)
static

Returns the type of a given characteristic.

◆ process()

void AbstractCharacteristic::process ( CharacteristicType  type,
Value  value,
bool *  is_set 
) const
virtual

The process function is the core of this characteristics system.

The process function should change the given value.

Any computation of the properties should happen here and modify the values of the value-pointer (be sure to use the right type!) and the is_set parameter when the value was set by the call (and wasn't set before).

Parameters
typeThe characteristic that should be modified.
valueThe current value and result at the same time.
is_setIf the current value was already set (so it can be used for computations).

The input and output argument is saved in value. is_set describes if the value is already set or if it's undefined. The function also has to set is_set if the state changed.

Reimplemented in CachedCharacteristic, XmlCharacteristic, and CombinedCharacteristic.


The documentation for this class was generated from the following files: