Dear Epic,
I am finding it very hard to utilize PxShape in C++ game project code, here’s the includes I’ve tried, all at the same time, still no compile:
#include "Runtime/PhysicsCore/Public/PhysicsInterfaceUtilsCore.h"
#include "Runtime/PhysicsCore/Public/PhysXPublicCore.h"
#include "Runtime/Engine/Public/Physics/Experimental/PhysicsInterfaceImmediatePhysX.h"
#include "Runtime/PhysicsCore/Public/PhysicsInterfaceDeclaresCore.h"
#include "Physics/ImmediatePhysics/ImmediatePhysicsPhysX/ImmediatePhysicsSimulation_PhysX.h"
#include "Engine/EngineTypes.h"
#include "Engine/World.h"
#include "Components/PrimitiveComponent.h"
#include "PhysicsEngine/RigidBodyIndexPair.h"
#include "CustomPhysXPayload.h"
#include "PhysXPublic.h"
#include "PhysicsEngine/ConstraintInstance.h"
#include "PhysicsEngine/BodySetup.h"
#include "PhysicsPublicCore.h"
#include "PhysicsEngine/BodyInstance.h"
#include "PhysXIncludes.h"
#include "PhysicsPublic.h"
#include "PhysXPublic.h"
#include "Runtime/Engine/Private/PhysicsEngine/PhysXSupport.h"
And here’s the code that won’t compile
using namespace physx;
using namespace PhysicsInterfaceTypes;
static void DrawBody_Internal(
UWorld* World,
PxShape* Shape,
const FTransform& ShapeGlobalTrans,
const FQuat& ShapeGlobalRot,
float Thickness,
bool DrawRed
){
//Sphere
if(Shape->getGeometryType() == PxGeometryType::Enum::eSPHERE)
{
PxSphereGeometry SpherePxGeom;
Shape->getSphereGeometry(SpherePxGeom);
DrawDebugSphere(
World,
ShapeGlobalTrans.GetLocation(),
SpherePxGeom.radius,// * BodyMinScaleAbs, //Dont need to scale the GEOM!
24,
DrawRed ? FColor::Red : FColor::Yellow,
false,
-1.f //LifeTime
);
return;
//~~~~
}
//...etc
The Compile Error
error C2027: use of undefined type 'physx::PxShape'
I get same message without the physx:: depending on includes and whether I do the using namespace or not
What is Puzzling
What is puzzling me is that I see PxShape used in the engine code, with the same includes I’ve included, but I am getting a compile error in game project code.
Rama
PS: Thank you in advance for a rapid response as I can’t update my melee plugin on the marketplace until I get PxShape compiling! Victory to You!