Dear Friends at Epic,
I would like to do some PhysX code writing in DestructibleComponent sublcass that is contained with my game’s project module.
I am not writing engine code, just project level code
I included PhysX as a module in my Build.cs!
I added these includes in my subclassed DestructibleComponent.cpp
#include "PhysicsPublic.h"
//#include "PhysicsEngine/PhysXSupport.h"
//#include "Collision/PhysXCollision.h"
I wrote some sample code:
//testing stuff
#if WITH_PHYSX
for(FDestructibleChunkInfo& Each : DestructibleComponent->ChunkInfos)
{
physx::PxRigidDynamic* Actor = Each.Actor;
if(Actor)
{
PxTransform Trans = Actor->GetGlobalPose();
PxVec3 PxLoc = Trans.p;
FVector Location(PxLoc.x,PxLoc.y,PxLoc.z);
DrawPoint(Location);
}
}
#endif // WITH_PHYSX
#Issues
The two includes I have commented out wont compile!
//#include "PhysicsEngine/PhysXSupport.h"
//#include "Collision/PhysXCollision.h"
Compile says it cannot open these includes
#Compile Errors
And when I compile I get these errors:
1>------ Build started: Project: JoyShapes, Configuration: Development_Editor x64 ------
1> Performing 2 actions (max 4 parallel jobs)
1> Module.JoyShapes.1_of_3.cpp
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(167): error C2079: 'Trans' uses undefined class 'physx::PxTransform'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(167): error C2027: use of undefined type 'physx::PxRigidDynamic'
1> E:\VictoryUE4\UnrealEngine-4.3\Engine\Source\Runtime\Engine\Classes\PhysicsEngine/BodyInstance.h(19) : see declaration of 'physx::PxRigidDynamic'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(167): error C2227: left of '->GetGlobalPose' must point to class/struct/union/generic type
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(168): error C2079: 'PxLoc' uses undefined class 'physx::PxVec3'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(168): error C2228: left of '.p' must have class/struct/union
1> type is 'int'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(170): error C2228: left of '.x' must have class/struct/union
1> type is 'int'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(170): error C2228: left of '.y' must have class/struct/union
1> type is 'int'
1>C:\Users\\Documents\Unreal Projects\JoyShapes\Source\JoyShapes\Private\Base\JoyDestruction.cpp(170): error C2228: left of '.z' must have class/struct/union
1> type is 'int'
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\\Documents\Unreal Projects\JoyShapes\Binaries\Win64\UE4Editor-JoyShapes.pdb
1> Cumulative action seconds (8 processors): 0.00 building projects, 8.58 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
1> UBT execution time: 23.08 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "E:\VictoryUE4\UnrealEngine-4.3\Engine\Build\BatchFiles\Build.bat JoyShapesEditor Win64 Development "C:\Users\\Documents\Unreal Projects\JoyShapes\JoyShapes.uproject"" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#Question
What do I need to do so I can work with the Px var types?
#Thanks!
Thanks!