RigsofRods
Soft-body Physics Simulation
|
#include <ProceduralRoad.h>
Data Structures | |
struct | CoVertice_t |
Public Member Functions | |
ProceduralRoad () | |
virtual | ~ProceduralRoad () override |
void | addBlock (Ogre::Vector3 pos, Ogre::Quaternion rot, RoadType type, float width, float bwidth, float bheight, int pillartype=1) |
void | addQuad (Ogre::Vector3 p1, Ogre::Vector3 p2, Ogre::Vector3 p3, Ogre::Vector3 p4, TextureFit texfit, Ogre::Vector3 pos, Ogre::Vector3 lastpos, float width, bool flip=false) |
void | addCollisionQuad (Ogre::Vector3 p1, Ogre::Vector3 p2, Ogre::Vector3 p3, Ogre::Vector3 p4, ground_model_t *gm, bool flip=false) |
void | addCollisionQuad (Ogre::Vector3 p1, Ogre::Vector3 p2, Ogre::Vector3 p3, Ogre::Vector3 p4, std::string const &gm_name, bool flip=false) |
void | createMesh () |
void | finish (Ogre::SceneNode *snode) |
void | setCollisionEnabled (bool v) |
Public Member Functions inherited from RefCountingObject< ProceduralRoad > | |
RefCountingObject () | |
virtual | ~RefCountingObject () |
void | AddRef () |
void | Release () |
Static Public Attributes | |
static const unsigned int | MAX_VERTEX = 50000 |
static const unsigned int | MAX_TRIS = 50000 |
Private Member Functions | |
Ogre::Vector3 | baseOf (Ogre::Vector3 p) |
void | computePoints (Ogre::Vector3 *pts, Ogre::Vector3 pos, Ogre::Quaternion rot, RoadType type, float width, float bwidth, float bheight) |
void | textureFit (Ogre::Vector3 p1, Ogre::Vector3 p2, Ogre::Vector3 p3, Ogre::Vector3 p4, TextureFit texfit, Ogre::Vector2 *texc, Ogre::Vector3 pos, Ogre::Vector3 lastpos, float width) |
Private Attributes | |
Ogre::MeshPtr | msh |
Ogre::SubMesh * | mainsub = nullptr |
Ogre::Vector2 | tex [MAX_VERTEX] = {} |
Ogre::Vector3 | vertex [MAX_VERTEX] = {} |
int | tricount = 0 |
int | vertexcount = 0 |
uint16_t | tris [MAX_TRIS *3] = {} |
Ogre::Quaternion | lastrot |
Ogre::SceneNode * | snode = nullptr |
Ogre::Vector3 | lastpos |
bool | first = true |
float | lastbheight = 0.f |
float | lastbwidth = 0.f |
float | lastwidth = 0.f |
RoadType | lasttype |
int | mid = 0 |
bool | collision = true |
Register collision triangles? More... | |
std::vector< int > | registeredCollTris |
Additional Inherited Members | |
Static Public Member Functions inherited from RefCountingObject< ProceduralRoad > | |
static void | RegisterRefCountingObject (AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name) |
Data Fields inherited from RefCountingObject< ProceduralRoad > | |
int | m_refcount |
std::mutex | m_refcount_mtx |
Definition at line 60 of file ProceduralRoad.h.
ProceduralRoad::ProceduralRoad | ( | ) |
Definition at line 38 of file ProceduralRoad.cpp.
|
overridevirtual |
void ProceduralRoad::addBlock | ( | Ogre::Vector3 | pos, |
Ogre::Quaternion | rot, | ||
RoadType | type, | ||
float | width, | ||
float | bwidth, | ||
float | bheight, | ||
int | pillartype = 1 |
||
) |
Definition at line 81 of file ProceduralRoad.cpp.
void RoR::ProceduralRoad::addCollisionQuad | ( | Ogre::Vector3 | p1, |
Ogre::Vector3 | p2, | ||
Ogre::Vector3 | p3, | ||
Ogre::Vector3 | p4, | ||
ground_model_t * | gm, | ||
bool | flip = false |
||
) |
void ProceduralRoad::addCollisionQuad | ( | Ogre::Vector3 | p1, |
Ogre::Vector3 | p2, | ||
Ogre::Vector3 | p3, | ||
Ogre::Vector3 | p4, | ||
std::string const & | gm_name, | ||
bool | flip = false |
||
) |
void ProceduralRoad::addQuad | ( | Ogre::Vector3 | p1, |
Ogre::Vector3 | p2, | ||
Ogre::Vector3 | p3, | ||
Ogre::Vector3 | p4, | ||
TextureFit | texfit, | ||
Ogre::Vector3 | pos, | ||
Ogre::Vector3 | lastpos, | ||
float | width, | ||
bool | flip = false |
||
) |
p1 | Top left point. |
p2 | Top right point. |
Definition at line 358 of file ProceduralRoad.cpp.
|
inlineprivate |
|
private |
Definition at line 276 of file ProceduralRoad.cpp.
void ProceduralRoad::createMesh | ( | ) |
Create the mesh via the MeshManager
Define the vertices
Define triangles
Create vertex data structure for vertices shared between sub meshes
Create declaration (memory format) of vertex data
Allocate vertex buffer of the requested number of vertices (vertexCount) and bytes per vertex (offset)
Upload the vertex data to the card
Set vertex buffer binding so buffer 0 is bound to our vertex buffer
Allocate index buffer of the requested number of vertices (ibufCount)
Upload the index data to the card
Set parameters of the submesh
Notify Mesh object that it has been loaded
Definition at line 577 of file ProceduralRoad.cpp.
void ProceduralRoad::finish | ( | Ogre::SceneNode * | snode | ) |
Definition at line 61 of file ProceduralRoad.cpp.
|
inline |
|
private |
Definition at line 403 of file ProceduralRoad.cpp.
|
private |
Register collision triangles?
Definition at line 113 of file ProceduralRoad.h.
|
private |
Definition at line 107 of file ProceduralRoad.h.
|
private |
Definition at line 108 of file ProceduralRoad.h.
|
private |
Definition at line 109 of file ProceduralRoad.h.
|
private |
Definition at line 106 of file ProceduralRoad.h.
|
private |
Definition at line 104 of file ProceduralRoad.h.
|
private |
Definition at line 111 of file ProceduralRoad.h.
|
private |
Definition at line 110 of file ProceduralRoad.h.
|
private |
Definition at line 96 of file ProceduralRoad.h.
|
static |
Definition at line 80 of file ProceduralRoad.h.
|
static |
Definition at line 79 of file ProceduralRoad.h.
|
private |
Definition at line 112 of file ProceduralRoad.h.
|
private |
Definition at line 95 of file ProceduralRoad.h.
|
private |
Definition at line 114 of file ProceduralRoad.h.
|
private |
Definition at line 105 of file ProceduralRoad.h.
|
private |
Definition at line 98 of file ProceduralRoad.h.
|
private |
Definition at line 100 of file ProceduralRoad.h.
|
private |
Definition at line 102 of file ProceduralRoad.h.
|
private |
Definition at line 99 of file ProceduralRoad.h.
|
private |
Definition at line 101 of file ProceduralRoad.h.