Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
SimConstants.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 For more information, see http://www.rigsofrods.org/
4
5 Rigs of Rods is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 3, as
7 published by the Free Software Foundation.
8
9 Rigs of Rods is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#define PHYSICS_DT 0.0005f // fixed dt of 0.5 ms
21
22/* maximum limits */
23static const int MAX_ACTORS = 5000;
24static const int MAX_WHEELS = 64;
25static const int MAX_SUBMESHES = 500;
26static const int MAX_TEXCOORDS = 3000;
27static const int MAX_CABS = 3000;
28static const int MAX_COMMANDS = 84;
29static const int MAX_CAMERAS = 10;
30static const int MAX_AEROENGINES = 8;
31static const int MAX_SCREWPROPS = 8;
32static const int MAX_SOUNDSCRIPTS_PER_TRUCK = 128;
33static const int MAX_CPARTICLES = 10;
34static const int MAX_CAMERARAIL = 50;
35static const int MAX_CLIGHTS = 10;
36
37static const float RAD_PER_SEC_TO_RPM = 9.5492965855137f;
38
39/* other global static definitions */
40static const int TRUCKFILEFORMATVERSION = 3;
41
44
45/* physics defaults */
46static const float DEFAULT_RIGIDIFIER_SPRING = 1000000.0f;
47static const float DEFAULT_RIGIDIFIER_DAMP = 50000.0f;
48static const float DEFAULT_SPRING = 9000000.0f;
49static const float DEFAULT_DAMP = 12000.0f;
50static const float DEFAULT_GRAVITY = -9.807f;
51static const float DEFAULT_DRAG = 0.05f;
52static const float DEFAULT_BEAM_DIAMETER = 0.05f;
53static const float DEFAULT_COLLISION_RANGE = 0.02f;
54static const float DEFAULT_MINIMASS = 50.0f;
55static const float MIN_BEAM_LENGTH = 0.1f;
56static const float INVERTED_MIN_BEAM_LENGTH = 1.0f / MIN_BEAM_LENGTH;
57static const float BEAM_SKELETON_DIAMETER = 0.01f;
58static const float DEFAULT_WATERDRAG = 10.0f;
59static const float IRON_DENSITY = 7874.0f;
60static const float BEAM_BREAK = 1000000.0f;
61static const float BEAM_DEFORM = 400000.0f;
62static const float BEAM_CREAK_DEFAULT = 100000.0f;
63static const float BEAM_PLASTIC_COEF_DEFAULT = 0.f;
64static const float WHEEL_FRICTION_COEF = 2.0f;
65static const float CHASSIS_FRICTION_COEF = 0.5f;
66static const float SPEED_STOP = 0.2f;
67static const float STAB_RATE = 0.025f;
68static const float NODE_FRICTION_COEF_DEFAULT = 1.0f;
69static const float NODE_VOLUME_COEF_DEFAULT = 1.0f;
70static const float NODE_SURFACE_COEF_DEFAULT = 1.0f;
71static const float NODE_LOADWEIGHT_DEFAULT = 10.0f;
72static const float SUPPORT_BEAM_LIMIT_DEFAULT = 4.0f;
73static const float ROTATOR_FORCE_DEFAULT = 10000000.0f;
74static const float ROTATOR_TOLERANCE_DEFAULT = 0.0f;
75static const float HOOK_FORCE_DEFAULT = 10000000.0f;
76static const float HOOK_RANGE_DEFAULT = 0.4f;
77static const float HOOK_SPEED_DEFAULT = 0.00025f;
78static const float HOOK_LOCK_TIMER_DEFAULT = 5.0;
79static const int NODE_LOCKGROUP_DEFAULT = -1; // all hooks scan all nodes
80static const int DEFAULT_DETACHER_GROUP = 0; // default for detaching beam group
81static const float DEFAULT_SPEEDO_MAX_KPH = 140.f;
82
83static const float FLAP_ANGLES[6] = {0.f, -0.07f, -0.17f, -0.33f, -0.67f, -1.f};
84
static const int MAX_CABS
maximum number of cabs per actor
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
static const int MAX_CAMERAS
maximum number of cameras per actor
static const int MAX_AEROENGINES
maximum number of aero engines per actor
static const int MAX_CPARTICLES
maximum number of custom particles per actor
static const int MAX_WHEELS
maximum number of wheels per actor
static const int TRUCKFILEFORMATVERSION
truck file format version number
static const int MAX_SUBMESHES
maximum number of submeshes per actor
static const int MAX_COMMANDS
maximum number of commands per actor
static const int MAX_SOUNDSCRIPTS_PER_TRUCK
maximum number of soundsscripts per actor
static const int MAX_TEXCOORDS
maximum number of texture coordinates per actor
static const int MAX_CAMERARAIL
maximum number of camera rail points
static const int MAX_ACTORS
maximum number of actors per game session
static const int MAX_SCREWPROPS
maximum number of boat screws per actor
static const float RAD_PER_SEC_TO_RPM
Convert radian/second to RPM (60/2*PI)
static const float BEAM_SKELETON_DIAMETER
static const float DEFAULT_SPRING
static const int NODE_LOCKGROUP_DEFAULT
static const float DEFAULT_DRAG
static const float DEFAULT_BEAM_DIAMETER
5 centimeters default beam width
static const float DEFAULT_RIGIDIFIER_DAMP
static const int DEFAULT_DETACHER_GROUP
static const float STAB_RATE
static const float WHEEL_FRICTION_COEF
static const float BEAM_CREAK_DEFAULT
static const float DEFAULT_COLLISION_RANGE
static const float BEAM_DEFORM
static const float DEFAULT_SPEEDO_MAX_KPH
static const float ROTATOR_FORCE_DEFAULT
static const float HOOK_LOCK_TIMER_DEFAULT
static const float DEFAULT_DAMP
static const float BEAM_PLASTIC_COEF_DEFAULT
static const float ROTATOR_TOLERANCE_DEFAULT
static const float NODE_LOADWEIGHT_DEFAULT
static const float HOOK_RANGE_DEFAULT
static const float FLAP_ANGLES[6]
static const float HOOK_FORCE_DEFAULT
static const float CHASSIS_FRICTION_COEF
Chassis has 1/4 the friction of wheels.
static const float HOOK_SPEED_DEFAULT
static const float NODE_SURFACE_COEF_DEFAULT
static const float DEFAULT_MINIMASS
minimum node mass in Kg
static const float SUPPORT_BEAM_LIMIT_DEFAULT
static const float DEFAULT_RIGIDIFIER_SPRING
static const float NODE_VOLUME_COEF_DEFAULT
static const float NODE_FRICTION_COEF_DEFAULT
static const float INVERTED_MIN_BEAM_LENGTH
static const float SPEED_STOP
static const float DEFAULT_GRAVITY
earth gravity
static const float IRON_DENSITY
static const float BEAM_BREAK
static const float DEFAULT_WATERDRAG
static const float MIN_BEAM_LENGTH
minimum beam lenght is 10 centimeters