diff --git a/source/gameengine/Converter/BL_BlenderConverter.cpp b/source/gameengine/Converter/BL_BlenderConverter.cpp index 714d30b7513c..8da1d0efb41a 100644 --- a/source/gameengine/Converter/BL_BlenderConverter.cpp +++ b/source/gameengine/Converter/BL_BlenderConverter.cpp @@ -36,7 +36,7 @@ #include "KX_Scene.h" #include "KX_GameObject.h" #include "KX_WorldInfo.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_BucketManager.h" #include "KX_PhysicsEngineEnums.h" #include "KX_KetsjiEngine.h" @@ -118,7 +118,7 @@ void BL_BlenderConverter::SceneSlot::Merge(const BL_BlenderSceneConverter& conve for (KX_BlenderMaterial *mat : converter.m_materials) { m_materials.emplace_back(mat); } - for (RAS_MeshObject *meshobj : converter.m_meshobjects) { + for (RAS_Mesh *meshobj : converter.m_meshobjects) { m_meshobjects.emplace_back(meshobj); } for (BL_ConvertObjectInfo *info : converter.m_objectInfos) { @@ -474,7 +474,7 @@ KX_LibLoadStatus *BL_BlenderConverter::LinkBlendFile(BlendHandle *blendlib, cons if (options & LIB_LOAD_VERBOSE) { CM_Debug("mesh name: " << mesh->name + 2); } - RAS_MeshObject *meshobj = BL_ConvertMesh((Mesh *)mesh, nullptr, scene_merge, sceneConverter); + RAS_Mesh *meshobj = BL_ConvertMesh((Mesh *)mesh, nullptr, scene_merge, sceneConverter); scene_merge->GetLogicManager()->RegisterMeshName(meshobj->GetName(), meshobj); } @@ -608,7 +608,7 @@ bool BL_BlenderConverter::FreeBlendFile(Main *maggie) // in case the mesh might be refered to later std::map &mapStringToMeshes = scene->GetLogicManager()->GetMeshMap(); for (std::map::iterator it = mapStringToMeshes.begin(), end = mapStringToMeshes.end(); it != end;) { - RAS_MeshObject *meshobj = (RAS_MeshObject *)it->second; + RAS_Mesh *meshobj = (RAS_Mesh *)it->second; if (meshobj && IS_TAGGED(meshobj->GetMesh())) { it = mapStringToMeshes.erase(it); } @@ -655,7 +655,7 @@ bool BL_BlenderConverter::FreeBlendFile(Main *maggie) gameobj->RemoveTaggedActions(); // free the mesh, we could be referecing a linked one! - for (RAS_MeshObject *meshobj : gameobj->GetMeshList()) { + for (RAS_Mesh *meshobj : gameobj->GetMeshList()) { if (IS_TAGGED(meshobj->GetMesh())) { gameobj->RemoveMeshes(); /* XXX - slack, should only remove meshes that are library items but mostly objects only have 1 mesh */ break; @@ -690,8 +690,8 @@ bool BL_BlenderConverter::FreeBlendFile(Main *maggie) KX_Scene *scene = sit->first; SceneSlot& sceneSlot = sit->second; - for (UniquePtrList::iterator it = sceneSlot.m_meshobjects.begin(); it != sceneSlot.m_meshobjects.end(); ) { - RAS_MeshObject *mesh = (*it).get(); + for (UniquePtrList::iterator it = sceneSlot.m_meshobjects.begin(); it != sceneSlot.m_meshobjects.end(); ) { + RAS_Mesh *mesh = (*it).get(); if (IS_TAGGED(mesh->GetMesh())) { it = sceneSlot.m_meshobjects.erase(it); } @@ -758,7 +758,7 @@ void BL_BlenderConverter::MergeScene(KX_Scene *to, KX_Scene *from) /** This function merges a mesh from the current scene into another main * it does not convert */ -RAS_MeshObject *BL_BlenderConverter::ConvertMeshSpecial(KX_Scene *kx_scene, Main *maggie, const std::string& name) +RAS_Mesh *BL_BlenderConverter::ConvertMeshSpecial(KX_Scene *kx_scene, Main *maggie, const std::string& name) { // Find a mesh in the current main */ ID *me = static_cast(BLI_findstring(&m_maggie->mesh, name.c_str(), offsetof(ID, name) + 2)); @@ -832,7 +832,7 @@ RAS_MeshObject *BL_BlenderConverter::ConvertMeshSpecial(KX_Scene *kx_scene, Main BL_BlenderSceneConverter sceneConverter(kx_scene); - RAS_MeshObject *meshobj = BL_ConvertMesh((Mesh *)me, nullptr, kx_scene, sceneConverter); + RAS_Mesh *meshobj = BL_ConvertMesh((Mesh *)me, nullptr, kx_scene, sceneConverter); kx_scene->GetLogicManager()->RegisterMeshName(meshobj->GetName(), meshobj); // Finalize material and mesh conversion. diff --git a/source/gameengine/Converter/BL_BlenderConverter.h b/source/gameengine/Converter/BL_BlenderConverter.h index 4396239d0bb6..500811fcae27 100644 --- a/source/gameengine/Converter/BL_BlenderConverter.h +++ b/source/gameengine/Converter/BL_BlenderConverter.h @@ -37,7 +37,7 @@ #ifdef _MSC_VER // MSVC doesn't support incomplete type in std::unique_ptr. # include "KX_BlenderMaterial.h" -# include "RAS_MeshObject.h" +# include "RAS_Mesh.h" # include "BL_ConvertObjectInfo.h" # include "BL_BlenderScalarInterpolator.h" #endif @@ -53,7 +53,7 @@ class KX_BlenderMaterial; class BL_InterpolatorList; class SCA_IActuator; class SCA_IController; -class RAS_MeshObject; +class RAS_Mesh; struct Main; struct BlendHandle; struct Mesh; @@ -74,7 +74,7 @@ class BL_BlenderConverter { public: UniquePtrList m_materials; - UniquePtrList m_meshobjects; + UniquePtrList m_meshobjects; UniquePtrList m_interpolators; UniquePtrList m_objectInfos; @@ -148,7 +148,7 @@ class BL_BlenderConverter bool FreeBlendFile(Main *maggie); bool FreeBlendFile(const std::string& path); - RAS_MeshObject *ConvertMeshSpecial(KX_Scene *kx_scene, Main *maggie, const std::string& name); + RAS_Mesh *ConvertMeshSpecial(KX_Scene *kx_scene, Main *maggie, const std::string& name); void MergeScene(KX_Scene *to, KX_Scene *from); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index b5d14e60d3dc..6a391b584862 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -61,7 +61,7 @@ # include "CcdGraphicController.h" #endif -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_Rasterizer.h" #include "RAS_ILightObject.h" @@ -343,13 +343,13 @@ SCA_IInputDevice::SCA_EnumInputs BL_ConvertKeyCode(int key_code) return gReverseKeyTranslateTable[key_code]; } -static void BL_GetUvRgba(const RAS_MeshObject::LayersInfo& layersInfo, std::vector& uvLayers, +static void BL_GetUvRgba(const RAS_Mesh::LayersInfo& layersInfo, std::vector& uvLayers, std::vector& colorLayers, unsigned int loop, float uvs[RAS_Texture::MaxUnits][2], unsigned int rgba[RAS_Vertex::MAX_UNIT]) { // No need to initialize layers to zero as all the converted layer are all the layers needed. - for (const RAS_MeshObject::Layer& layer : layersInfo.colorLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.colorLayers) { const unsigned short index = layer.index; const MLoopCol& col = colorLayers[index][loop]; @@ -364,7 +364,7 @@ static void BL_GetUvRgba(const RAS_MeshObject::LayersInfo& layersInfo, std::vect rgba[index] = con.val; } - for (const RAS_MeshObject::Layer& layer : layersInfo.uvLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.uvLayers) { const unsigned short index = layer.index; const MLoopUV& uv = uvLayers[index][loop]; copy_v2_v2(uvs[index], uv.uv); @@ -408,9 +408,9 @@ static RAS_MaterialBucket *BL_ConvertMaterial(Material *ma, int lightlayer, KX_S } /* blenderobj can be nullptr, make sure its checked for */ -RAS_MeshObject *BL_ConvertMesh(Mesh *me, Object *blenderobj, KX_Scene *scene, BL_BlenderSceneConverter& converter) +RAS_Mesh *BL_ConvertMesh(Mesh *me, Object *blenderobj, KX_Scene *scene, BL_BlenderSceneConverter& converter) { - RAS_MeshObject *meshobj; + RAS_Mesh *meshobj; const int lightlayer = blenderobj ? blenderobj->lay : (1 << 20) - 1; // all layers if no object. // Without checking names, we get some reuse we don't want that can cause @@ -433,7 +433,7 @@ RAS_MeshObject *BL_ConvertMesh(Mesh *me, Object *blenderobj, KX_Scene *scene, BL const unsigned short uvCount = CustomData_number_of_layers(&dm->loopData, CD_MLOOPUV); const unsigned short colorCount = CustomData_number_of_layers(&dm->loopData, CD_MLOOPCOL); - RAS_MeshObject::LayersInfo layersInfo; + RAS_Mesh::LayersInfo layersInfo; layersInfo.activeUv = (activeUv == -1) ? 0 : activeUv; layersInfo.activeColor = (activeColor == -1) ? 0 : activeColor; @@ -453,7 +453,7 @@ RAS_MeshObject *BL_ConvertMesh(Mesh *me, Object *blenderobj, KX_Scene *scene, BL vertformat.uvSize = max_ii(1, uvCount); vertformat.colorSize = max_ii(1, colorCount); - meshobj = new RAS_MeshObject(me, layersInfo); + meshobj = new RAS_Mesh(me, layersInfo); const unsigned short totmat = max_ii(me->totcol, 1); std::vector mats(totmat); @@ -489,7 +489,7 @@ RAS_MeshObject *BL_ConvertMesh(Mesh *me, Object *blenderobj, KX_Scene *scene, BL } void BL_ConvertDerivedMeshToArray(DerivedMesh *dm, Mesh *me, const std::vector& mats, - const RAS_MeshObject::LayersInfo& layersInfo) + const RAS_Mesh::LayersInfo& layersInfo) { const MVert *mverts = dm->getVertArray(dm); const int totverts = dm->getNumVerts(dm); @@ -517,11 +517,11 @@ void BL_ConvertDerivedMeshToArray(DerivedMesh *dm, Mesh *me, const std::vector colorLayers(layersInfo.uvLayers.size()); - for (const RAS_MeshObject::Layer& layer : layersInfo.uvLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.uvLayers) { const unsigned short index = layer.index; uvLayers[index] = (MLoopUV *)CustomData_get_layer_n(&dm->loopData, CD_MLOOPUV, index); } - for (const RAS_MeshObject::Layer& layer : layersInfo.colorLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.colorLayers) { const unsigned short index = layer.index; colorLayers[index] = (MLoopCol *)CustomData_get_layer_n(&dm->loopData, CD_MLOOPCOL, index); } @@ -640,7 +640,7 @@ static void BL_CreateGraphicObjectNew(KX_GameObject *gameobj, KX_Scene *kxscene, } } -static void BL_CreatePhysicsObjectNew(KX_GameObject *gameobj, Object *blenderobject, RAS_MeshObject *meshobj, +static void BL_CreatePhysicsObjectNew(KX_GameObject *gameobj, Object *blenderobject, RAS_Mesh *meshobj, KX_Scene *kxscene, int activeLayerBitInfo, BL_BlenderSceneConverter& converter, bool processCompoundChildren) { @@ -864,7 +864,7 @@ static KX_GameObject *BL_GameObjectFromBlenderObject(Object *ob, KX_Scene *kxsce case OB_MESH: { Mesh *mesh = static_cast(ob->data); - RAS_MeshObject *meshobj = BL_ConvertMesh(mesh, ob, kxscene, converter); + RAS_Mesh *meshobj = BL_ConvertMesh(mesh, ob, kxscene, converter); // needed for python scripting kxscene->GetLogicManager()->RegisterMeshName(meshobj->GetName(), meshobj); @@ -1144,7 +1144,7 @@ static void bl_ConvertBlenderObject_Single(BL_BlenderSceneConverter& converter, // Needed for group duplication. logicmgr->RegisterGameObj(blenderobject, gameobj); - for (RAS_MeshObject *meshobj : gameobj->GetMeshList()) { + for (RAS_Mesh *meshobj : gameobj->GetMeshList()) { logicmgr->RegisterGameMeshName(meshobj->GetName(), blenderobject); } @@ -1538,8 +1538,8 @@ void BL_ConvertBlenderObjects(struct Main *maggie, for (KX_GameObject *gameobj : sumolist) { Object *blenderobject = gameobj->GetBlenderObject(); - const std::vector& meshes = gameobj->GetMeshList(); - RAS_MeshObject *meshobj = (meshes.empty()) ? nullptr : meshes.front(); + const std::vector& meshes = gameobj->GetMeshList(); + RAS_Mesh *meshobj = (meshes.empty()) ? nullptr : meshes.front(); int layerMask = (groupobj.find(blenderobject) == groupobj.end()) ? activeLayerBitInfo : 0; BL_CreatePhysicsObjectNew(gameobj, blenderobject, meshobj, kxscene, layerMask, converter, processCompoundChildren); @@ -1548,7 +1548,7 @@ void BL_ConvertBlenderObjects(struct Main *maggie, // Look at every material texture and ask to create realtime cube map. for (KX_GameObject *gameobj : sumolist) { - for (RAS_MeshObject *mesh : gameobj->GetMeshList()) { + for (RAS_Mesh *mesh : gameobj->GetMeshList()) { for (RAS_MeshMaterial *meshmat : mesh->GetMeshMaterialList()) { RAS_IPolyMaterial *polymat = meshmat->GetBucket()->GetPolyMaterial(); @@ -1584,7 +1584,7 @@ void BL_ConvertBlenderObjects(struct Main *maggie, Mesh *predifinedBoundMesh = blenderobject->gamePredefinedBound; if (predifinedBoundMesh) { - RAS_MeshObject *meshobj = converter.FindGameMesh(predifinedBoundMesh); + RAS_Mesh *meshobj = converter.FindGameMesh(predifinedBoundMesh); // In case of mesh taken in a other scene. if (!meshobj) { continue; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.h b/source/gameengine/Converter/BL_BlenderDataConversion.h index e842afab095a..984bd0642ba1 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.h +++ b/source/gameengine/Converter/BL_BlenderDataConversion.h @@ -32,7 +32,7 @@ #ifndef __BL_BLENDERDATACONVERSION_H__ #define __BL_BLENDERDATACONVERSION_H__ -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "KX_PhysicsEngineEnums.h" #include "SCA_IInputDevice.h" @@ -55,9 +55,9 @@ struct BL_MeshMaterial { bool wire; }; -RAS_MeshObject *BL_ConvertMesh(Mesh *mesh, Object *lightobj, KX_Scene *scene, BL_BlenderSceneConverter& converter); +RAS_Mesh *BL_ConvertMesh(Mesh *mesh, Object *lightobj, KX_Scene *scene, BL_BlenderSceneConverter& converter); void BL_ConvertDerivedMeshToArray(DerivedMesh *dm, Mesh *me, const std::vector& mats, - const RAS_MeshObject::LayersInfo& layersInfo); + const RAS_Mesh::LayersInfo& layersInfo); void BL_ConvertBlenderObjects(Main *maggie, KX_Scene *kxscene, KX_KetsjiEngine *ketsjiEngine, e_PhysicsEngine physics_engine, RAS_Rasterizer *rendertools, RAS_ICanvas *canvas, BL_BlenderSceneConverter& sceneconverter, diff --git a/source/gameengine/Converter/BL_BlenderSceneConverter.cpp b/source/gameengine/Converter/BL_BlenderSceneConverter.cpp index fbdd2ac870ec..cdf7711ee557 100644 --- a/source/gameengine/Converter/BL_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/BL_BlenderSceneConverter.cpp @@ -83,7 +83,7 @@ KX_GameObject *BL_BlenderSceneConverter::FindGameObject(Object *for_blenderobjec return m_map_blender_to_gameobject[for_blenderobject]; } -void BL_BlenderSceneConverter::RegisterGameMesh(RAS_MeshObject *gamemesh, Mesh *for_blendermesh) +void BL_BlenderSceneConverter::RegisterGameMesh(RAS_Mesh *gamemesh, Mesh *for_blendermesh) { if (for_blendermesh) { // dynamically loaded meshes we don't want to keep lookups for m_map_mesh_to_gamemesh[for_blendermesh] = gamemesh; @@ -91,7 +91,7 @@ void BL_BlenderSceneConverter::RegisterGameMesh(RAS_MeshObject *gamemesh, Mesh * m_meshobjects.push_back(gamemesh); } -RAS_MeshObject *BL_BlenderSceneConverter::FindGameMesh(Mesh *for_blendermesh) +RAS_Mesh *BL_BlenderSceneConverter::FindGameMesh(Mesh *for_blendermesh) { return m_map_mesh_to_gamemesh[for_blendermesh]; } diff --git a/source/gameengine/Converter/BL_BlenderSceneConverter.h b/source/gameengine/Converter/BL_BlenderSceneConverter.h index 8d3c1b96d6ae..43b092aba9c5 100644 --- a/source/gameengine/Converter/BL_BlenderSceneConverter.h +++ b/source/gameengine/Converter/BL_BlenderSceneConverter.h @@ -39,7 +39,7 @@ class SCA_IActuator; class SCA_IController; -class RAS_MeshObject; +class RAS_Mesh; class KX_BlenderMaterial; class BL_BlenderConverter; class BL_ConvertObjectInfo; @@ -63,12 +63,12 @@ class BL_BlenderSceneConverter KX_Scene *m_scene; std::vector m_materials; - std::vector m_meshobjects; + std::vector m_meshobjects; std::vector m_objectInfos; std::map m_blenderToObjectInfos; std::map m_map_blender_to_gameobject; - std::map m_map_mesh_to_gamemesh; + std::map m_map_mesh_to_gamemesh; std::map m_map_mesh_to_polyaterial; std::map m_map_blender_to_gameactuator; std::map m_map_blender_to_gamecontroller; @@ -88,8 +88,8 @@ class BL_BlenderSceneConverter void UnregisterGameObject(KX_GameObject *gameobject); KX_GameObject *FindGameObject(Object *for_blenderobject); - void RegisterGameMesh(RAS_MeshObject *gamemesh, Mesh *for_blendermesh); - RAS_MeshObject *FindGameMesh(Mesh *for_blendermesh); + void RegisterGameMesh(RAS_Mesh *gamemesh, Mesh *for_blendermesh); + RAS_Mesh *FindGameMesh(Mesh *for_blendermesh); void RegisterMaterial(KX_BlenderMaterial *blmat, Material *mat); KX_BlenderMaterial *FindMaterial(Material *mat); diff --git a/source/gameengine/Converter/BL_ConvertActuators.cpp b/source/gameengine/Converter/BL_ConvertActuators.cpp index 6fc6f020e92b..6e02c88fe62c 100644 --- a/source/gameengine/Converter/BL_ConvertActuators.cpp +++ b/source/gameengine/Converter/BL_ConvertActuators.cpp @@ -461,7 +461,7 @@ void BL_ConvertActuators(const char* maggiename, break; case ACT_EDOB_REPLACE_MESH: { - RAS_MeshObject *tmpmesh = converter.FindGameMesh(editobact->me); + RAS_Mesh *tmpmesh = converter.FindGameMesh(editobact->me); if (!tmpmesh) { CM_Warning("object \"" << objectname << "\" from ReplaceMesh actuator \"" << uniquename diff --git a/source/gameengine/Converter/BL_ConvertSensors.cpp b/source/gameengine/Converter/BL_ConvertSensors.cpp index 5468584e8c12..836746f67369 100644 --- a/source/gameengine/Converter/BL_ConvertSensors.cpp +++ b/source/gameengine/Converter/BL_ConvertSensors.cpp @@ -55,7 +55,7 @@ #include "RAS_IPolygonMaterial.h" // Sensors #include "KX_GameObject.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "SCA_KeyboardSensor.h" #include "SCA_MouseSensor.h" #include "SCA_AlwaysSensor.h" diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index 4ec21f727852..cbae1442c655 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -37,7 +37,7 @@ #include "KX_SoftBodyDeformer.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "CM_Message.h" @@ -135,7 +135,7 @@ void BL_DeformableGameObject::LoadDeformer() return; } - RAS_MeshObject *meshobj = m_meshes.front(); + RAS_Mesh *meshobj = m_meshes.front(); Mesh *mesh = meshobj->GetMesh(); if (!mesh) { diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 338be03346bc..053a5d00c1ac 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -41,7 +41,7 @@ #include "BL_DeformableGameObject.h" #include "BL_MeshDeformer.h" #include "RAS_BoundingBoxManager.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -71,7 +71,7 @@ void BL_MeshDeformer::Apply(RAS_IDisplayArray *UNUSED(array)) } } -BL_MeshDeformer::BL_MeshDeformer(BL_DeformableGameObject *gameobj, Object *obj, RAS_MeshObject *meshobj) +BL_MeshDeformer::BL_MeshDeformer(BL_DeformableGameObject *gameobj, Object *obj, RAS_Mesh *meshobj) :RAS_Deformer(meshobj), m_bmesh((Mesh *)(obj->data)), m_objMesh(obj), diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index abcad65652da..efcfd04b413c 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -44,7 +44,7 @@ struct Object; struct Mesh; class BL_DeformableGameObject; -class RAS_MeshObject; +class RAS_Mesh; class RAS_IPolyMaterial; class BL_MeshDeformer : public RAS_Deformer @@ -54,7 +54,7 @@ class BL_MeshDeformer : public RAS_Deformer void RecalcNormals(); virtual void Relink(std::map& map); - BL_MeshDeformer(BL_DeformableGameObject *gameobj, Object *obj, RAS_MeshObject *meshobj); + BL_MeshDeformer(BL_DeformableGameObject *gameobj, Object *obj, RAS_Mesh *meshobj); virtual ~BL_MeshDeformer(); virtual void Apply(RAS_IDisplayArray *array); virtual bool Update() diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index b3f330264163..8bc2768b62db 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -39,7 +39,7 @@ #include #include "RAS_IPolygonMaterial.h" #include "RAS_MaterialBucket.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_BoundingBox.h" diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index 3ac30329ada4..ac894c9b1cb7 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -40,7 +40,7 @@ #include "BL_DeformableGameObject.h" #include -class RAS_MeshObject; +class RAS_Mesh; struct DerivedMesh; struct Object; @@ -54,7 +54,7 @@ class BL_ModifierDeformer : public BL_ShapeDeformer Scene *scene, Object *bmeshobj_old, Object *bmeshobj_new, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, BL_ArmatureObject *arma) :BL_ShapeDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, arma), m_lastModifierUpdate(-1), diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index c65b16a3543f..9fdadd1dcd54 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -37,7 +37,7 @@ #include "BL_ShapeDeformer.h" #include #include "RAS_IPolygonMaterial.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "DNA_anim_types.h" #include "DNA_armature_types.h" @@ -65,7 +65,7 @@ extern "C" { BL_ShapeDeformer::BL_ShapeDeformer(BL_DeformableGameObject *gameobj, Object *bmeshobj_old, Object *bmeshobj_new, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, BL_ArmatureObject *arma) :BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, arma), m_useShapeDrivers(false), diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 98f933a784ed..5f8a8574a835 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -42,7 +42,7 @@ struct Object; struct Key; -class RAS_MeshObject; +class RAS_Mesh; class BL_ShapeDeformer : public BL_SkinDeformer { @@ -50,7 +50,7 @@ class BL_ShapeDeformer : public BL_SkinDeformer BL_ShapeDeformer(BL_DeformableGameObject *gameobj, Object *bmeshobj_old, Object *bmeshobj_new, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, BL_ArmatureObject *arma); virtual RAS_Deformer *GetReplica(); diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 46a0c533c647..0839333027eb 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -41,7 +41,7 @@ #include #include "RAS_IPolygonMaterial.h" #include "RAS_DisplayArray.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_BoundingBox.h" @@ -84,7 +84,7 @@ BL_SkinDeformer::BL_SkinDeformer( BL_DeformableGameObject *gameobj, Object *bmeshobj_old, // Blender object that owns the new mesh Object *bmeshobj_new, // Blender object that owns the original mesh - RAS_MeshObject *mesh, + RAS_Mesh *mesh, BL_ArmatureObject *arma) :BL_MeshDeformer(gameobj, bmeshobj_old, mesh), m_armobj(arma), diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 50c4f6dd1208..6dc671e2c8c8 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -48,7 +48,7 @@ struct Object; struct bPoseChannel; -class RAS_MeshObject; +class RAS_Mesh; class RAS_IPolyMaterial; class BL_SkinDeformer : public BL_MeshDeformer @@ -59,7 +59,7 @@ class BL_SkinDeformer : public BL_MeshDeformer BL_SkinDeformer(BL_DeformableGameObject *gameobj, Object *bmeshobj_old, Object *bmeshobj_new, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, BL_ArmatureObject *arma); virtual RAS_Deformer *GetReplica(); diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index bec2fd78b026..bbce6048b33e 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -34,7 +34,7 @@ #include "KX_GameObject.h" #include "KX_Globals.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MaterialBucket.h" #include "SG_Controller.h" @@ -186,7 +186,7 @@ bool BL_Action::Play(const std::string& name, } // Now try materials - for (RAS_MeshObject *mesh : m_obj->GetMeshList()) { + for (RAS_Mesh *mesh : m_obj->GetMeshList()) { for (RAS_MeshMaterial *meshmat : mesh->GetMeshMaterialList()) { RAS_IPolyMaterial *polymat = meshmat->GetBucket()->GetPolyMaterial(); diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 76758b7f5ab8..a4884d9c260d 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -32,7 +32,7 @@ #include "BL_BlenderShader.h" #include "RAS_BucketManager.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_Rasterizer.h" #include "RAS_IPolygonMaterial.h" @@ -57,7 +57,7 @@ BL_BlenderShader::~BL_BlenderShader() { } -const RAS_AttributeArray::AttribList BL_BlenderShader::GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const +const RAS_AttributeArray::AttribList BL_BlenderShader::GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const { RAS_AttributeArray::AttribList attribs; GPUVertexAttribs gpuAttribs; @@ -81,7 +81,7 @@ const RAS_AttributeArray::AttribList BL_BlenderShader::GetAttribs(const RAS_Mesh } if (type == CD_MTFACE) { - for (const RAS_MeshObject::Layer& layer : layersInfo.uvLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.uvLayers) { if (layer.name == attribname) { attribs.push_back({glindex, RAS_AttributeArray::RAS_ATTRIB_UV, false, layer.index}); break; @@ -89,7 +89,7 @@ const RAS_AttributeArray::AttribList BL_BlenderShader::GetAttribs(const RAS_Mesh } } else { - for (const RAS_MeshObject::Layer& layer : layersInfo.colorLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.colorLayers) { if (layer.name == attribname) { attribs.push_back({glindex, RAS_AttributeArray::RAS_ATTRIB_COLOR, false, layer.index}); break; diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 8f0b238acb8f..7a8162ec9705 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -33,7 +33,7 @@ #define __BL_BLENDERSHADER_H__ #include "RAS_AttributeArray.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_Texture.h" // for MaxUnits #include "CM_Update.h" @@ -74,7 +74,7 @@ class BL_BlenderShader * \param layers The list of the mesh layers used to link with uv and color material attributes. * \return The map of attributes layers. */ - const RAS_AttributeArray::AttribList GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const; + const RAS_AttributeArray::AttribList GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const; void Update(RAS_MeshSlot *ms, RAS_Rasterizer *rasty); diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 748689ce16bd..8cf65bf35bf1 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -102,7 +102,7 @@ void BL_Shader::SetCallbacks(BL_Shader::CallbacksType type, PyObject *callbacks) #endif // WITH_PYTHON -RAS_AttributeArray::AttribList BL_Shader::GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo, +RAS_AttributeArray::AttribList BL_Shader::GetAttribs(const RAS_Mesh::LayersInfo& layersInfo, RAS_Texture *const textures[RAS_Texture::MaxUnits]) const { RAS_AttributeArray::AttribList attribs; @@ -128,7 +128,7 @@ RAS_AttributeArray::AttribList BL_Shader::GetAttribs(const RAS_MeshObject::Layer } // Search for the UV layer index used by the texture. - for (const RAS_MeshObject::Layer& layer : layersInfo.uvLayers) { + for (const RAS_Mesh::Layer& layer : layersInfo.uvLayers) { if (layer.name == mtex->uvname) { attribs.push_back({i, RAS_AttributeArray::RAS_ATTRIB_UV, true, layer.index}); break; diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 7c9afa0d629b..fd94abaf72e8 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -9,7 +9,7 @@ #include "RAS_Shader.h" #include "RAS_Texture.h" // For RAS_Texture::MaxUnits. #include "RAS_AttributeArray.h" // For RAS_AttributeArray::AttribList. -#include "RAS_MeshObject.h" // For RAS_MeshObject::LayersInfo. +#include "RAS_Mesh.h" // For RAS_Mesh::LayersInfo. #include "EXP_Value.h" @@ -55,7 +55,7 @@ class BL_Shader : public EXP_Value, public virtual RAS_Shader void SetCallbacks(CallbacksType type, PyObject *callbacks); #endif // WITH_PYTHON - RAS_AttributeArray::AttribList GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo, + RAS_AttributeArray::AttribList GetAttribs(const RAS_Mesh::LayersInfo& layersInfo, RAS_Texture *const textures[RAS_Texture::MaxUnits]) const; void BindProg(); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 89b163577f73..a0165c3f6b4b 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -406,7 +406,7 @@ void KX_BlenderMaterial::UpdateIPO( m_material->spectra = (float)specalpha; } -const RAS_AttributeArray::AttribList KX_BlenderMaterial::GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const +const RAS_AttributeArray::AttribList KX_BlenderMaterial::GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const { if (m_shader && m_shader->Ok()) { return m_shader->GetAttribs(layersInfo, m_textures); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 89e4757d1415..2836e4dbf2fe 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -61,7 +61,7 @@ class KX_BlenderMaterial : public EXP_Value, public RAS_IPolyMaterial virtual void UpdateIPO(const mt::vec4 &rgba, const mt::vec3 &specrgb, float hard, float spec, float ref, float emit, float ambient, float alpha, float specalpha); - virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const; + virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const; // Stuff for cvalue related things. virtual std::string GetName(); diff --git a/source/gameengine/Ketsji/KX_CollisionSensor.cpp b/source/gameengine/Ketsji/KX_CollisionSensor.cpp index 5b4eeb31bd65..413cf504640c 100644 --- a/source/gameengine/Ketsji/KX_CollisionSensor.cpp +++ b/source/gameengine/Ketsji/KX_CollisionSensor.cpp @@ -41,7 +41,7 @@ #include "PHY_IPhysicsController.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include #include "BLI_utildefines.h" @@ -211,7 +211,7 @@ bool KX_CollisionSensor::BroadPhaseSensorFilterCollision(PHY_IPhysicsController bool found = m_touchedpropname.empty(); if (!found) { if (m_bFindMaterial) { - for (RAS_MeshObject *meshObj : otherobj->GetMeshList()) { + for (RAS_Mesh *meshObj : otherobj->GetMeshList()) { found = (meshObj->FindMaterialName(m_touchedpropname) != nullptr); if (found) { break; @@ -248,7 +248,7 @@ bool KX_CollisionSensor::NewHandleCollision(PHY_IPhysicsController *ctrl1, PHY_I bool hitMaterial = false; if (!found) { if (m_bFindMaterial) { - for (RAS_MeshObject *meshObj : gameobj->GetMeshList()) { + for (RAS_Mesh *meshObj : gameobj->GetMeshList()) { found = (meshObj->FindMaterialName(m_touchedpropname) != nullptr); if (found) { hitMaterial = true; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index cc972396edea..830d8654123d 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -39,7 +39,7 @@ #include "KX_GameObject.h" #include "KX_RayCast.h" #include "KX_Globals.h" // KX_GetActiveScene -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "CM_Message.h" @@ -129,7 +129,7 @@ bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo *client, KX_RayCast *resu else { if (m_option & KX_ACT_CONSTRAINT_MATERIAL) { - for (RAS_MeshObject *meshObj : m_hitObject->GetMeshList()) { + for (RAS_Mesh *meshObj : m_hitObject->GetMeshList()) { bFound = (meshObj->FindMaterialName(m_property) != nullptr); if (bFound) { break; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index fb825466bbf1..ea7a084bb954 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -41,7 +41,7 @@ #include "KX_Camera.h" // only for their ::Type #include "KX_LightObject.h" // only for their ::Type #include "KX_FontObject.h" // only for their ::Type -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_BoundingBoxManager.h" #include "KX_NavMeshObject.h" @@ -722,7 +722,7 @@ void KX_GameObject::UpdateBuckets() m_meshUser->ActivateMeshSlots(); } -void KX_GameObject::ReplaceMesh(RAS_MeshObject *mesh, bool use_gfx, bool use_phys) +void KX_GameObject::ReplaceMesh(RAS_Mesh *mesh, bool use_gfx, bool use_phys) { if (use_gfx && mesh) { RemoveMeshes(); @@ -755,7 +755,7 @@ void KX_GameObject::RemoveMeshes() m_meshes.clear(); } -const std::vector& KX_GameObject::GetMeshList() const +const std::vector& KX_GameObject::GetMeshList() const { return m_meshes; } @@ -777,7 +777,7 @@ void KX_GameObject::SetLodManager(KX_LodManager *lodManager) // Restore object original mesh. if (!lodManager && m_lodManager && m_lodManager->GetLevelCount() > 0) { - RAS_MeshObject *origmesh = m_lodManager->GetLevel(0).GetMesh(); + RAS_Mesh *origmesh = m_lodManager->GetLevel(0).GetMesh(); ReplaceMesh(origmesh, true, false); } @@ -806,7 +806,7 @@ void KX_GameObject::UpdateLod(KX_Scene *scene, const mt::vec3& cam_pos, float lo const float distance2 = (NodeGetWorldPosition() - cam_pos).LengthSquared() * (lodfactor * lodfactor); const KX_LodLevel& lodLevel = m_lodManager->GetLevel(scene, m_currentLodLevel, distance2); - RAS_MeshObject *mesh = lodLevel.GetMesh(); + RAS_Mesh *mesh = lodLevel.GetMesh(); if (mesh != m_meshes.front()) { ReplaceMesh(mesh, true, false); } @@ -2000,7 +2000,7 @@ PyObject *KX_GameObject::PyReplaceMesh(PyObject *args, PyObject *kwds) PyObject *value; int use_gfx= 1, use_phys= 0; - RAS_MeshObject *new_mesh; + RAS_Mesh *new_mesh; if (!EXP_ParseTupleArgsAndKeywords(args, kwds, "O|ii:replaceMesh", {"mesh", "useDisplayMesh", "usePhysicsMesh", 0}, &value, &use_gfx, &use_phys)) @@ -2025,7 +2025,7 @@ PyObject *KX_GameObject::PyEndObject() PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args, PyObject *kwds) { KX_GameObject *gameobj= nullptr; - RAS_MeshObject *mesh= nullptr; + RAS_Mesh *mesh= nullptr; SCA_LogicManager *logicmgr = GetScene()->GetLogicManager(); int dupli = 0; @@ -4094,7 +4094,7 @@ EXP_PYMETHODDEF_DOC(KX_GameObject, rayCast, { KX_MeshProxy *meshProxy = new KX_MeshProxy(callback.m_hitMesh); // if this field is set, then we can trust that m_hitPolygon is a valid polygon - const RAS_MeshObject::PolygonInfo polygon = callback.m_hitMesh->GetPolygon(callback.m_hitPolygon); + const RAS_Mesh::PolygonInfo polygon = callback.m_hitMesh->GetPolygon(callback.m_hitPolygon); KX_PolyProxy *polyproxy = new KX_PolyProxy(meshProxy, callback.m_hitMesh, polygon); PyTuple_SET_ITEM(returnValue, 3, polyproxy->NewProxy(true)); if (poly == 2) diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 7b1ecd1835e3..af6c20961931 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -56,7 +56,7 @@ struct KX_ClientObjectInfo; class KX_RayCast; class KX_LodManager; class KX_PythonComponent; -class RAS_MeshObject; +class RAS_Mesh; class RAS_MeshUser; class PHY_IGraphicController; class PHY_IPhysicsEnvironment; @@ -105,7 +105,7 @@ class KX_GameObject : public SCA_IObject, public mt::SimdClassAllocator KX_ClientObjectInfo* m_client_info; std::string m_name; int m_layer; - std::vector m_meshes; + std::vector m_meshes; KX_LodManager *m_lodManager; short m_currentLodLevel; RAS_MeshUser *m_meshUser; @@ -708,12 +708,12 @@ class KX_GameObject : public SCA_IObject, public mt::SimdClassAllocator */ void AddMesh( - RAS_MeshObject* mesh + RAS_Mesh* mesh ) { m_meshes.push_back(mesh); } - void ReplaceMesh(RAS_MeshObject *mesh, bool use_gfx, bool use_phys); + void ReplaceMesh(RAS_Mesh *mesh, bool use_gfx, bool use_phys); /** Set current lod manager, can be nullptr. * If nullptr the object's mesh backs to the mesh of the previous first lod level. @@ -732,7 +732,7 @@ class KX_GameObject : public SCA_IObject, public mt::SimdClassAllocator */ void UpdateActivity(float distance); - const std::vector& GetMeshList() const; + const std::vector& GetMeshList() const; /// Return the mesh user of this game object. RAS_MeshUser *GetMeshUser() const; diff --git a/source/gameengine/Ketsji/KX_LodLevel.cpp b/source/gameengine/Ketsji/KX_LodLevel.cpp index 7e10bed64caf..1d070ff3ae68 100644 --- a/source/gameengine/Ketsji/KX_LodLevel.cpp +++ b/source/gameengine/Ketsji/KX_LodLevel.cpp @@ -27,7 +27,7 @@ #include "KX_LodLevel.h" #include "KX_MeshProxy.h" -KX_LodLevel::KX_LodLevel(float distance, float hysteresis, unsigned short level, RAS_MeshObject *meshobj, unsigned short flag) +KX_LodLevel::KX_LodLevel(float distance, float hysteresis, unsigned short level, RAS_Mesh *meshobj, unsigned short flag) :m_distance(distance), m_hysteresis(hysteresis), m_level(level), @@ -65,7 +65,7 @@ unsigned short KX_LodLevel::GetFlag() const return m_flags; } -RAS_MeshObject *KX_LodLevel::GetMesh() const +RAS_Mesh *KX_LodLevel::GetMesh() const { return m_meshobj; } diff --git a/source/gameengine/Ketsji/KX_LodLevel.h b/source/gameengine/Ketsji/KX_LodLevel.h index 2fd48f2c6f45..42b7fe1262a1 100644 --- a/source/gameengine/Ketsji/KX_LodLevel.h +++ b/source/gameengine/Ketsji/KX_LodLevel.h @@ -28,7 +28,7 @@ #define __KX_LOD_LEVEL_H__ #include "EXP_Value.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" class KX_LodLevel : public EXP_Value { @@ -38,10 +38,10 @@ class KX_LodLevel : public EXP_Value float m_hysteresis; short m_level; unsigned short m_flags; - RAS_MeshObject *m_meshobj; + RAS_Mesh *m_meshobj; public: - KX_LodLevel(float distance, float hysteresis, unsigned short level, RAS_MeshObject *meshobj, unsigned short flag); + KX_LodLevel(float distance, float hysteresis, unsigned short level, RAS_Mesh *meshobj, unsigned short flag); virtual ~KX_LodLevel(); virtual std::string GetName(); @@ -50,7 +50,7 @@ class KX_LodLevel : public EXP_Value float GetHysteresis() const; unsigned short GetLevel() const; unsigned short GetFlag() const; - RAS_MeshObject *GetMesh() const; + RAS_Mesh *GetMesh() const; enum { /// Use custom hysteresis for this level. diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 44a3a20231c4..c01defcf92d7 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -36,7 +36,7 @@ #include "KX_Scene.h" #include "RAS_IPolygonMaterial.h" #include "RAS_DisplayArray.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_BucketManager.h" #include "SCA_LogicManager.h" @@ -95,7 +95,7 @@ PyAttributeDef KX_MeshProxy::Attributes[] = { EXP_PYATTRIBUTE_NULL //Sentinel }; -KX_MeshProxy::KX_MeshProxy(RAS_MeshObject *mesh) +KX_MeshProxy::KX_MeshProxy(RAS_Mesh *mesh) :EXP_Value(), m_meshobj(mesh) { @@ -188,7 +188,7 @@ PyObject *KX_MeshProxy::PyGetPolygon(PyObject *args, PyObject *kwds) return nullptr; } - const RAS_MeshObject::PolygonInfo polygon = m_meshobj->GetPolygon(polyindex); + const RAS_Mesh::PolygonInfo polygon = m_meshobj->GetPolygon(polyindex); KX_PolyProxy *polyProxy = new KX_PolyProxy(this, m_meshobj, polygon); return polyProxy->NewProxy(true); } @@ -400,8 +400,8 @@ static int kx_mesh_proxy_get_polygons_size_cb(void *self_v) static PyObject *kx_mesh_proxy_get_polygons_item_cb(void *self_v, int index) { KX_MeshProxy *self = static_cast(self_v); - RAS_MeshObject *mesh = self->GetMesh(); - const RAS_MeshObject::PolygonInfo polygon = mesh->GetPolygon(index); + RAS_Mesh *mesh = self->GetMesh(); + const RAS_Mesh::PolygonInfo polygon = mesh->GetPolygon(index); KX_PolyProxy *polyProxy = new KX_PolyProxy(self, mesh, polygon); return polyProxy->NewProxy(true); @@ -419,7 +419,7 @@ PyObject *KX_MeshProxy::pyattr_get_polygons(EXP_PyObjectPlus *self_v, const EXP_ } /* a close copy of ConvertPythonToGameObject but for meshes */ -bool ConvertPythonToMesh(SCA_LogicManager *logicmgr, PyObject *value, RAS_MeshObject **object, bool py_none_ok, const char *error_prefix) +bool ConvertPythonToMesh(SCA_LogicManager *logicmgr, PyObject *value, RAS_Mesh **object, bool py_none_ok, const char *error_prefix) { if (value == nullptr) { PyErr_Format(PyExc_TypeError, "%s, python pointer nullptr, should never happen", error_prefix); @@ -440,7 +440,7 @@ bool ConvertPythonToMesh(SCA_LogicManager *logicmgr, PyObject *value, RAS_MeshOb } if (PyUnicode_Check(value)) { - *object = (RAS_MeshObject*)logicmgr->GetMeshByName(std::string(_PyUnicode_AsString(value))); + *object = (RAS_Mesh*)logicmgr->GetMeshByName(std::string(_PyUnicode_AsString(value))); if (*object) { return true; diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index fcd970a93fce..c1f9a8f46366 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -36,23 +36,23 @@ #include "EXP_Value.h" -class RAS_MeshObject; +class RAS_Mesh; class SCA_LogicManager; // utility conversion function -bool ConvertPythonToMesh(SCA_LogicManager *logicmgr, PyObject *value, RAS_MeshObject **object, bool py_none_ok, const char *error_prefix); +bool ConvertPythonToMesh(SCA_LogicManager *logicmgr, PyObject *value, RAS_Mesh **object, bool py_none_ok, const char *error_prefix); class KX_MeshProxy : public EXP_Value { Py_Header - RAS_MeshObject *m_meshobj; + RAS_Mesh *m_meshobj; public: - KX_MeshProxy(RAS_MeshObject *mesh); + KX_MeshProxy(RAS_Mesh *mesh); virtual ~KX_MeshProxy(); - virtual RAS_MeshObject *GetMesh() + virtual RAS_Mesh *GetMesh() { return m_meshobj; } diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 34d7183f6f52..81999a911397 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -39,7 +39,7 @@ #include "RAS_FramingManager.h" #include "RAS_ICanvas.h" #include "RAS_Rasterizer.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "SCA_IScene.h" #include "KX_Scene.h" #include "KX_Camera.h" @@ -166,7 +166,7 @@ bool KX_MouseFocusSensor::RayHit(KX_ClientObjectInfo *client_info, KX_RayCast *r else { if (m_bFindMaterial) { - for (RAS_MeshObject *meshObj : hitKXObj->GetMeshList()) { + for (RAS_Mesh *meshObj : hitKXObj->GetMeshList()) { bFound = (meshObj->FindMaterialName(m_propertyname) != nullptr); if (bFound) { break; @@ -217,7 +217,7 @@ bool KX_MouseFocusSensor::NeedRayCast(KX_ClientObjectInfo *client, void *UNUSED( if (m_bFindMaterial) { bool found = false; - for (RAS_MeshObject *meshObj : hitKXObj->GetMeshList()) { + for (RAS_Mesh *meshObj : hitKXObj->GetMeshList()) { found = (meshObj->FindMaterialName(m_propertyname) != nullptr); if (found) { break; diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index 019a87249e0d..52723023d167 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -29,7 +29,7 @@ #include "BLI_math_vector.h" #include "KX_NavMeshObject.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_IDisplayArray.h" #include "RAS_Vertex.h" @@ -237,8 +237,8 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, MEM_freeN(verticesMap); } else { - //create from RAS_MeshObject (detailed mesh is fake) - RAS_MeshObject *meshobj = m_meshes.front(); + //create from RAS_Mesh (detailed mesh is fake) + RAS_Mesh *meshobj = m_meshes.front(); vertsPerPoly = 3; // Indices count. diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index f0dcb70d780f..c20319b7cf07 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -34,7 +34,7 @@ #include "KX_PolyProxy.h" #include "KX_MeshProxy.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MaterialBucket.h" #include "RAS_IDisplayArray.h" #include "KX_VertexProxy.h" @@ -93,7 +93,7 @@ PyAttributeDef KX_PolyProxy::Attributes[] = { EXP_PYATTRIBUTE_NULL //Sentinel }; -KX_PolyProxy::KX_PolyProxy(KX_MeshProxy *meshProxy, RAS_MeshObject *mesh, const RAS_MeshObject::PolygonInfo& polygon) +KX_PolyProxy::KX_PolyProxy(KX_MeshProxy *meshProxy, RAS_Mesh *mesh, const RAS_Mesh::PolygonInfo& polygon) :m_meshProxy(meshProxy), m_polygon(polygon), m_mesh(mesh) @@ -113,7 +113,7 @@ std::string KX_PolyProxy::GetName() return "polygone"; } -const RAS_MeshObject::PolygonInfo& KX_PolyProxy::GetPolygon() const +const RAS_Mesh::PolygonInfo& KX_PolyProxy::GetPolygon() const { return m_polygon; } @@ -190,7 +190,7 @@ static int kx_poly_proxy_get_vertices_size_cb(void *self_v) static PyObject *kx_poly_proxy_get_vertices_item_cb(void *self_v, int index) { KX_PolyProxy *self = static_cast(self_v); - const RAS_MeshObject::PolygonInfo& polygon = self->GetPolygon(); + const RAS_Mesh::PolygonInfo& polygon = self->GetPolygon(); RAS_IDisplayArray *array = polygon.array; KX_VertexProxy *vert = new KX_VertexProxy(array, array->GetVertex(polygon.indices[index])); @@ -223,13 +223,13 @@ EXP_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getNumVertex, EXP_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isVisible, "isVisible() : returns whether the polygon is visible or not\n") { - return PyLong_FromLong(m_polygon.flags & RAS_MeshObject::PolygonInfo::VISIBLE); + return PyLong_FromLong(m_polygon.flags & RAS_Mesh::PolygonInfo::VISIBLE); } EXP_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, "isCollider() : returns whether the polygon is receives collision or not\n") { - return PyLong_FromLong(m_polygon.flags & RAS_MeshObject::PolygonInfo::COLLIDER); + return PyLong_FromLong(m_polygon.flags & RAS_Mesh::PolygonInfo::COLLIDER); } EXP_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 60c10a0c6de5..81dba05c2aa4 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -35,7 +35,7 @@ #ifdef WITH_PYTHON #include "EXP_Value.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" class KX_MeshProxy; @@ -44,17 +44,17 @@ class KX_PolyProxy : public EXP_Value Py_Header protected: KX_MeshProxy *m_meshProxy; - RAS_MeshObject::PolygonInfo m_polygon; - RAS_MeshObject *m_mesh; + RAS_Mesh::PolygonInfo m_polygon; + RAS_Mesh *m_mesh; public: - KX_PolyProxy(KX_MeshProxy *meshProxy, RAS_MeshObject *mesh, const RAS_MeshObject::PolygonInfo& polygon); + KX_PolyProxy(KX_MeshProxy *meshProxy, RAS_Mesh *mesh, const RAS_Mesh::PolygonInfo& polygon); virtual ~KX_PolyProxy(); // stuff for cvalue related things virtual std::string GetName(); - const RAS_MeshObject::PolygonInfo& GetPolygon() const; + const RAS_Mesh::PolygonInfo& GetPolygon() const; // stuff for python integration static PyObject *pyattr_get_material_name(EXP_PyObjectPlus *self_v, const EXP_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 61c64394f355..a6fad83f2fe8 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -716,7 +716,7 @@ static PyObject *gLibNew(PyObject *, PyObject *args) for (Py_ssize_t i= 0; i < PyList_GET_SIZE(names); i++) { name= _PyUnicode_AsString(PyList_GET_ITEM(names, i)); if (name) { - RAS_MeshObject *meshobj= converter->ConvertMeshSpecial(kx_scene, maggie, name); + RAS_Mesh *meshobj= converter->ConvertMeshSpecial(kx_scene, maggie, name); if (meshobj) { KX_MeshProxy* meshproxy = new KX_MeshProxy(meshobj); item= meshproxy->NewProxy(true); diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h index 9f9f98928e65..5aae4c14c492 100644 --- a/source/gameengine/Ketsji/KX_RayCast.h +++ b/source/gameengine/Ketsji/KX_RayCast.h @@ -38,7 +38,7 @@ #include "PHY_IPhysicsController.h" #include "mathfu.h" -class RAS_MeshObject; +class RAS_Mesh; struct KX_ClientObjectInfo; /** @@ -62,7 +62,7 @@ class KX_RayCast : public PHY_IRayCastFilterCallback bool m_hitFound; mt::vec3 m_hitPoint; mt::vec3 m_hitNormal; - RAS_MeshObject *m_hitMesh; + RAS_Mesh *m_hitMesh; int m_hitPolygon; int m_hitUVOK; // !=0 if UV coordinate in m_hitUV is valid mt::vec2 m_hitUV; diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 92cf1f0f9368..77a9af7a9a81 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -45,7 +45,7 @@ #include "PHY_IPhysicsEnvironment.h" #include "PHY_IPhysicsController.h" #include "DNA_sensor_types.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "CM_Message.h" @@ -121,7 +121,7 @@ bool KX_RaySensor::RayHit(KX_ClientObjectInfo *client, KX_RayCast *result, void else { if (m_bFindMaterial) { - for (RAS_MeshObject *meshObj : hitKXObj->GetMeshList()) { + for (RAS_Mesh *meshObj : hitKXObj->GetMeshList()) { bFound = (meshObj->FindMaterialName(m_propertyname) != nullptr); if (bFound) { hitMaterial = true; @@ -176,7 +176,7 @@ bool KX_RaySensor::NeedRayCast(KX_ClientObjectInfo *client, void *UNUSED(data)) { if (m_bFindMaterial) { bool found = false; - for (RAS_MeshObject *meshObj : hitKXObj->GetMeshList()) { + for (RAS_Mesh *meshObj : hitKXObj->GetMeshList()) { found = (meshObj->FindMaterialName(m_propertyname) != nullptr); if (found) { break; diff --git a/source/gameengine/Ketsji/KX_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_ReplaceMeshActuator.cpp index 30969d1f7e92..97b12b558986 100644 --- a/source/gameengine/Ketsji/KX_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_ReplaceMeshActuator.cpp @@ -97,7 +97,7 @@ PyObject *KX_ReplaceMeshActuator::pyattr_get_mesh(EXP_PyObjectPlus *self, const int KX_ReplaceMeshActuator::pyattr_set_mesh(EXP_PyObjectPlus *self, const struct EXP_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_ReplaceMeshActuator* actuator = static_cast(self); - RAS_MeshObject* new_mesh; + RAS_Mesh* new_mesh; if (!ConvertPythonToMesh(actuator->GetLogicManager(), value, &new_mesh, true, "actuator.mesh = value: KX_ReplaceMeshActuator")) return PY_SET_ATTR_FAIL; @@ -120,7 +120,7 @@ EXP_PYMETHODDEF_DOC(KX_ReplaceMeshActuator, instantReplaceMesh, /* ------------------------------------------------------------------------- */ KX_ReplaceMeshActuator::KX_ReplaceMeshActuator(KX_GameObject *gameobj, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, KX_Scene *scene, bool use_gfx, bool use_phys) : diff --git a/source/gameengine/Ketsji/KX_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_ReplaceMeshActuator.h index 15967b2af882..6f87bf2a69f8 100644 --- a/source/gameengine/Ketsji/KX_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_ReplaceMeshActuator.h @@ -39,7 +39,7 @@ #include "SCA_PropertyActuator.h" #include "SCA_LogicManager.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" class KX_Scene; class KX_GameObject; @@ -49,7 +49,7 @@ class KX_ReplaceMeshActuator : public SCA_IActuator Py_Header // mesh reference (mesh to replace) - RAS_MeshObject* m_mesh; + RAS_Mesh* m_mesh; KX_Scene *m_scene; bool m_use_gfx; bool m_use_phys; @@ -57,7 +57,7 @@ class KX_ReplaceMeshActuator : public SCA_IActuator public: KX_ReplaceMeshActuator( KX_GameObject *gameobj, - RAS_MeshObject *mesh, + RAS_Mesh *mesh, KX_Scene *scene, bool use_gfx, bool use_phys diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 23b7cc34a1e9..e37bb91331e5 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -56,7 +56,7 @@ #include "KX_Camera.h" #include "SCA_JoystickManager.h" #include "KX_PyMath.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "SCA_IScene.h" #include "KX_LodManager.h" #include "KX_CullingHandler.h" @@ -1644,7 +1644,7 @@ static void MergeScene_GameObject(KX_GameObject *gameobj, KX_Scene *to, KX_Scene to->GetLogicManager()->RegisterGameObjectName(gameobj->GetName(), gameobj); to->GetLogicManager()->RegisterGameObj(gameobj->GetBlenderObject(), gameobj); - for (RAS_MeshObject *meshobj : gameobj->GetMeshList()) { + for (RAS_Mesh *meshobj : gameobj->GetMeshList()) { // Register the mesh object by name and blender object. to->GetLogicManager()->RegisterGameMeshName(meshobj->GetName(), gameobj->GetBlenderObject()); to->GetLogicManager()->RegisterMeshName(meshobj->GetName(), meshobj); diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 7bdeab8c7ea0..820e654502b0 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -72,7 +72,7 @@ struct KX_ClientObjectInfo; class BL_BlenderSceneConverter; class SG_Node; class PHY_IPhysicsEnvironment; -class RAS_MeshObject; +class RAS_Mesh; class RAS_BoundingBoxManager; class RAS_BucketManager; class RAS_MaterialBucket; diff --git a/source/gameengine/Ketsji/KX_SoftBodyDeformer.cpp b/source/gameengine/Ketsji/KX_SoftBodyDeformer.cpp index 3ce3c390fee6..9dc8bb7f5d30 100644 --- a/source/gameengine/Ketsji/KX_SoftBodyDeformer.cpp +++ b/source/gameengine/Ketsji/KX_SoftBodyDeformer.cpp @@ -37,7 +37,7 @@ #include "BLI_utildefines.h" #include "KX_SoftBodyDeformer.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_DisplayArray.h" #include "RAS_BoundingBoxManager.h" @@ -49,7 +49,7 @@ #include "btBulletDynamicsCommon.h" -KX_SoftBodyDeformer::KX_SoftBodyDeformer(RAS_MeshObject *pMeshObject, BL_DeformableGameObject *gameobj) +KX_SoftBodyDeformer::KX_SoftBodyDeformer(RAS_Mesh *pMeshObject, BL_DeformableGameObject *gameobj) :RAS_Deformer(pMeshObject), m_gameobj(gameobj), m_needUpdateAabb(true) diff --git a/source/gameengine/Ketsji/KX_SoftBodyDeformer.h b/source/gameengine/Ketsji/KX_SoftBodyDeformer.h index 024b3f452a76..4d5dcbb3f113 100644 --- a/source/gameengine/Ketsji/KX_SoftBodyDeformer.h +++ b/source/gameengine/Ketsji/KX_SoftBodyDeformer.h @@ -40,7 +40,7 @@ #include "BL_DeformableGameObject.h" #include -class RAS_MeshObject; +class RAS_Mesh; class KX_SoftBodyDeformer : public RAS_Deformer { @@ -51,7 +51,7 @@ class KX_SoftBodyDeformer : public RAS_Deformer bool m_needUpdateAabb; public: - KX_SoftBodyDeformer(RAS_MeshObject *pMeshObject, BL_DeformableGameObject *gameobj); + KX_SoftBodyDeformer(RAS_Mesh *pMeshObject, BL_DeformableGameObject *gameobj); virtual ~KX_SoftBodyDeformer(); virtual void Relink(std::map& map); diff --git a/source/gameengine/Ketsji/KX_TextMaterial.cpp b/source/gameengine/Ketsji/KX_TextMaterial.cpp index fc5d676f2a82..cc02c1c9c9ac 100644 --- a/source/gameengine/Ketsji/KX_TextMaterial.cpp +++ b/source/gameengine/Ketsji/KX_TextMaterial.cpp @@ -93,7 +93,7 @@ void KX_TextMaterial::UpdateIPO(const mt::vec4 &rgba, const mt::vec3 &specrgb, f { } -const RAS_AttributeArray::AttribList KX_TextMaterial::GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const +const RAS_AttributeArray::AttribList KX_TextMaterial::GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const { return {}; } diff --git a/source/gameengine/Ketsji/KX_TextMaterial.h b/source/gameengine/Ketsji/KX_TextMaterial.h index 83866c93a1db..4919bfe12db3 100644 --- a/source/gameengine/Ketsji/KX_TextMaterial.h +++ b/source/gameengine/Ketsji/KX_TextMaterial.h @@ -52,7 +52,7 @@ class KX_TextMaterial : public RAS_IPolyMaterial virtual void UpdateIPO(const mt::vec4 &rgba, const mt::vec3 &specrgb, float hard, float spec, float ref, float emit, float ambient, float alpha, float specalpha); - virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const; + virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const; }; #endif // __KX_TEXTMATERIAL_H__ diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index f8aa22353005..8b28e23bcbc4 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -31,7 +31,7 @@ #include "PHY_IMotionState.h" #include "CcdPhysicsEnvironment.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_Deformer.h" #include "RAS_IPolygonMaterial.h" #include "RAS_MaterialBucket.h" @@ -1620,13 +1620,13 @@ bool CcdPhysicsController::IsPhysicsSuspended() * from_gameobj and from_meshobj can be nullptr * * when setting the mesh, the following vars get priority - * 1) from_meshobj - creates the phys mesh from RAS_MeshObject - * 2) from_gameobj - creates the phys mesh from the DerivedMesh where possible, else the RAS_MeshObject - * 3) this - update the phys mesh from DerivedMesh or RAS_MeshObject + * 1) from_meshobj - creates the phys mesh from RAS_Mesh + * 2) from_gameobj - creates the phys mesh from the DerivedMesh where possible, else the RAS_Mesh + * 3) this - update the phys mesh from DerivedMesh or RAS_Mesh * * Most of the logic behind this is in m_shapeInfo->UpdateMesh(...) */ -bool CcdPhysicsController::ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_MeshObject *from_meshobj, bool dupli) +bool CcdPhysicsController::ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_Mesh *from_meshobj, bool dupli) { if (m_shapeInfo->m_shapeType != PHY_SHAPE_MESH) return false; @@ -1714,7 +1714,7 @@ void DefaultMotionState::CalculateWorldTransformations() // Shape constructor CcdShapeConstructionInfo::MeshShapeMap CcdShapeConstructionInfo::m_meshShapeMap; -CcdShapeConstructionInfo *CcdShapeConstructionInfo::FindMesh(RAS_MeshObject *mesh, RAS_Deformer *deformer, PHY_ShapeType shapeType) +CcdShapeConstructionInfo *CcdShapeConstructionInfo::FindMesh(RAS_Mesh *mesh, RAS_Deformer *deformer, PHY_ShapeType shapeType) { MeshShapeMap::const_iterator mit = m_meshShapeMap.find(MeshShapeKey(mesh, deformer, shapeType)); if (mit != m_meshShapeMap.end()) { @@ -1747,7 +1747,7 @@ void CcdShapeConstructionInfo::ProcessReplica() /* Updates the arrays used by CreateBulletShape(), * take care that recalcLocalAabb() runs after CreateBulletShape is called. * */ -bool CcdShapeConstructionInfo::UpdateMesh(KX_GameObject *gameobj, RAS_MeshObject *meshobj) +bool CcdShapeConstructionInfo::UpdateMesh(KX_GameObject *gameobj, RAS_Mesh *meshobj) { if (!gameobj && !meshobj) { return false; @@ -1768,7 +1768,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(KX_GameObject *gameobj, RAS_MeshObject } else { // Object mesh is last priority. - const std::vector& meshes = gameobj->GetMeshList(); + const std::vector& meshes = gameobj->GetMeshList(); if (!meshes.empty()) { meshobj = meshes.front(); } @@ -1863,7 +1863,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(KX_GameObject *gameobj, RAS_MeshObject // Convert triangles using remaped vertices index. for (unsigned int j = 0, numind = array->GetTriangleIndexCount(); j < numind; j += 3) { - // Should match polygon access index with RAS_MeshObject::GetPolygon. + // Should match polygon access index with RAS_Mesh::GetPolygon. m_polygonIndexArray[curTri] = polygonStartIndex + j / 3; for (unsigned short k = 0; k < 3; ++k) { @@ -1933,7 +1933,7 @@ bool CcdShapeConstructionInfo::SetProxy(CcdShapeConstructionInfo *shapeInfo) return true; } -RAS_MeshObject *CcdShapeConstructionInfo::GetMesh() const +RAS_Mesh *CcdShapeConstructionInfo::GetMesh() const { return m_mesh; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 98a4b822734d..ac0251959b41 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -48,7 +48,7 @@ extern bool gDisableDeactivation; class CcdPhysicsEnvironment; class CcdPhysicsController; class btMotionState; -class RAS_MeshObject; +class RAS_Mesh; class RAS_Deformer; class btCollisionShape; @@ -74,7 +74,7 @@ class CcdShapeConstructionInfo : public CM_RefCount, p float uv[2]; }; - static CcdShapeConstructionInfo *FindMesh(RAS_MeshObject *mesh, RAS_Deformer *deformer, PHY_ShapeType shapeType); + static CcdShapeConstructionInfo *FindMesh(RAS_Mesh *mesh, RAS_Deformer *deformer, PHY_ShapeType shapeType); CcdShapeConstructionInfo() :m_shapeType(PHY_SHAPE_NONE), @@ -141,7 +141,7 @@ class CcdShapeConstructionInfo : public CM_RefCount, p return true; } - bool UpdateMesh(class KX_GameObject *gameobj, class RAS_MeshObject *mesh); + bool UpdateMesh(class KX_GameObject *gameobj, class RAS_Mesh *mesh); CcdShapeConstructionInfo *GetReplica(); @@ -153,7 +153,7 @@ class CcdShapeConstructionInfo : public CM_RefCount, p return m_shapeProxy; } - RAS_MeshObject *GetMesh() const; + RAS_Mesh *GetMesh() const; RAS_IDisplayArrayList& GetDisplayArrayList(); btCollisionShape *CreateBulletShape(btScalar margin, bool useGimpact = false, bool useBvh = true); @@ -190,12 +190,12 @@ class CcdShapeConstructionInfo : public CM_RefCount, p m_weldingThreshold1 = threshold * threshold; } protected: - using MeshShapeKey = std::tuple; + using MeshShapeKey = std::tuple; using MeshShapeMap = std::map; static MeshShapeMap m_meshShapeMap; /// Converted original mesh. - RAS_MeshObject *m_mesh; + RAS_Mesh *m_mesh; /// Hold pointer to display arrays. RAS_IDisplayArrayList m_displayArrayList; /// The list of vertexes and indexes for the triangle mesh, shared between Bullet shape. @@ -866,7 +866,7 @@ class CcdPhysicsController : public PHY_IPhysicsController, public mt::SimdClass return GetConstructionInfo().m_shapeInfo->m_shapeType == PHY_SHAPE_COMPOUND; } - virtual bool ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_MeshObject *from_meshobj, bool dupli = false); + virtual bool ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_Mesh *from_meshobj, bool dupli = false); virtual void ReplacePhysicsShape(PHY_IPhysicsController *phyctrl); }; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 9ab19af72253..08d17e73cbb9 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -46,7 +46,7 @@ #include "KX_GameObject.h" #include "KX_Globals.h" // for KX_RasterizerDrawDebugLine #include "BL_BlenderSceneConverter.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_IDisplayArray.h" #include "RAS_MaterialBucket.h" #include "RAS_IPolygonMaterial.h" @@ -1861,7 +1861,7 @@ struct DbvtCullingCallback : btDbvt::ICollide { m_ocb->SetModelMatrix(fl); const float negative = gameobj->IsNegativeScaling(); // walk through the meshes and for each add to buffer - for (RAS_MeshObject *meshobj : gameobj->GetMeshList()) { + for (RAS_Mesh *meshobj : gameobj->GetMeshList()) { for (RAS_MeshMaterial *meshmat : meshobj->GetMeshMaterialList()) { RAS_IDisplayArray *array = meshmat->GetDisplayArray(); const bool twoside = meshmat->GetBucket()->GetPolyMaterial()->IsTwoSided(); @@ -2655,7 +2655,7 @@ CcdPhysicsEnvironment *CcdPhysicsEnvironment::Create(Scene *blenderscene, bool v return ccdPhysEnv; } -void CcdPhysicsEnvironment::ConvertObject(BL_BlenderSceneConverter& converter, KX_GameObject *gameobj, RAS_MeshObject *meshobj, +void CcdPhysicsEnvironment::ConvertObject(BL_BlenderSceneConverter& converter, KX_GameObject *gameobj, RAS_Mesh *meshobj, KX_Scene *kxscene, PHY_IMotionState *motionstate, int activeLayerBitInfo, bool isCompoundChild, bool hasCompoundChildren) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 072952248c09..3a92df0c4a8b 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -257,7 +257,7 @@ class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment, public mt::SimdCla virtual void ConvertObject(BL_BlenderSceneConverter& converter, KX_GameObject *gameobj, - RAS_MeshObject *meshobj, + RAS_Mesh *meshobj, KX_Scene *kxscene, PHY_IMotionState *motionstate, int activeLayerBitInfo, diff --git a/source/gameengine/Physics/Common/PHY_IPhysicsController.h b/source/gameengine/Physics/Common/PHY_IPhysicsController.h index c4d344f34456..769e0ed0ee63 100644 --- a/source/gameengine/Physics/Common/PHY_IPhysicsController.h +++ b/source/gameengine/Physics/Common/PHY_IPhysicsController.h @@ -40,7 +40,7 @@ class PHY_IMotionState; class PHY_IPhysicsEnvironment; class KX_GameObject; -class RAS_MeshObject; +class RAS_Mesh; /** * PHY_IPhysicsController is the abstract simplified Interface to a physical object. @@ -150,7 +150,7 @@ class PHY_IPhysicsController : public PHY_IController virtual bool IsDynamicsSuspended() const = 0; virtual bool IsPhysicsSuspended() = 0; - virtual bool ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_MeshObject *from_meshobj, bool dupli = false) = 0; + virtual bool ReinstancePhysicsShape(KX_GameObject *from_gameobj, RAS_Mesh *from_meshobj, bool dupli = false) = 0; virtual void ReplacePhysicsShape(PHY_IPhysicsController *phyctrl) = 0; }; diff --git a/source/gameengine/Physics/Common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/Common/PHY_IPhysicsEnvironment.h index ae32a46b2f4c..5d1d41eca761 100644 --- a/source/gameengine/Physics/Common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/Common/PHY_IPhysicsEnvironment.h @@ -39,10 +39,10 @@ class PHY_IConstraint; class PHY_IVehicle; class PHY_ICharacter; -class RAS_MeshObject; +class RAS_Mesh; class PHY_IPhysicsController; -class RAS_MeshObject; +class RAS_Mesh; class KX_GameObject; class KX_Scene; class BL_BlenderSceneConverter; @@ -57,7 +57,7 @@ struct PHY_RayCastResult { PHY_IPhysicsController *m_controller; mt::vec3 m_hitPoint; mt::vec3 m_hitNormal; - RAS_MeshObject *m_meshObject; // !=nullptr for mesh object (only for Bullet controllers) + RAS_Mesh *m_meshObject; // !=nullptr for mesh object (only for Bullet controllers) int m_polygon; // index of the polygon hit by the ray, only if m_meshObject != nullptr int m_hitUVOK; // !=0 if UV coordinate in m_hitUV is valid mt::vec2 m_hitUV; // UV coordinates of hit point @@ -236,7 +236,7 @@ class PHY_IPhysicsEnvironment virtual void ConvertObject(BL_BlenderSceneConverter& converter, KX_GameObject *gameobj, - RAS_MeshObject *meshobj, + RAS_Mesh *meshobj, KX_Scene *kxscene, PHY_IMotionState *motionstate, int activeLayerBitInfo, diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 4b62e963f59a..b650c7391c1e 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -124,7 +124,7 @@ class DummyPhysicsEnvironment : public PHY_IPhysicsEnvironment virtual void ConvertObject(BL_BlenderSceneConverter& converter, KX_GameObject *gameobj, - RAS_MeshObject *meshobj, + RAS_Mesh *meshobj, KX_Scene *kxscene, PHY_IMotionState *motionstate, int activeLayerBitInfo, diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 088e2d764859..26c86c29c564 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -75,7 +75,7 @@ set(SRC RAS_Rasterizer.cpp RAS_MaterialBucket.cpp RAS_MeshMaterial.cpp - RAS_MeshObject.cpp + RAS_Mesh.cpp RAS_MeshSlot.cpp RAS_MeshUser.cpp RAS_OffScreen.cpp @@ -114,7 +114,7 @@ set(SRC RAS_ISync.h RAS_MaterialBucket.h RAS_MeshMaterial.h - RAS_MeshObject.h + RAS_Mesh.h RAS_MeshSlot.h RAS_MeshUser.h RAS_OffScreen.h diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index fc08f2c8bc0e..508702c21ed6 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -35,7 +35,7 @@ #endif #include "RAS_MaterialBucket.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_IPolygonMaterial.h" #include "RAS_Rasterizer.h" diff --git a/source/gameengine/Rasterizer/RAS_Deformer.cpp b/source/gameengine/Rasterizer/RAS_Deformer.cpp index 8b5e5818b59b..209b3b6394e1 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.cpp +++ b/source/gameengine/Rasterizer/RAS_Deformer.cpp @@ -21,9 +21,9 @@ */ #include "RAS_Deformer.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" -RAS_Deformer::RAS_Deformer(RAS_MeshObject *mesh) +RAS_Deformer::RAS_Deformer(RAS_Mesh *mesh) :m_mesh(mesh), m_bDynamic(false), m_boundingBox(nullptr) @@ -72,7 +72,7 @@ void RAS_Deformer::ProcessReplica() } } -RAS_MeshObject *RAS_Deformer::GetMesh() const +RAS_Mesh *RAS_Deformer::GetMesh() const { return m_mesh; } diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 0a989637eb8a..c4a2c5eb03eb 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -42,13 +42,13 @@ #include -class RAS_MeshObject; +class RAS_Mesh; class SCA_IObject; class RAS_Deformer { public: - RAS_Deformer(RAS_MeshObject *mesh); + RAS_Deformer(RAS_Mesh *mesh); virtual ~RAS_Deformer(); void InitializeDisplayArrays(); @@ -76,7 +76,7 @@ class RAS_Deformer return m_boundingBox; } - RAS_MeshObject *GetMesh() const; + RAS_Mesh *GetMesh() const; RAS_IDisplayArray *GetDisplayArray(unsigned short index) const; RAS_DisplayArrayBucket *GetDisplayArrayBucket(unsigned short index) const; @@ -99,7 +99,7 @@ class RAS_Deformer std::vector m_slots; - RAS_MeshObject *m_mesh; + RAS_Mesh *m_mesh; bool m_bDynamic; /// Deformer bounding box. diff --git a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp index 609815d01e1e..85221c4c1cc1 100644 --- a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp @@ -35,7 +35,7 @@ #include "RAS_AttributeArrayStorage.h" #include "RAS_MaterialBucket.h" #include "RAS_IPolygonMaterial.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_Deformer.h" #include "RAS_Rasterizer.h" #include "RAS_InstancingBuffer.h" @@ -52,7 +52,7 @@ #endif // WIN32 RAS_DisplayArrayBucket::RAS_DisplayArrayBucket(RAS_MaterialBucket *bucket, RAS_IDisplayArray *array, - RAS_MeshObject *mesh, RAS_MeshMaterial *meshmat, RAS_Deformer *deformer) + RAS_Mesh *mesh, RAS_MeshMaterial *meshmat, RAS_Deformer *deformer) :m_bucket(bucket), m_displayArray(array), m_mesh(mesh), @@ -108,7 +108,7 @@ RAS_IDisplayArray *RAS_DisplayArrayBucket::GetDisplayArray() const return m_displayArray; } -RAS_MeshObject *RAS_DisplayArrayBucket::GetMesh() const +RAS_Mesh *RAS_DisplayArrayBucket::GetMesh() const { return m_mesh; } @@ -161,7 +161,7 @@ void RAS_DisplayArrayBucket::UpdateActiveMeshSlots(RAS_Rasterizer::DrawType draw if (m_materialUpdateClient.GetInvalidAndClear()) { RAS_IPolyMaterial *polymat = m_bucket->GetPolyMaterial(); - const RAS_MeshObject::LayersInfo& layersInfo = m_mesh->GetLayersInfo(); + const RAS_Mesh::LayersInfo& layersInfo = m_mesh->GetLayersInfo(); const RAS_AttributeArray::AttribList attribList = polymat->GetAttribs(layersInfo); m_attribArray = RAS_AttributeArray(attribList, m_displayArray); diff --git a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.h b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.h index 5d62e5428bb3..53ca5ec5206e 100644 --- a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.h +++ b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.h @@ -41,7 +41,7 @@ class RAS_MaterialBucket; class RAS_IDisplayArray; -class RAS_MeshObject; +class RAS_Mesh; class RAS_MeshMaterial; class RAS_Deformer; class RAS_IStorageInfo; @@ -55,7 +55,7 @@ class RAS_DisplayArrayBucket /// The display array = list of vertexes and indexes. RAS_IDisplayArray *m_displayArray; /// The parent mesh object, it can be nullptr for text objects. - RAS_MeshObject *m_mesh; + RAS_Mesh *m_mesh; /// The material mesh. RAS_MeshMaterial *m_meshMaterial; /// The list of all visible mesh slots to render this frame. @@ -82,13 +82,13 @@ class RAS_DisplayArrayBucket public: RAS_DisplayArrayBucket(RAS_MaterialBucket *bucket, RAS_IDisplayArray *array, - RAS_MeshObject *mesh, RAS_MeshMaterial *meshmat, RAS_Deformer *deformer); + RAS_Mesh *mesh, RAS_MeshMaterial *meshmat, RAS_Deformer *deformer); ~RAS_DisplayArrayBucket(); /// \section Accesor RAS_MaterialBucket *GetBucket() const; RAS_IDisplayArray *GetDisplayArray() const; - RAS_MeshObject *GetMesh() const; + RAS_Mesh *GetMesh() const; RAS_MeshMaterial *GetMeshMaterial() const; /// \section Active Mesh Slots Management. diff --git a/source/gameengine/Rasterizer/RAS_IDisplayArray.cpp b/source/gameengine/Rasterizer/RAS_IDisplayArray.cpp index 8b6680b446f0..c85aebabed2c 100644 --- a/source/gameengine/Rasterizer/RAS_IDisplayArray.cpp +++ b/source/gameengine/Rasterizer/RAS_IDisplayArray.cpp @@ -26,7 +26,7 @@ #include "RAS_DisplayArray.h" #include "RAS_DisplayArrayStorage.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "CM_Template.h" diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 7015d2e16fab..4f0661cc82ef 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -33,7 +33,7 @@ #define __RAS_IPOLYGONMATERIAL_H__ #include "RAS_Texture.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_AttributeArray.h" #include "CM_Update.h" @@ -137,7 +137,7 @@ class RAS_IPolyMaterial : public CM_UpdateServer virtual void UpdateIPO(const mt::vec4 &rgba, const mt::vec3 &specrgb, float hard, float spec, float ref, float emit, float ambient, float alpha, float specalpha) = 0; - virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_MeshObject::LayersInfo& layersInfo) const = 0; + virtual const RAS_AttributeArray::AttribList GetAttribs(const RAS_Mesh::LayersInfo& layersInfo) const = 0; /** * \return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode). diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 10918284342e..fb2b2447aae8 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -32,7 +32,7 @@ #include "RAS_MaterialBucket.h" #include "RAS_IPolygonMaterial.h" #include "RAS_Rasterizer.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_Deformer.h" diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_Mesh.cpp similarity index 81% rename from source/gameengine/Rasterizer/RAS_MeshObject.cpp rename to source/gameengine/Rasterizer/RAS_Mesh.cpp index 575a294eb41f..dfbc8c92e23f 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_Mesh.cpp @@ -25,13 +25,13 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file gameengine/Rasterizer/RAS_MeshObject.cpp +/** \file gameengine/Rasterizer/RAS_Mesh.cpp * \ingroup bgerast */ #include "DNA_mesh_types.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MeshUser.h" #include "RAS_BoundingBoxManager.h" #include "RAS_IPolygonMaterial.h" @@ -43,7 +43,7 @@ #include "CM_Message.h" -RAS_MeshObject::RAS_MeshObject(Mesh *mesh, const LayersInfo& layersInfo) +RAS_Mesh::RAS_Mesh(Mesh *mesh, const LayersInfo& layersInfo) :m_name(mesh->id.name + 2), m_layersInfo(layersInfo), m_boundingBox(nullptr), @@ -51,7 +51,7 @@ RAS_MeshObject::RAS_MeshObject(Mesh *mesh, const LayersInfo& layersInfo) { } -RAS_MeshObject::~RAS_MeshObject() +RAS_Mesh::~RAS_Mesh() { for (RAS_MeshMaterial *meshmat : m_materials) { delete meshmat; @@ -59,17 +59,17 @@ RAS_MeshObject::~RAS_MeshObject() m_materials.clear(); } -const RAS_MeshMaterialList& RAS_MeshObject::GetMeshMaterialList() const +const RAS_MeshMaterialList& RAS_Mesh::GetMeshMaterialList() const { return m_materials; } -unsigned short RAS_MeshObject::GetNumMaterials() const +unsigned short RAS_Mesh::GetNumMaterials() const { return m_materials.size(); } -std::string RAS_MeshObject::GetMaterialName(unsigned int matid) const +std::string RAS_Mesh::GetMaterialName(unsigned int matid) const { RAS_MeshMaterial *mmat = GetMeshMaterial(matid); @@ -79,7 +79,7 @@ std::string RAS_MeshObject::GetMaterialName(unsigned int matid) const return ""; } -RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterial(unsigned int matid) const +RAS_MeshMaterial *RAS_Mesh::GetMeshMaterial(unsigned int matid) const { if (m_materials.size() > matid) { return m_materials[matid]; @@ -88,7 +88,7 @@ RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterial(unsigned int matid) const return nullptr; } -RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterialBlenderIndex(unsigned int index) const +RAS_MeshMaterial *RAS_Mesh::GetMeshMaterialBlenderIndex(unsigned int index) const { for (RAS_MeshMaterial *meshmat : m_materials) { if (meshmat->GetIndex() == index) { @@ -99,7 +99,7 @@ RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterialBlenderIndex(unsigned int index return nullptr; } -RAS_MeshMaterial *RAS_MeshObject::FindMaterialName(const std::string& name) const +RAS_MeshMaterial *RAS_Mesh::FindMaterialName(const std::string& name) const { for (RAS_MeshMaterial *meshmat : m_materials) { // Check without the MA prefix. @@ -111,12 +111,12 @@ RAS_MeshMaterial *RAS_MeshObject::FindMaterialName(const std::string& name) cons return nullptr; } -unsigned int RAS_MeshObject::GetNumPolygons() const +unsigned int RAS_Mesh::GetNumPolygons() const { return m_numPolygons; } -RAS_MeshObject::PolygonInfo RAS_MeshObject::GetPolygon(unsigned int index) const +RAS_Mesh::PolygonInfo RAS_Mesh::GetPolygon(unsigned int index) const { // Convert triangle index to triangle vertex index. index *= 3; @@ -144,12 +144,12 @@ RAS_MeshObject::PolygonInfo RAS_MeshObject::GetPolygon(unsigned int index) const return PolygonInfo(); } -const std::string& RAS_MeshObject::GetName() const +const std::string& RAS_Mesh::GetName() const { return m_name; } -std::string RAS_MeshObject::GetTextureName(unsigned int matid) const +std::string RAS_Mesh::GetTextureName(unsigned int matid) const { RAS_MeshMaterial *mmat = GetMeshMaterial(matid); @@ -159,7 +159,7 @@ std::string RAS_MeshObject::GetTextureName(unsigned int matid) const return ""; } -RAS_MeshMaterial *RAS_MeshObject::AddMaterial(RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format) +RAS_MeshMaterial *RAS_Mesh::AddMaterial(RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format) { RAS_MeshMaterial *meshmat = GetMeshMaterialBlenderIndex(index); @@ -172,7 +172,7 @@ RAS_MeshMaterial *RAS_MeshObject::AddMaterial(RAS_MaterialBucket *bucket, unsign return meshmat; } -RAS_IDisplayArray *RAS_MeshObject::GetDisplayArray(unsigned int matid) const +RAS_IDisplayArray *RAS_Mesh::GetDisplayArray(unsigned int matid) const { RAS_MeshMaterial *mmat = GetMeshMaterial(matid); @@ -184,12 +184,12 @@ RAS_IDisplayArray *RAS_MeshObject::GetDisplayArray(unsigned int matid) const return array; } -RAS_BoundingBox *RAS_MeshObject::GetBoundingBox() const +RAS_BoundingBox *RAS_Mesh::GetBoundingBox() const { return m_boundingBox; } -RAS_MeshUser* RAS_MeshObject::AddMeshUser(void *clientobj, RAS_Deformer *deformer) +RAS_MeshUser* RAS_Mesh::AddMeshUser(void *clientobj, RAS_Deformer *deformer) { RAS_BoundingBox *boundingBox = (deformer) ? deformer->GetBoundingBox() : m_boundingBox; RAS_MeshUser *meshUser = new RAS_MeshUser(clientobj, boundingBox); @@ -203,7 +203,7 @@ RAS_MeshUser* RAS_MeshObject::AddMeshUser(void *clientobj, RAS_Deformer *deforme return meshUser; } -void RAS_MeshObject::EndConversion(RAS_BoundingBoxManager *boundingBoxManager) +void RAS_Mesh::EndConversion(RAS_BoundingBoxManager *boundingBoxManager) { RAS_IDisplayArrayList arrayList; @@ -266,7 +266,7 @@ void RAS_MeshObject::EndConversion(RAS_BoundingBoxManager *boundingBoxManager) m_numPolygons = startIndex; } -const RAS_MeshObject::LayersInfo& RAS_MeshObject::GetLayersInfo() const +const RAS_Mesh::LayersInfo& RAS_Mesh::GetLayersInfo() const { return m_layersInfo; } diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_Mesh.h similarity index 93% rename from source/gameengine/Rasterizer/RAS_MeshObject.h rename to source/gameengine/Rasterizer/RAS_Mesh.h index 9cb63ec4e6f7..17f0aea66a2d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_Mesh.h @@ -25,12 +25,12 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file RAS_MeshObject.h +/** \file RAS_Mesh.h * \ingroup bgerast */ -#ifndef __RAS_MESHOBJECT_H__ -#define __RAS_MESHOBJECT_H__ +#ifndef __RAS_MESH_H__ +#define __RAS_MESH_H__ #ifdef _MSC_VER /* disable the STL warnings ("debug information length > 255") */ @@ -50,11 +50,11 @@ class RAS_BoundingBox; class RAS_BoundingBoxManager; struct Mesh; -/* RAS_MeshObject is a mesh used for rendering. It stores polygons, +/* RAS_Mesh is a mesh used for rendering. It stores polygons, * but the actual vertices and index arrays are stored in material * buckets, referenced by the list of RAS_MeshMaterials. */ -class RAS_MeshObject +class RAS_Mesh { public: /** Additionals data stored in mesh layers. These datas can be the colors layer or the @@ -82,7 +82,7 @@ class RAS_MeshObject }; /** Polygon info generate when getting a polygon through - * RAS_MeshObject::GetPolygon. */ + * RAS_Mesh::GetPolygon. */ struct PolygonInfo { enum Flags { NONE = 0, @@ -133,8 +133,8 @@ class RAS_MeshObject public: // for now, meshes need to be in a certain layer (to avoid sorting on lights in realtime) - RAS_MeshObject(Mesh *mesh, const LayersInfo& layersInfo); - virtual ~RAS_MeshObject(); + RAS_Mesh(Mesh *mesh, const LayersInfo& layersInfo); + virtual ~RAS_Mesh(); // materials unsigned short GetNumMaterials() const; @@ -173,4 +173,4 @@ class RAS_MeshObject const LayersInfo& GetLayersInfo() const; }; -#endif // __RAS_MESHOBJECT_H__ +#endif // __RAS_MESH_H__ diff --git a/source/gameengine/Rasterizer/RAS_MeshMaterial.cpp b/source/gameengine/Rasterizer/RAS_MeshMaterial.cpp index ac53b618a26c..1b856ebde2ee 100644 --- a/source/gameengine/Rasterizer/RAS_MeshMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshMaterial.cpp @@ -25,7 +25,7 @@ #include "RAS_IDisplayArray.h" #include "RAS_DisplayArrayBucket.h" -RAS_MeshMaterial::RAS_MeshMaterial(RAS_MeshObject *mesh, RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format) +RAS_MeshMaterial::RAS_MeshMaterial(RAS_Mesh *mesh, RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format) :m_bucket(bucket), m_index(index) { diff --git a/source/gameengine/Rasterizer/RAS_MeshMaterial.h b/source/gameengine/Rasterizer/RAS_MeshMaterial.h index 6c92f91ce4bd..747534b2864f 100644 --- a/source/gameengine/Rasterizer/RAS_MeshMaterial.h +++ b/source/gameengine/Rasterizer/RAS_MeshMaterial.h @@ -34,7 +34,7 @@ #include -class RAS_MeshObject; +class RAS_Mesh; class RAS_IDisplayArray; class RAS_DisplayArrayBucket; class RAS_MaterialBucket; @@ -55,7 +55,7 @@ class RAS_MeshMaterial RAS_DisplayArrayBucket *m_displayArrayBucket; public: - RAS_MeshMaterial(RAS_MeshObject *mesh, RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format); + RAS_MeshMaterial(RAS_Mesh *mesh, RAS_MaterialBucket *bucket, unsigned int index, const RAS_VertexFormat& format); ~RAS_MeshMaterial(); unsigned int GetIndex() const; diff --git a/source/gameengine/Rasterizer/RAS_MeshSlot.cpp b/source/gameengine/Rasterizer/RAS_MeshSlot.cpp index 184dc8eaf77e..1f373613fb8a 100644 --- a/source/gameengine/Rasterizer/RAS_MeshSlot.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshSlot.cpp @@ -35,7 +35,7 @@ #include "RAS_Vertex.h" #include "RAS_IDisplayArray.h" #include "RAS_DisplayArrayStorage.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #ifdef _MSC_VER # pragma warning (disable:4786) diff --git a/source/gameengine/Rasterizer/RAS_Rasterizer.cpp b/source/gameengine/Rasterizer/RAS_Rasterizer.cpp index bf115e67fb25..3333f3d8026c 100644 --- a/source/gameengine/Rasterizer/RAS_Rasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_Rasterizer.cpp @@ -1242,8 +1242,8 @@ void RAS_Rasterizer::RemoveLight(RAS_ILightObject *lightobject) bool RAS_Rasterizer::RayHit(struct KX_ClientObjectInfo *client, KX_RayCast *result, RayCastTranform *raytransform) { if (result->m_hitMesh) { - const RAS_MeshObject::PolygonInfo poly = result->m_hitMesh->GetPolygon(result->m_hitPolygon); - if (!(poly.flags & RAS_MeshObject::PolygonInfo::VISIBLE)) { + const RAS_Mesh::PolygonInfo poly = result->m_hitMesh->GetPolygon(result->m_hitPolygon); + if (!(poly.flags & RAS_Mesh::PolygonInfo::VISIBLE)) { return false; } diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 16b36ff2b79a..b24d469ee79d 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -44,7 +44,7 @@ #include "DNA_scene_types.h" #include "RAS_OffScreen.h" #include "RAS_CameraData.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_MaterialBucket.h" #include "RAS_IDisplayArray.h" #include "RAS_ISync.h" @@ -903,7 +903,7 @@ ImageRender::ImageRender (KX_Scene *scene, KX_GameObject *observer, KX_GameObjec m_rasterizer = m_engine->GetRasterizer(); m_canvas = m_engine->GetCanvas(); // locate the vertex assigned to mat and do following calculation in mesh coordinates - for (RAS_MeshObject *mesh : mirror->GetMeshList()) { + for (RAS_Mesh *mesh : mirror->GetMeshList()) { for (RAS_MeshMaterial *meshmat : mesh->GetMeshMaterialList()) { if (meshmat->GetBucket()->GetPolyMaterial() == mat) { RAS_IDisplayArray *array = meshmat->GetDisplayArray(); diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index 5021c58d9f2c..af9f16ad6272 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -35,7 +35,7 @@ #include "KX_GameObject.h" #include "KX_LightObject.h" -#include "RAS_MeshObject.h" +#include "RAS_Mesh.h" #include "RAS_ILightObject.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -202,14 +202,14 @@ void loadTexture(unsigned int texId, unsigned int *texture, short *size, RAS_IPolyMaterial *getMaterial(KX_GameObject *gameObj, short matID) { // get pointer to texture image - const std::vector& meshes = gameObj->GetMeshList(); + const std::vector& meshes = gameObj->GetMeshList(); if (meshes.empty()) { return nullptr; } // get material from mesh - RAS_MeshObject *mesh = meshes.front(); + RAS_Mesh *mesh = meshes.front(); RAS_MeshMaterial *meshMat = mesh->GetMeshMaterial(matID); if (meshMat && meshMat->GetBucket()) { // return pointer to polygon or blender material