diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index e3d645b34aa8..311eeb66059a 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1493,7 +1493,7 @@ void CcdPhysicsController::AddCompoundChild(PHY_IPhysicsController *child) } // other controller must be a bullet controller too // verify that body and shape exist and match - CcdPhysicsController *childCtrl = dynamic_cast(child); + CcdPhysicsController *childCtrl = static_cast(child); btRigidBody *rootBody = GetRigidBody(); btRigidBody *childBody = childCtrl->GetRigidBody(); if (!rootBody || !childBody) { @@ -1569,7 +1569,7 @@ void CcdPhysicsController::RemoveCompoundChild(PHY_IPhysicsController *child) } // other controller must be a bullet controller too // verify that body and shape exist and match - CcdPhysicsController *childCtrl = dynamic_cast(child); + CcdPhysicsController *childCtrl = static_cast(child); btRigidBody *rootBody = GetRigidBody(); btRigidBody *childBody = childCtrl->GetRigidBody(); if (!rootBody || !childBody) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 7d0661feea21..29c854e7c672 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -1943,7 +1943,7 @@ btDispatcher *CcdPhysicsEnvironment::GetDispatcher() void CcdPhysicsEnvironment::MergeEnvironment(PHY_IPhysicsEnvironment *other_env) { - CcdPhysicsEnvironment *other = dynamic_cast(other_env); + CcdPhysicsEnvironment *other = static_cast(other_env); if (other == nullptr) { CM_Error("other scene is not using Bullet physics, not merging physics."); return; @@ -2189,7 +2189,7 @@ PHY_IVehicle *CcdPhysicsEnvironment::GetVehicleConstraint(int constraintId) PHY_ICharacter *CcdPhysicsEnvironment::GetCharacterController(KX_GameObject *ob) { CcdPhysicsController *controller = (CcdPhysicsController *)ob->GetPhysicsController(); - return (controller) ? dynamic_cast(controller->GetCharacterController()) : nullptr; + return (controller) ? static_cast(controller->GetCharacterController()) : nullptr; } diff --git a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp index 2eccaf5c0f17..3ea6f2964e03 100644 --- a/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_DisplayArrayBucket.cpp @@ -324,13 +324,13 @@ void RAS_DisplayArrayBucket::RunBatchingNode(const RAS_DisplayArrayNodeTuple& tu RAS_ManagerNodeData *managerData = tuple.m_managerData; RAS_MaterialNodeData *materialData = tuple.m_materialData; - unsigned int nummeshslots = m_activeMeshSlots.size(); + const unsigned int nummeshslots = m_activeMeshSlots.size(); // We must use a int instead of unsigned size to match GLsizei type. std::vector counts(nummeshslots); std::vector indices(nummeshslots); - RAS_BatchDisplayArray *batchArray = dynamic_cast(m_displayArray); + RAS_BatchDisplayArray *batchArray = static_cast(m_displayArray); /* If the material use the transparency we must sort all mesh slots depending on the distance. * This code share the code used in RAS_BucketManager to do the sort. diff --git a/source/gameengine/Rasterizer/RAS_Rasterizer.cpp b/source/gameengine/Rasterizer/RAS_Rasterizer.cpp index aebaa3897f04..c1e83fc369e0 100644 --- a/source/gameengine/Rasterizer/RAS_Rasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_Rasterizer.cpp @@ -1222,14 +1222,14 @@ RAS_ILightObject *RAS_Rasterizer::CreateLight() void RAS_Rasterizer::AddLight(RAS_ILightObject *lightobject) { - RAS_OpenGLLight *gllight = dynamic_cast(lightobject); + RAS_OpenGLLight *gllight = static_cast(lightobject); BLI_assert(gllight); m_lights.push_back(gllight); } void RAS_Rasterizer::RemoveLight(RAS_ILightObject *lightobject) { - RAS_OpenGLLight *gllight = dynamic_cast(lightobject); + RAS_OpenGLLight *gllight = static_cast(lightobject); BLI_assert(gllight); CM_ListRemoveIfFound(m_lights, gllight);