RigsofRods
Soft-body Physics Simulation
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 */
23 static const int MAX_ACTORS = 5000;
24 static const int MAX_WHEELS = 64;
25 static const int MAX_SUBMESHES = 500;
26 static const int MAX_TEXCOORDS = 3000;
27 static const int MAX_CABS = 3000;
28 static const int MAX_COMMANDS = 84;
29 static const int MAX_CAMERAS = 10;
30 static const int MAX_AEROENGINES = 8;
31 static const int MAX_SCREWPROPS = 8;
32 static const int MAX_SOUNDSCRIPTS_PER_TRUCK = 128;
33 static const int MAX_CPARTICLES = 10;
34 static const int MAX_CAMERARAIL = 50;
35 static const int MAX_CLIGHTS = 10;
36 
37 static const float RAD_PER_SEC_TO_RPM = 9.5492965855137f;
38 
39 /* other global static definitions */
40 static const int TRUCKFILEFORMATVERSION = 3;
41 
44 
45 /* physics defaults */
46 static const float DEFAULT_RIGIDIFIER_SPRING = 1000000.0f;
47 static const float DEFAULT_RIGIDIFIER_DAMP = 50000.0f;
48 static const float DEFAULT_SPRING = 9000000.0f;
49 static const float DEFAULT_DAMP = 12000.0f;
50 static const float DEFAULT_GRAVITY = -9.807f;
51 static const float DEFAULT_DRAG = 0.05f;
52 static const float DEFAULT_BEAM_DIAMETER = 0.05f;
53 static const float DEFAULT_COLLISION_RANGE = 0.02f;
54 static const float DEFAULT_MINIMASS = 50.0f;
55 static const float MIN_BEAM_LENGTH = 0.1f;
56 static const float INVERTED_MIN_BEAM_LENGTH = 1.0f / MIN_BEAM_LENGTH;
57 static const float BEAM_SKELETON_DIAMETER = 0.01f;
58 static const float DEFAULT_WATERDRAG = 10.0f;
59 static const float IRON_DENSITY = 7874.0f;
60 static const float BEAM_BREAK = 1000000.0f;
61 static const float BEAM_DEFORM = 400000.0f;
62 static const float BEAM_CREAK_DEFAULT = 100000.0f;
63 static const float WHEEL_FRICTION_COEF = 2.0f;
64 static const float CHASSIS_FRICTION_COEF = 0.5f;
65 static const float SPEED_STOP = 0.2f;
66 static const float STAB_RATE = 0.025f;
67 static const float NODE_FRICTION_COEF_DEFAULT = 1.0f;
68 static const float NODE_VOLUME_COEF_DEFAULT = 1.0f;
69 static const float NODE_SURFACE_COEF_DEFAULT = 1.0f;
70 static const float NODE_LOADWEIGHT_DEFAULT = -1.0f;
71 static const float SUPPORT_BEAM_LIMIT_DEFAULT = 4.0f;
72 static const float ROTATOR_FORCE_DEFAULT = 10000000.0f;
73 static const float ROTATOR_TOLERANCE_DEFAULT = 0.0f;
74 static const float HOOK_FORCE_DEFAULT = 10000000.0f;
75 static const float HOOK_RANGE_DEFAULT = 0.4f;
76 static const float HOOK_SPEED_DEFAULT = 0.00025f;
77 static const float HOOK_LOCK_TIMER_DEFAULT = 5.0;
78 static const int NODE_LOCKGROUP_DEFAULT = -1; // all hooks scan all nodes
79 static const int DEFAULT_DETACHER_GROUP = 0; // default for detaching beam group
80 static const float DEFAULT_SPEEDO_MAX_KPH = 140.f;
81 
82 static const float FLAP_ANGLES[6] = {0.f, -0.07f, -0.17f, -0.33f, -0.67f, -1.f};
83 
MAX_ACTORS
static const int MAX_ACTORS
maximum number of actors per game session
Definition: SimConstants.h:23
MAX_COMMANDS
static const int MAX_COMMANDS
maximum number of commands per actor
Definition: SimConstants.h:28
TRUCKFILEFORMATVERSION
static const int TRUCKFILEFORMATVERSION
truck file format version number
Definition: SimConstants.h:40
BEAM_SKELETON_DIAMETER
static const float BEAM_SKELETON_DIAMETER
Definition: SimConstants.h:57
NODE_FRICTION_COEF_DEFAULT
static const float NODE_FRICTION_COEF_DEFAULT
Definition: SimConstants.h:67
MAX_CLIGHTS
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
Definition: SimConstants.h:35
BEAM_DEFORM
static const float BEAM_DEFORM
Definition: SimConstants.h:61
IRON_DENSITY
static const float IRON_DENSITY
Definition: SimConstants.h:59
DEFAULT_BEAM_DIAMETER
static const float DEFAULT_BEAM_DIAMETER
5 centimeters default beam width
Definition: SimConstants.h:52
STAB_RATE
static const float STAB_RATE
Definition: SimConstants.h:66
NODE_LOADWEIGHT_DEFAULT
static const float NODE_LOADWEIGHT_DEFAULT
Definition: SimConstants.h:70
DEFAULT_RIGIDIFIER_SPRING
static const float DEFAULT_RIGIDIFIER_SPRING
Definition: SimConstants.h:46
HOOK_SPEED_DEFAULT
static const float HOOK_SPEED_DEFAULT
Definition: SimConstants.h:76
BEAM_BREAK
static const float BEAM_BREAK
Definition: SimConstants.h:60
DEFAULT_COLLISION_RANGE
static const float DEFAULT_COLLISION_RANGE
Definition: SimConstants.h:53
NODE_VOLUME_COEF_DEFAULT
static const float NODE_VOLUME_COEF_DEFAULT
Definition: SimConstants.h:68
DEFAULT_MINIMASS
static const float DEFAULT_MINIMASS
minimum node mass in Kg
Definition: SimConstants.h:54
DEFAULT_DETACHER_GROUP
static const int DEFAULT_DETACHER_GROUP
Definition: SimConstants.h:79
DEFAULT_RIGIDIFIER_DAMP
static const float DEFAULT_RIGIDIFIER_DAMP
Definition: SimConstants.h:47
INVERTED_MIN_BEAM_LENGTH
static const float INVERTED_MIN_BEAM_LENGTH
Definition: SimConstants.h:56
RAD_PER_SEC_TO_RPM
static const float RAD_PER_SEC_TO_RPM
Convert radian/second to RPM (60/2*PI)
Definition: SimConstants.h:37
HOOK_FORCE_DEFAULT
static const float HOOK_FORCE_DEFAULT
Definition: SimConstants.h:74
DEFAULT_WATERDRAG
static const float DEFAULT_WATERDRAG
Definition: SimConstants.h:58
MAX_CPARTICLES
static const int MAX_CPARTICLES
maximum number of custom particles per actor
Definition: SimConstants.h:33
ROTATOR_TOLERANCE_DEFAULT
static const float ROTATOR_TOLERANCE_DEFAULT
Definition: SimConstants.h:73
MAX_SUBMESHES
static const int MAX_SUBMESHES
maximum number of submeshes per actor
Definition: SimConstants.h:25
MAX_CAMERAS
static const int MAX_CAMERAS
maximum number of cameras per actor
Definition: SimConstants.h:29
HOOK_RANGE_DEFAULT
static const float HOOK_RANGE_DEFAULT
Definition: SimConstants.h:75
SPEED_STOP
static const float SPEED_STOP
Definition: SimConstants.h:65
NODE_SURFACE_COEF_DEFAULT
static const float NODE_SURFACE_COEF_DEFAULT
Definition: SimConstants.h:69
NODE_LOCKGROUP_DEFAULT
static const int NODE_LOCKGROUP_DEFAULT
Definition: SimConstants.h:78
WHEEL_FRICTION_COEF
static const float WHEEL_FRICTION_COEF
Definition: SimConstants.h:63
DEFAULT_DRAG
static const float DEFAULT_DRAG
Definition: SimConstants.h:51
MAX_CAMERARAIL
static const int MAX_CAMERARAIL
maximum number of camera rail points
Definition: SimConstants.h:34
DEFAULT_SPEEDO_MAX_KPH
static const float DEFAULT_SPEEDO_MAX_KPH
Definition: SimConstants.h:80
HOOK_LOCK_TIMER_DEFAULT
static const float HOOK_LOCK_TIMER_DEFAULT
Definition: SimConstants.h:77
ROTATOR_FORCE_DEFAULT
static const float ROTATOR_FORCE_DEFAULT
Definition: SimConstants.h:72
BEAM_CREAK_DEFAULT
static const float BEAM_CREAK_DEFAULT
Definition: SimConstants.h:62
CHASSIS_FRICTION_COEF
static const float CHASSIS_FRICTION_COEF
Chassis has 1/4 the friction of wheels.
Definition: SimConstants.h:64
MAX_SOUNDSCRIPTS_PER_TRUCK
static const int MAX_SOUNDSCRIPTS_PER_TRUCK
maximum number of soundsscripts per actor
Definition: SimConstants.h:32
DEFAULT_SPRING
static const float DEFAULT_SPRING
Definition: SimConstants.h:48
MIN_BEAM_LENGTH
static const float MIN_BEAM_LENGTH
minimum beam lenght is 10 centimeters
Definition: SimConstants.h:55
MAX_CABS
static const int MAX_CABS
maximum number of cabs per actor
Definition: SimConstants.h:27
DEFAULT_DAMP
static const float DEFAULT_DAMP
Definition: SimConstants.h:49
FLAP_ANGLES
static const float FLAP_ANGLES[6]
Definition: SimConstants.h:82
DEFAULT_GRAVITY
static const float DEFAULT_GRAVITY
earth gravity
Definition: SimConstants.h:50
SUPPORT_BEAM_LIMIT_DEFAULT
static const float SUPPORT_BEAM_LIMIT_DEFAULT
Definition: SimConstants.h:71
MAX_WHEELS
static const int MAX_WHEELS
maximum number of wheels per actor
Definition: SimConstants.h:24
MAX_SCREWPROPS
static const int MAX_SCREWPROPS
maximum number of boat screws per actor
Definition: SimConstants.h:31
MAX_AEROENGINES
static const int MAX_AEROENGINES
maximum number of aero engines per actor
Definition: SimConstants.h:30
MAX_TEXCOORDS
static const int MAX_TEXCOORDS
maximum number of texture coordinates per actor
Definition: SimConstants.h:26