RigsofRods
Soft-body Physics Simulation
Data Structures | Public Member Functions | Private Member Functions | Private Attributes
RoR::FlexObj Class Reference

A visual mesh, forming a chassis for softbody actor At most one instance is created per actor. More...

#include <FlexObj.h>

+ Collaboration diagram for RoR::FlexObj:

Data Structures

struct  FlexObjVertex
 

Public Member Functions

 FlexObj (RoR::GfxActor *gfx_actor, node_t *all_nodes, std::vector< CabTexcoord > &texcoords, int numtriangles, int *triangles, std::vector< CabSubmesh > &submeshes, char *texname, const char *name, char *backtexname, char *transtexname)
 
 ~FlexObj ()
 
Ogre::Vector3 UpdateFlexObj ()
 
void ScaleFlexObj (float factor)
 

Private Member Functions

int ComputeVertexPos (int tidx, int v, std::vector< CabSubmesh > &submeshes)
 Compute vertex position in the vertexbuffer (0-based offset) for node v of triangle tidx More...
 
Ogre::Vector3 UpdateMesh ()
 

Private Attributes

Ogre::MeshPtr m_mesh
 
std::vector< Ogre::SubMesh * > m_submeshes
 
RoR::GfxActorm_gfx_actor
 
float * m_s_ref
 
size_t m_vertex_count
 
int * m_vertex_nodes
 
Ogre::VertexDeclaration * m_vertex_format
 
Ogre::HardwareVertexBufferSharedPtr m_hw_vbuf
 
union {
   float *   m_vertices_raw
 
   FlexObjVertex *   m_vertices
 
}; 
 
size_t m_index_count
 
unsigned short * m_indices
 
int m_triangle_count
 

Detailed Description

A visual mesh, forming a chassis for softbody actor At most one instance is created per actor.

Definition at line 59 of file FlexObj.h.

Constructor & Destructor Documentation

◆ FlexObj()

FlexObj::FlexObj ( RoR::GfxActor gfx_actor,
node_t all_nodes,
std::vector< CabTexcoord > &  texcoords,
int  numtriangles,
int *  triangles,
std::vector< CabSubmesh > &  submeshes,
char *  texname,
const char *  name,
char *  backtexname,
char *  transtexname 
)

Definition at line 32 of file FlexObj.cpp.

+ Here is the call graph for this function:

◆ ~FlexObj()

FlexObj::~FlexObj ( )

Definition at line 237 of file FlexObj.cpp.

Member Function Documentation

◆ ComputeVertexPos()

int FlexObj::ComputeVertexPos ( int  tidx,
int  v,
std::vector< CabSubmesh > &  submeshes 
)
private

Compute vertex position in the vertexbuffer (0-based offset) for node v of triangle tidx

Definition at line 158 of file FlexObj.cpp.

+ Here is the caller graph for this function:

◆ ScaleFlexObj()

void FlexObj::ScaleFlexObj ( float  factor)

Definition at line 149 of file FlexObj.cpp.

◆ UpdateFlexObj()

Vector3 FlexObj::UpdateFlexObj ( )

Definition at line 230 of file FlexObj.cpp.

+ Here is the call graph for this function:

◆ UpdateMesh()

Vector3 FlexObj::UpdateMesh ( )
private

Definition at line 186 of file FlexObj.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ @13

union { ... }

◆ m_gfx_actor

RoR::GfxActor* RoR::FlexObj::m_gfx_actor
private

Definition at line 95 of file FlexObj.h.

◆ m_hw_vbuf

Ogre::HardwareVertexBufferSharedPtr RoR::FlexObj::m_hw_vbuf
private

Definition at line 101 of file FlexObj.h.

◆ m_index_count

size_t RoR::FlexObj::m_index_count
private

Definition at line 108 of file FlexObj.h.

◆ m_indices

unsigned short* RoR::FlexObj::m_indices
private

Definition at line 109 of file FlexObj.h.

◆ m_mesh

Ogre::MeshPtr RoR::FlexObj::m_mesh
private

Definition at line 93 of file FlexObj.h.

◆ m_s_ref

float* RoR::FlexObj::m_s_ref
private

Definition at line 96 of file FlexObj.h.

◆ m_submeshes

std::vector<Ogre::SubMesh*> RoR::FlexObj::m_submeshes
private

Definition at line 94 of file FlexObj.h.

◆ m_triangle_count

int RoR::FlexObj::m_triangle_count
private

Definition at line 110 of file FlexObj.h.

◆ m_vertex_count

size_t RoR::FlexObj::m_vertex_count
private

Definition at line 98 of file FlexObj.h.

◆ m_vertex_format

Ogre::VertexDeclaration* RoR::FlexObj::m_vertex_format
private

Definition at line 100 of file FlexObj.h.

◆ m_vertex_nodes

int* RoR::FlexObj::m_vertex_nodes
private

Definition at line 99 of file FlexObj.h.

◆ m_vertices

FlexObjVertex* RoR::FlexObj::m_vertices

Definition at line 105 of file FlexObj.h.

◆ m_vertices_raw

float* RoR::FlexObj::m_vertices_raw

Definition at line 104 of file FlexObj.h.


The documentation for this class was generated from the following files: