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
AirBrake.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5
6 For more information, see http://www.rigsofrods.org/
7
8 Rigs of Rods is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License version 3, as
10 published by the Free Software Foundation.
11
12 Rigs of Rods is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23#include "Application.h"
24
25#include <Ogre.h>
26
27namespace RoR {
28
31
34
36{
37 friend class RoR::ActorSpawner; // Creates AirbrakeGfx
38
39private:
40
42 {
43 Ogre::Vector3 vertex;
44 Ogre::Vector3 normal;
45 Ogre::Vector2 texcoord;
46 };
47
48 Ogre::MeshPtr msh;
49 Ogre::SceneNode* snode;
54 Ogre::Vector3 offset;
55 float ratio;
56 float maxangle;
57 float area;
58
59 Ogre::Entity* ec;
60
61public:
62 Airbrake(ActorPtr actor, const char* basename, int num, node_t* ndref, node_t* ndx, node_t* ndy, node_t* nda, Ogre::Vector3 pos, float width, float length, float maxang, std::string const & texname, float tx1, float tx2, float tx3, float tx4, float lift_coef);
63 ~Airbrake() {} // Cleanup of visuals is done by GfxActor
64
65 void updatePosition(float amount);
66 void applyForce();
67 float getRatio() const { return ratio; }
68 float getMaxAngle() const { return maxangle; }
69};
70
73
74} // namespace RoR
Central state/object manager and communications hub.
Processes a RigDef::Document (parsed from 'truck' file format) into a simulated gameplay object (Acto...
void applyForce()
Definition AirBrake.cpp:171
node_t * nodex
Definition AirBrake.h:51
node_t * nodea
Definition AirBrake.h:53
float maxangle
attribute from truckfile
Definition AirBrake.h:56
Ogre::MeshPtr msh
Definition AirBrake.h:48
float ratio
Current state.
Definition AirBrake.h:55
float getMaxAngle() const
Definition AirBrake.h:68
node_t * nodey
Definition AirBrake.h:52
Ogre::SceneNode * snode
Definition AirBrake.h:49
node_t * noderef
Definition AirBrake.h:50
Ogre::Vector3 offset
gfx attribute
Definition AirBrake.h:54
void updatePosition(float amount)
Definition AirBrake.cpp:165
float area
Attribute set at spawn.
Definition AirBrake.h:57
Ogre::Entity * ec
Definition AirBrake.h:59
float getRatio() const
Definition AirBrake.h:67
Ogre::Vector2 texcoord
Definition AirBrake.h:45
Physics: A vertex in the softbody structure.
Definition SimData.h:260