mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Simulation filtering
This commit is contained in:
26
pgo/physx-c/CPxFilterData.h
Executable file
26
pgo/physx-c/CPxFilterData.h
Executable 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
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user