-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPxRigidActor.cpp
More file actions
executable file
·31 lines (26 loc) · 1001 Bytes
/
CPxRigidActor.cpp
File metadata and controls
executable file
·31 lines (26 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <PxPhysicsAPI.h>
#include "CPxRigidActor.h"
#include "CPxDefaultAllocator.h"
void CPxRigidActor_setSimFilterData(CPxRigidActor cra, CPxFilterData cfd)
{
physx::PxRigidActor* actor = static_cast<physx::PxRigidActor*>(cra.obj);
const physx::PxU32 numShapes = actor->getNbShapes();
physx::PxShape** shapes = (physx::PxShape**)CPxAlloc(sizeof(physx::PxShape*) * numShapes);
actor->getShapes(shapes, numShapes);
physx::PxFilterData filterData(cfd.word0, cfd.word1, cfd.word2, cfd.word3);
for (physx::PxU32 i = 0; i < numShapes; i++)
{
shapes[i]->setSimulationFilterData(filterData);
}
CPxDealloc(shapes);
}
void CPxRigidActor_set_userData(CSTRUCT CPxRigidActor cra, void* userData)
{
physx::PxRigidActor* actor = static_cast<physx::PxRigidActor*>(cra.obj);
actor->userData = userData;
}
void* CPxRigidActor_get_userData(CSTRUCT CPxRigidActor cra)
{
physx::PxRigidActor* actor = static_cast<physx::PxRigidActor*>(cra.obj);
return actor->userData;
}