19 #ifndef HEADER_KART_PROPERTIES_HPP 20 #define HEADER_KART_PROPERTIES_HPP 27 #include <irrString.h> 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" 69 std::shared_ptr<AIProperties> m_ai_properties[RaceManager::DIFFICULTY_COUNT];
157 std::string m_wheel_filename[4];
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)
210 m_wheel_base = fabsf(kart_length / 1.425f);
221 void updateForOnlineKart(
const std::string&
id,
const Vec3& gravity_shift,
225 m_gravity_center_shift = gravity_shift;
226 setWheelBase(kart_length);
229 void getAllData (
const XMLNode * root);
230 void checkAllSet (
const std::string &filename);
231 bool isInGroup (
const std::string &group)
const;
253 KartModel* getKartModelCopy(std::shared_ptr<RenderInfo> ri=
nullptr)
const;
259 void setHatMeshName(
const std::string &hat_name);
261 core::stringw getName()
const;
263 const std::string getNonTranslatedName()
const {
return m_name;}
267 const std::string&
getIdent ()
const {
return m_ident; }
284 const {
return m_custom_sfx_id[type]; }
292 const video::SColor &
getColor ()
const {
return m_color; }
301 const std::vector<std::string>&
329 {
return m_collision_terrain_impulse;}
335 {
return m_terrain_impulse_type; }
353 return m_ai_properties[RaceManager::get()->
getDifficulty()].get();
371 return m_physical_wheel_position;
375 float getAccelerationEfficiency()
const;
381 {
return m_nitro_min_consumption; }
383 bool isAddon()
const {
return m_is_addon; }
391 float getSuspensionStiffness()
const;
392 float getSuspensionRest()
const;
393 float getSuspensionTravel()
const;
394 bool getSuspensionExpSpringResponse()
const;
395 float getSuspensionMaxForce()
const;
397 float getStabilityRollInfluence()
const;
398 float getStabilityChassisLinearDamping()
const;
399 float getStabilityChassisAngularDamping()
const;
400 float getStabilityDownwardImpulseFactor()
const;
401 float getStabilityTrackConnectionAccel()
const;
402 std::vector<float> getStabilityAngularFactor()
const;
403 float getStabilitySmoothFlyingImpulse()
const;
406 float getTurnTimeResetSteer()
const;
409 float getEnginePower()
const;
410 float getEngineMaxSpeed()
const;
411 float getEngineGenericMaxSpeed()
const;
412 float getEngineBrakeFactor()
const;
413 float getEngineBrakeTimeIncrease()
const;
414 float getEngineMaxSpeedReverseRatio()
const;
416 std::vector<float> getGearSwitchRatio()
const;
417 std::vector<float> getGearPowerIncrease()
const;
419 float getMass()
const;
421 float getWheelsDampingRelaxation()
const;
422 float getWheelsDampingCompression()
const;
424 float getJumpAnimationTime()
const;
426 float getLeanMax()
const;
427 float getLeanSpeed()
const;
429 float getAnvilDuration()
const;
430 float getAnvilWeight()
const;
431 float getAnvilSpeedFactor()
const;
433 float getParachuteFriction()
const;
434 float getParachuteDuration()
const;
435 float getParachuteDurationOther()
const;
436 float getParachuteDurationRankMult()
const;
437 float getParachuteDurationSpeedMult()
const;
438 float getParachuteLboundFraction()
const;
439 float getParachuteUboundFraction()
const;
440 float getParachuteMaxSpeed()
const;
442 float getFrictionKartFriction()
const;
444 float getBubblegumDuration()
const;
445 float getBubblegumSpeedFraction()
const;
446 float getBubblegumTorque()
const;
447 float getBubblegumFadeInTime()
const;
448 float getBubblegumShieldDuration()
const;
450 float getZipperDuration()
const;
451 float getZipperForce()
const;
452 float getZipperSpeedGain()
const;
453 float getZipperMaxSpeedIncrease()
const;
454 float getZipperFadeOutTime()
const;
456 float getSwatterDuration()
const;
457 float getSwatterDistance()
const;
458 float getSwatterSquashDuration()
const;
459 float getSwatterSquashSlowdown()
const;
461 float getPlungerBandMaxLength()
const;
462 float getPlungerBandForce()
const;
463 float getPlungerBandDuration()
const;
464 float getPlungerBandSpeedIncrease()
const;
465 float getPlungerBandFadeOutTime()
const;
466 float getPlungerInFaceTime()
const;
468 std::vector<float> getStartupTime()
const;
469 std::vector<float> getStartupBoost()
const;
471 float getRescueDuration()
const;
472 float getRescueVertOffset()
const;
473 float getRescueHeight()
const;
475 float getExplosionDuration()
const;
476 float getExplosionRadius()
const;
477 float getExplosionInvulnerabilityTime()
const;
479 float getNitroDuration()
const;
480 float getNitroEngineForce()
const;
481 float getNitroEngineMult()
const;
482 float getNitroConsumption()
const;
483 float getNitroSmallContainer()
const;
484 float getNitroBigContainer()
const;
485 float getNitroMaxSpeedIncrease()
const;
486 float getNitroFadeOutTime()
const;
487 float getNitroMax()
const;
489 float getSlipstreamDurationFactor()
const;
490 float getSlipstreamBaseSpeed()
const;
491 float getSlipstreamLength()
const;
492 float getSlipstreamWidth()
const;
493 float getSlipstreamInnerFactor()
const;
494 float getSlipstreamMinCollectTime()
const;
495 float getSlipstreamMaxCollectTime()
const;
496 float getSlipstreamAddPower()
const;
497 float getSlipstreamMinSpeed()
const;
498 float getSlipstreamMaxSpeedIncrease()
const;
499 float getSlipstreamFadeOutTime()
const;
501 float getSkidIncrease()
const;
502 float getSkidDecrease()
const;
503 float getSkidMax()
const;
504 float getSkidTimeTillMax()
const;
505 float getSkidVisual()
const;
506 float getSkidVisualTime()
const;
507 float getSkidRevertVisualTime()
const;
508 float getSkidMinSpeed()
const;
509 std::vector<float> getSkidTimeTillBonus()
const;
510 std::vector<float> getSkidBonusSpeed()
const;
511 std::vector<float> getSkidBonusTime()
const;
512 std::vector<float> getSkidBonusForce()
const;
513 float getSkidPhysicalJumpTime()
const;
514 float getSkidGraphicalJumpTime()
const;
515 float getSkidPostSkidRotateFactor()
const;
516 float getSkidReduceTurnMin()
const;
517 float getSkidReduceTurnMax()
const;
518 bool getSkidEnabled()
const;
std::string m_engine_sfx_type
Engine sound effect.
Definition: kart_properties.hpp:163
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:39
const std::string & getSkidSound() const
Returns the skid sound.
Definition: kart_properties.hpp:309
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
int getVersion() const
Returns the version of the .kart file.
Definition: kart_properties.hpp:288
float getFrictionSlip() const
Returns friction slip.
Definition: kart_properties.hpp:314
float m_wheel_base
Wheel base of the kart.
Definition: kart_properties.hpp:160
std::string m_root
Base directory for this kart.
Definition: kart_properties.hpp:63
A wrapper around bullets btVector3 to include conventient conversion functions (e.g.
Definition: vec3.hpp:34
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:380
Material * m_icon_material
The absolute path of the icon texture to use.
Definition: kart_properties.hpp:72
const std::string & getIdent() const
Returns the internal identifier of this kart.
Definition: kart_properties.hpp:267
int m_version
Version of the .kart file.
Definition: kart_properties.hpp:93
std::string m_ident
The computer readable-name of the kart driver.
Definition: kart_properties.hpp:103
float m_shadow_x_offset
X offset of the shadow plane for this kart.
Definition: kart_properties.hpp:112
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:297
video::ITexture * getMinimapIcon() const
Returns the texture to use in the minimap, or NULL if not defined.
Definition: kart_properties.hpp:250
const KartModel & getMasterKartModel() const
Returns a pointer to the main KartModel object.
Definition: kart_properties.hpp:257
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
Definition: three_d_animation.hpp:32
std::vector< std::string > m_groups
List of all groups the kart belongs to.
Definition: kart_properties.hpp:87
A simple class that stores all AI related properties.
Definition: ai_properties.hpp:39
Material * m_shadow_material
The texture with the shadow.
Definition: kart_properties.hpp:116
const AIProperties * getAIPropertiesForDifficulty() const
Returns a pointer to the AI properties.
Definition: kart_properties.hpp:351
Difficulty getDifficulty() const
Returns the difficulty.
Definition: race_manager.hpp:596
const std::string & getAbsoluteIconFile() const
Returns the absolute path of the icon file of this kart.
Definition: kart_properties.hpp:279
std::string m_kart_type
Type of the kart (for the properties)
Definition: kart_properties.hpp:154
const int getCustomSfxId(int type) const
Returns custom sound effects for this kart.
Definition: kart_properties.hpp:283
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:339
video::SColor m_color
Color the represents the kart in the status bar and on the track-view.
Definition: kart_properties.hpp:117
const std::vector< std::string > & getGroups() const
Returns the list of groups this kart belongs to.
Definition: kart_properties.hpp:302
Definition: cached_characteristic.hpp:26
float m_shadow_z_offset
Z offset of the shadow plane for this kart.
Definition: kart_properties.hpp:114
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
const std::string & getKartDir() const
Returns the full path where the files for this kart are stored.
Definition: kart_properties.hpp:358
int m_shape
Number of vertices in polygon when drawing the dot on the mini map.
Definition: kart_properties.hpp:119
float getCollisionTerrainImpulse() const
Returns an artificial impulse to push karts away from the terrain it hits.
Definition: kart_properties.hpp:328
std::shared_ptr< AbstractCharacteristic > m_characteristic
The physical, item, etc.
Definition: kart_properties.hpp:125
Characteristics are the properties of a kart that influence gameplay mechanics.
Definition: abstract_characteristic.hpp:42
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
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:369
This class stores a 3D kart model.
Definition: kart_model.hpp:167
float m_shadow_scale
Scale of the shadow plane for this kart.
Definition: kart_properties.hpp:110
This class manages a set of (x_i,y_i) points, x_i must be sorted.
Definition: interpolation_array.hpp:31
Definition: material.hpp:47
This class stores the properties of a kart.
Definition: kart_properties.hpp:59
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
Material * getShadowMaterial() const
Returns the shadow texture to use.
Definition: kart_properties.hpp:275
Vec3 m_gravity_center_shift
Shift of center of gravity.
Definition: kart_properties.hpp:172
std::vector< int > m_custom_sfx_id
Vector of custom SFX ids.
Definition: kart_properties.hpp:97
std::shared_ptr< KartModel > m_kart_model
The kart model and wheels.
Definition: kart_properties.hpp:84
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:323
Definition: combined_characteristic.hpp:26
float getWheelBase() const
Returns the wheel base (distance front to rear axis).
Definition: kart_properties.hpp:318
utility class used to parse XML files
Definition: xml_node.hpp:47
const Vec3 & getBevelFactor() const
Returns the bevel factor (!=0 indicates to use a bevelled box).
Definition: kart_properties.hpp:362
std::shared_ptr< CombinedCharacteristic > m_combined_characteristic
The base characteristics combined with the characteristics of this kart.
Definition: kart_properties.hpp:127
const std::string & getEngineSfxType() const
Returns the engine type (used to change sfx depending on kart size).
Definition: kart_properties.hpp:306
float m_collision_terrain_impulse
An additional impulse to push a kart away if it hits terrain.
Definition: kart_properties.hpp:187
Definition: render_info.hpp:27
Material * getIconMaterial() const
Returns the material for the kart icons.
Definition: kart_properties.hpp:246
float get(float x) const
Returns the interpolated Y value for a given x.
Definition: interpolation_array.hpp:101
float m_collision_impulse_time
How long the collision impulse should be applied.
Definition: kart_properties.hpp:194
const video::SColor & getColor() const
Returns the dot color to use for this kart in the race gui.
Definition: kart_properties.hpp:292
TerrainImpulseType getTerrainImpulseType() const
Returns what kind of impulse STK should use in case of a kart-track collision.
Definition: kart_properties.hpp:334
std::string m_name
The human readable Name of the kart driver.
Definition: kart_properties.hpp:101
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
static float UNDEFINED
Dummy value to detect unset properties.
Definition: kart_properties.hpp:90
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
const std::string & getKartType() const
Returns the type of this kart.
Definition: kart_properties.hpp:271
float getRestitution(float speed) const
Returns the restitution factor for this kart.
Definition: kart_properties.hpp:347
std::string m_minimap_icon_file
The minimap icon file.
Definition: kart_properties.hpp:75
std::shared_ptr< CachedCharacteristic > m_cached_characteristic
The cached combined characteristics.
Definition: kart_properties.hpp:129
float getCollisionImpulseTime() const
Returns how long the collision impulse should be applied.
Definition: kart_properties.hpp:343
InterpolationArray m_restitution
Restitution depending on speed.
Definition: kart_properties.hpp:197