Simulation filtering

This commit is contained in:
bloeys
2022-02-14 06:45:15 +04:00
parent 832f16f3fe
commit 3344705f6b
7 changed files with 79 additions and 1 deletions

26
pgo/physx-c/CPxFilterData.h Executable file
View File

@ -0,0 +1,26 @@
#ifndef CPxFilterData_H
#define CPxFilterData_H
#ifdef __cplusplus
extern "C" {
#endif
struct CPxFilterData
{
unsigned int word0;
unsigned int word1;
unsigned int word2;
unsigned int word3;
//TODO: For some reason only this file breaks with CPxU32 (uint32_t). Why?
/*CPxU32 word0;
CPxU32 word1;
CPxU32 word2;
CPxU32 word3;*/
};
#ifdef __cplusplus
}
#endif
#endif // !CPxFilterData_H

View File

@ -1,6 +1,8 @@
#ifndef CPxRigidActor_H
#define CPxRigidActor_H
#include "CPxFilterData.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -10,6 +12,9 @@ extern "C" {
void* obj;
};
//Sets the CPxFilterData on all the shapes of the actor.
CPxAPI void CPxRigidActor_setSimFilterData(CSTRUCT CPxRigidActor* cra, CSTRUCT CPxFilterData* cfd);
#ifdef __cplusplus
}
#endif

View File

@ -14,7 +14,7 @@ extern "C" {
};
/// <summary>
/// Creates a SceneDesc with filterShader=physx::PxDefaultSimulationFilterShader
/// Creates a SceneDesc with a custom filterShader that uses word0/word1 as groups shapes belong to, and word2/word3 as mask on the groups.
/// </summary>
/// <param name="CPxTolerancesScale"></param>
/// <returns></returns>

View File

@ -2,6 +2,7 @@
#define CPxShape_H
#include "CPxTransform.h"
#include "CPxFilterData.h"
#ifdef __cplusplus
extern "C" {
@ -14,6 +15,8 @@ extern "C" {
CPxAPI void CPxShape_setLocalPose(CSTRUCT CPxShape* cs, CSTRUCT CPxTransform* tr);
CPxAPI CSTRUCT CPxTransform CPxShape_getLocalPose(CSTRUCT CPxShape* cs);
CPxAPI CSTRUCT CPxFilterData CPxShape_getSimulationFilterData(CSTRUCT CPxShape* cs);
CPxAPI void CPxShape_setSimulationFilterData(CSTRUCT CPxShape* cs, CSTRUCT CPxFilterData* cfd);
#ifdef __cplusplus
}