35#include <OgreVector3.h>
36#include <OgreColourValue.h>
130 void OpenFile(
const char* fopen_mode);
175 Ogre::Vector3 offset,
176 Ogre::Vector3 rotation,
177 std::vector<unsigned int> & node_indices,
178 std::vector<ForvertTempData>& forvert_data,
179 const std::string& mesh_name,
180 const std::string& resource_group_name);
183 unsigned int wheel_index,
184 int axis_node_1_index,
185 int axis_node_2_index,
190 std::string
const & rim_mesh_name,
191 std::string
const & rim_mesh_rg,
192 std::string
const & tire_material_name,
193 std::string
const & tire_material_rg);
Global forward declarations.
Processes a RigDef::Document (parsed from 'truck' file format) into a simulated gameplay object (Acto...
Enables saving and loading flexbodies from/to binary file.
void ReadFlexbodyColorsBuffer(FlexBodyCacheData *flexbody)
void WriteFlexbodyNormalsBuffer(FlexBody *flexbody)
void ReadFlexbodyPositionsBuffer(FlexBodyCacheData *flexbody)
void OpenFile(const char *fopen_mode)
FlexBodyCacheData * GetLoadedItem(unsigned index)
unsigned int m_fileformat_version
void ReadFromFile(void *dest, size_t length)
void WriteToFile(void *source, size_t length)
void WriteFlexbodyHeader(FlexBody *flexbody)
void WriteFlexbodyLocatorList(FlexBody *flexbody)
void ReadFlexbodyNormalsBuffer(FlexBodyCacheData *flexbody)
void ReadFlexbodyHeader(FlexBodyCacheData *flexbody)
void AddItemToSave(FlexBody *fb)
void WriteFlexbodyColorsBuffer(FlexBody *flexbody)
void ReadFlexbodyLocatorList(FlexBodyCacheData *flexbody)
@ RESULT_CODE_ERR_CACHE_NUMBER_UNDEFINED
@ RESULT_CODE_ERR_FOPEN_FAILED
@ RESULT_CODE_FWRITE_OUTPUT_INCOMPLETE
@ RESULT_CODE_FREAD_OUTPUT_INCOMPLETE
@ RESULT_CODE_ERR_VERSION_MISMATCH
@ RESULT_CODE_GENERAL_ERROR
@ RESULT_CODE_ERR_SIGNATURE_MISMATCH
void WriteFlexbodyPositionsBuffer(FlexBody *flexbody)
std::vector< FlexBodyCacheData > m_loaded_items
void ReadMetadata(FlexBodyFileMetadata *meta)
static const unsigned int FILE_FORMAT_VERSION
void ReadAndCheckSignature()
static const char * SIGNATURE
std::vector< FlexBody * > m_items_to_save
std::vector< FlexBody * > & GetList()
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
FlexMeshWheel * CreateFlexMeshWheel(unsigned int wheel_index, int axis_node_1_index, int axis_node_2_index, int nstart, int nrays, float rim_radius, bool rim_reverse, std::string const &rim_mesh_name, std::string const &rim_mesh_rg, std::string const &tire_material_name, std::string const &tire_material_rg)
bool m_is_flexbody_cache_loaded
void SaveFlexbodiesToCache()
FlexBodyFileIO m_flexbody_cache
FlexBody * CreateFlexBody(FlexbodyID_t flexbody_id, const NodeNum_t ref_node, const NodeNum_t x_node, const NodeNum_t y_node, Ogre::Vector3 offset, Ogre::Vector3 rotation, std::vector< unsigned int > &node_indices, std::vector< ForvertTempData > &forvert_data, const std::string &mesh_name, const std::string &resource_group_name)
unsigned int m_flexbody_cache_next_index
void CheckAndLoadFlexbodyCache()
ActorSpawner * m_rig_spawner
bool m_is_flexbody_cache_enabled
Consists of static mesh, representing the rim, and dynamic mesh, representing the tire.
int FlexbodyID_t
Index to GfxActor::m_flexbodies, use RoR::FLEXBODYID_INVALID as empty value.
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
Ogre::Vector3 * src_normals
FlexBodyRecordHeader header
Locator_t * locators
1 loc per vertex
unsigned int file_format_version
unsigned int num_flexbodies
static const BitMask_t HAS_TEXTURE_BLEND
Ogre::Vector3 center_offset
static const BitMask_t HAS_TEXTURE
static const BitMask_t IS_FAULTY
static const BitMask_t USES_SHARED_VERTEX_DATA