19#ifndef HEADER_KART_PROPERTIES_HPP
20#define HEADER_KART_PROPERTIES_HPP
30 namespace video {
class ITexture; }
34#include "io/xml_node.hpp"
35#include "race/race_manager.hpp"
36#include "utils/interpolation_array.hpp"
37#include "utils/vec3.hpp"
45namespace GE {
class GERenderInfo; }
63 std::string
m_root, m_root_absolute_path;
165 std::string m_skid_sound;
169 float m_friction_slip;
182 IMPULSE_TO_DRIVELINE};
199 void load (
const std::string &filename,
200 const std::string &node);
203 void setWheelBase(
float kart_length)
213 void handleOnDemandLoadTexture();
223 void updateForOnlineKart(
const std::string&
id,
const Vec3& gravity_shift,
228 setWheelBase(kart_length);
233 bool isInGroup (
const std::string &group)
const;
237 void initKartWithDifferentType(
const std::string& type)
240 combineCharacteristics(HANDICAP_NONE);
271 const std::string getNonTranslatedName()
const {
return m_name;}
309 const std::vector<std::string>&
343 {
return m_terrain_impulse_type; }
391 bool isAddon()
const {
return m_is_addon; }
399 float getSuspensionStiffness()
const;
400 float getSuspensionRest()
const;
401 float getSuspensionTravel()
const;
402 bool getSuspensionExpSpringResponse()
const;
403 float getSuspensionMaxForce()
const;
405 float getStabilityRollInfluence()
const;
406 float getStabilityChassisLinearDamping()
const;
407 float getStabilityChassisAngularDamping()
const;
408 float getStabilityDownwardImpulseFactor()
const;
409 float getStabilityTrackConnectionAccel()
const;
410 std::vector<float> getStabilityAngularFactor()
const;
411 float getStabilitySmoothFlyingImpulse()
const;
414 float getTurnTimeResetSteer()
const;
417 float getEnginePower()
const;
418 float getEngineMaxSpeed()
const;
419 float getEngineGenericMaxSpeed()
const;
420 float getEngineBrakeFactor()
const;
421 float getEngineBrakeTimeIncrease()
const;
422 float getEngineMaxSpeedReverseRatio()
const;
424 std::vector<float> getGearSwitchRatio()
const;
425 std::vector<float> getGearPowerIncrease()
const;
427 float getMass()
const;
429 float getWheelsDampingRelaxation()
const;
430 float getWheelsDampingCompression()
const;
432 float getJumpAnimationTime()
const;
434 float getLeanMax()
const;
435 float getLeanSpeed()
const;
437 float getAnvilDuration()
const;
438 float getAnvilWeight()
const;
439 float getAnvilSpeedFactor()
const;
441 float getParachuteFriction()
const;
442 float getParachuteDuration()
const;
443 float getParachuteDurationOther()
const;
444 float getParachuteDurationRankMult()
const;
445 float getParachuteDurationSpeedMult()
const;
446 float getParachuteLboundFraction()
const;
447 float getParachuteUboundFraction()
const;
448 float getParachuteMaxSpeed()
const;
450 float getFrictionKartFriction()
const;
452 float getBubblegumDuration()
const;
453 float getBubblegumSpeedFraction()
const;
454 float getBubblegumTorque()
const;
455 float getBubblegumFadeInTime()
const;
456 float getBubblegumShieldDuration()
const;
458 float getZipperDuration()
const;
459 float getZipperForce()
const;
460 float getZipperSpeedGain()
const;
461 float getZipperMaxSpeedIncrease()
const;
462 float getZipperFadeOutTime()
const;
464 float getSwatterDuration()
const;
465 float getSwatterDistance()
const;
466 float getSwatterSquashDuration()
const;
467 float getSwatterSquashSlowdown()
const;
469 float getPlungerBandMaxLength()
const;
470 float getPlungerBandForce()
const;
471 float getPlungerBandDuration()
const;
472 float getPlungerBandSpeedIncrease()
const;
473 float getPlungerBandFadeOutTime()
const;
474 float getPlungerInFaceTime()
const;
476 std::vector<float> getStartupTime()
const;
477 std::vector<float> getStartupBoost()
const;
479 float getRescueDuration()
const;
480 float getRescueVertOffset()
const;
481 float getRescueHeight()
const;
483 float getExplosionDuration()
const;
484 float getExplosionRadius()
const;
485 float getExplosionInvulnerabilityTime()
const;
487 float getNitroDuration()
const;
488 float getNitroEngineForce()
const;
489 float getNitroEngineMult()
const;
490 float getNitroConsumption()
const;
491 float getNitroSmallContainer()
const;
492 float getNitroBigContainer()
const;
493 float getNitroMaxSpeedIncrease()
const;
494 float getNitroFadeOutTime()
const;
495 float getNitroMax()
const;
497 float getSlipstreamDurationFactor()
const;
498 float getSlipstreamBaseSpeed()
const;
499 float getSlipstreamLength()
const;
500 float getSlipstreamWidth()
const;
501 float getSlipstreamInnerFactor()
const;
502 float getSlipstreamMinCollectTime()
const;
503 float getSlipstreamMaxCollectTime()
const;
504 float getSlipstreamAddPower()
const;
505 float getSlipstreamMinSpeed()
const;
506 float getSlipstreamMaxSpeedIncrease()
const;
507 float getSlipstreamFadeOutTime()
const;
509 float getSkidIncrease()
const;
510 float getSkidDecrease()
const;
511 float getSkidMax()
const;
512 float getSkidTimeTillMax()
const;
513 float getSkidVisual()
const;
514 float getSkidVisualTime()
const;
515 float getSkidRevertVisualTime()
const;
516 float getSkidMinSpeed()
const;
517 std::vector<float> getSkidTimeTillBonus()
const;
518 std::vector<float> getSkidBonusSpeed()
const;
519 std::vector<float> getSkidBonusTime()
const;
520 std::vector<float> getSkidBonusForce()
const;
521 float getSkidPhysicalJumpTime()
const;
522 float getSkidGraphicalJumpTime()
const;
523 float getSkidPostSkidRotateFactor()
const;
524 float getSkidReduceTurnMin()
const;
525 float getSkidReduceTurnMax()
const;
526 bool getSkidEnabled()
const;
A simple class that stores all AI related properties.
Definition: ai_properties.hpp:40
Characteristics are the properties of a kart that influence gameplay mechanics.
Definition: abstract_characteristic.hpp:43
Definition: cached_characteristic.hpp:27
Definition: combined_characteristic.hpp:27
This class manages a set of (x_i,y_i) points, x_i must be sorted.
Definition: interpolation_array.hpp:32
float get(float x) const
Returns the interpolated Y value for a given x.
Definition: interpolation_array.hpp:101
This class stores a 3D kart model.
Definition: kart_model.hpp:168
This class stores the properties of a kart.
Definition: kart_properties.hpp:60
std::string m_wheel_filename[4]
Filename of the wheel models.
Definition: kart_properties.hpp:157
float m_collision_impulse_time
How long the collision impulse should be applied.
Definition: kart_properties.hpp:194
float m_wheel_base
Wheel base of the kart.
Definition: kart_properties.hpp:160
~KartProperties()
Destructor, dereferences the kart model.
Definition: kart_properties.cpp:120
float getCollisionImpulse() const
Returns the (artificial) collision impulse this kart will apply to another kart in case of a non-fron...
Definition: kart_properties.hpp:347
const video::SColor & getColor() const
Returns the dot color to use for this kart in the race gui.
Definition: kart_properties.hpp:300
const std::string & getEngineSfxType() const
Returns the engine type (used to change sfx depending on kart size).
Definition: kart_properties.hpp:314
int getShape() const
Returns the number of edges for the polygon used to draw the dot of this kart on the mini map of the ...
Definition: kart_properties.hpp:305
Vec3 m_bevel_factor
If != 0 a bevelled box shape is used by using a point cloud as a collision shape.
Definition: kart_properties.hpp:135
const std::string & getSkidSound() const
Returns the skid sound.
Definition: kart_properties.hpp:317
void getAllData(const XMLNode *root)
Actually reads in the data from the xml file.
Definition: kart_properties.cpp:453
const AIProperties * getAIPropertiesForDifficulty() const
Returns a pointer to the AI properties.
Definition: kart_properties.hpp:359
std::string m_root
Base directory for this kart.
Definition: kart_properties.hpp:63
int8_t getNitroMinConsumptionTicks() const
Returns minimum time during which nitro is consumed when pressing nitro key, to prevent using nitro i...
Definition: kart_properties.hpp:388
std::string m_ident
The computer readable-name of the kart driver.
Definition: kart_properties.hpp:103
std::shared_ptr< CachedCharacteristic > m_cached_characteristic
The cached combined characteristics.
Definition: kart_properties.hpp:129
core::stringw getName() const
Returns the name of this kart.
Definition: kart_properties.cpp:719
KartModel * getKartModelCopy(std::shared_ptr< GE::GERenderInfo > ri=nullptr) const
Returns a pointer to the KartModel object.
Definition: kart_properties.cpp:385
Material * m_icon_material
The absolute path of the icon texture to use.
Definition: kart_properties.hpp:72
void copyForPlayer(const KartProperties *source, HandicapLevel h=HANDICAP_NONE)
Copies this KartProperties to another one.
Definition: kart_properties.cpp:145
int m_shape
Number of vertices in polygon when drawing the dot on the mini map.
Definition: kart_properties.hpp:119
std::string m_icon_file
Filename of icon that represents the kart in the statusbar and the character select screen.
Definition: kart_properties.hpp:105
video::ITexture * m_minimap_icon
The texture to use in the minimap.
Definition: kart_properties.hpp:79
std::string m_shadow_file
Filename of the image file that contains the shadow for this kart.
Definition: kart_properties.hpp:108
Material * m_shadow_material
The texture with the shadow.
Definition: kart_properties.hpp:116
float m_physical_wheel_position
The position of the physical wheel is a weighted average of the two ends of the beveled shape.
Definition: kart_properties.hpp:144
video::ITexture * getMinimapIcon() const
Returns the texture to use in the minimap, or NULL if not defined.
Definition: kart_properties.hpp:258
const std::string & getIdent() const
Returns the internal identifier of this kart.
Definition: kart_properties.hpp:275
const float getPhysicalWheelPosition() const
Returns position of the physical wheel is a weighted average of the two ends of the beveled shape.
Definition: kart_properties.hpp:377
void load(const std::string &filename, const std::string &node)
Loads the kart properties from a file.
Definition: kart_properties.cpp:218
void copyFrom(const KartProperties *source)
Copies this KartProperties to another one.
Definition: kart_properties.cpp:171
video::SColor m_color
Color the represents the kart in the status bar and on the track-view.
Definition: kart_properties.hpp:117
void checkAllSet(const std::string &filename)
Checks if all necessary physics values are indeed defines.
Definition: kart_properties.cpp:634
const std::string & getKartDir() const
Returns the full path where the files for this kart are stored.
Definition: kart_properties.hpp:366
float getWheelBase() const
Returns the wheel base (distance front to rear axis).
Definition: kart_properties.hpp:326
TerrainImpulseType getTerrainImpulseType() const
Returns what kind of impulse STK should use in case of a kart-track collision.
Definition: kart_properties.hpp:342
std::shared_ptr< AIProperties > m_ai_properties[RaceManager::DIFFICULTY_COUNT]
AI Properties for this kart, as a separate object in order to reduce dependencies (and therefore comp...
Definition: kart_properties.hpp:69
Vec3 m_gravity_center_shift
Shift of center of gravity.
Definition: kart_properties.hpp:172
std::shared_ptr< CombinedCharacteristic > m_combined_characteristic
The base characteristics combined with the characteristics of this kart.
Definition: kart_properties.hpp:127
const AbstractCharacteristic * getCombinedCharacteristic() const
Returns the characteristics for this kart combined with the base characteristic.
Definition: kart_properties.cpp:678
const int getCustomSfxId(int type) const
Returns custom sound effects for this kart.
Definition: kart_properties.hpp:291
const AbstractCharacteristic * getCharacteristic() const
Returns the characteristics for this kart.
Definition: kart_properties.cpp:672
float getCollisionImpulseTime() const
Returns how long the collision impulse should be applied.
Definition: kart_properties.hpp:351
const std::vector< std::string > & getGroups() const
Returns the list of groups this kart belongs to.
Definition: kart_properties.hpp:310
float getRestitution(float speed) const
Returns the restitution factor for this kart.
Definition: kart_properties.hpp:355
const std::string & getAbsoluteIconFile() const
Returns the absolute path of the icon file of this kart.
Definition: kart_properties.hpp:287
int8_t m_nitro_min_consumption
Minimum time during which nitro is consumed when pressing the nitro key (to prevent using in very sma...
Definition: kart_properties.hpp:149
float m_collision_impulse
An additiojnal artificial impulse that pushes two karts in a side-side collision away from each other...
Definition: kart_properties.hpp:191
std::vector< int > m_custom_sfx_id
Vector of custom SFX ids.
Definition: kart_properties.hpp:97
std::string m_name
The human readable Name of the kart driver.
Definition: kart_properties.hpp:101
std::shared_ptr< AbstractCharacteristic > m_characteristic
The physical, item, etc.
Definition: kart_properties.hpp:125
float m_collision_terrain_impulse
An additional impulse to push a kart away if it hits terrain.
Definition: kart_properties.hpp:187
std::string m_kart_type
Type of the kart (for the properties)
Definition: kart_properties.hpp:154
static float UNDEFINED
Dummy value to detect unset properties.
Definition: kart_properties.hpp:90
static std::string getHandicapAsString(HandicapLevel h)
Returns the string representation of a handicap level.
Definition: kart_properties.cpp:57
const std::string & getKartType() const
Returns the type of this kart.
Definition: kart_properties.hpp:279
float m_shadow_x_offset
X offset of the shadow plane for this kart.
Definition: kart_properties.hpp:112
float getCollisionTerrainImpulse() const
Returns an artificial impulse to push karts away from the terrain it hits.
Definition: kart_properties.hpp:336
void setHatMeshName(const std::string &hat_name)
Sets the name of a mesh to be used for this kart.
Definition: kart_properties.cpp:394
std::string m_engine_sfx_type
Engine sound effect.
Definition: kart_properties.hpp:163
const Vec3 & getGravityCenterShift() const
Returns a shift of the center of mass (lowering the center of mass makes the karts more stable.
Definition: kart_properties.hpp:331
float getFrictionSlip() const
Returns friction slip.
Definition: kart_properties.hpp:322
Material * getShadowMaterial() const
Returns the shadow texture to use.
Definition: kart_properties.hpp:283
float m_shadow_scale
Scale of the shadow plane for this kart.
Definition: kart_properties.hpp:110
float getAccelerationEfficiency() const
This function returns a weighted average of engine power divide by mass for use as a single number su...
Definition: kart_properties.cpp:693
InterpolationArray m_restitution
Restitution depending on speed.
Definition: kart_properties.hpp:197
std::string m_minimap_icon_file
The minimap icon file.
Definition: kart_properties.hpp:75
TerrainImpulseType
STK can add an impulse to push karts away from the track in case of a kart-track collision.
Definition: kart_properties.hpp:181
int getVersion() const
Returns the version of the .kart file.
Definition: kart_properties.hpp:296
int m_version
Version of the .kart file.
Definition: kart_properties.hpp:93
const Vec3 & getBevelFactor() const
Returns the bevel factor (!=0 indicates to use a bevelled box).
Definition: kart_properties.hpp:370
std::vector< std::string > m_groups
List of all groups the kart belongs to.
Definition: kart_properties.hpp:87
float m_shadow_z_offset
Z offset of the shadow plane for this kart.
Definition: kart_properties.hpp:114
Material * getIconMaterial() const
Returns the material for the kart icons.
Definition: kart_properties.hpp:254
std::shared_ptr< KartModel > m_kart_model
The kart model and wheels.
Definition: kart_properties.hpp:84
void adjustForOnlineAddonKart(const KartProperties *source)
Change the graphical properties (icon, shadow..) for addon kart using in online mode.
Definition: kart_properties.cpp:405
const KartModel & getMasterKartModel() const
Returns a pointer to the main KartModel object.
Definition: kart_properties.hpp:265
Definition: material.hpp:48
Difficulty getDifficulty() const
Returns the difficulty.
Definition: race_manager.hpp:597
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:42