a moving trigger?

Hi, an issue i came across is that i can’t figure out how to create moving triggers.

npcList[f].attackBoxActor = mPhysics->createRigidDynamic(PxTransform(PxVec3(...));
npcList[f].attackBoxShape = npcList[f].attackBoxActor->createShape(PxBoxGeometry(PxVec3(...)), *mStaticMaterial);

npcList[f].attackBoxShape->setFlag(PxShapeFlag::eSIMULATION_SHAPE, false);
npcList[f].attackBoxShape->setFlag(PxShapeFlag::eTRIGGER_SHAPE, true);

tempFilterData.word0 = PhysicsFilterGroups::NP_TRIGGER;
tempFilterData.word1 = PhysicsFilterGroups::NP_PLAYER;
npcList[f].attackBoxShape->setSimulationFilterData(tempFilterData);
npcList[f].attackBoxShape->setQueryFilterData(tempFilterData);

npcList[f].attackBoxActor->userData = (void*)&npcList[f].attackBoxUserData;

mScene->addActor(*npcList[f].attackBoxActor);

If i just create RigidStatic with “(PxShapeFlag::eTRIGGER_SHAPE, true)”, it ignores setGlobalPose during simulation. if i make associated actor dynamic, gravity starts to affect it, obviously. But setGlobalPose doesnt. if i make associated actor also kinematic, it ignores setKinematicTarget(and also other objects collide with it at the start of simulation for a second or two for some reason). can someone enlighten me on that behavior?

the problem was the fact that when you pass PhysX a matrix, that has scaling factor != 1.0f, it just ignores it completely for some reason. not only it is not able to process them properly(which would be hell of a lot more convenient, it’s not the 1-st time i have that issue), it confuses programmer by just doing nothing when executing setGlobalPose\setKinematicTarget. is that even documented anywhere?

Rigid body only has orientation and position. Scale does not really applied to rigid bodies. If you notice most of the API doesn’t address scale. Scale is implicit in the geometry, i.e. If you want a object that is N times big, you have to scale the geometry accordingly and not depend on the transform for scaling.

well, i wasn’t trying to do that. my matrix had scaling component for other purpose. it should’ve just ignore scaling if it’s not able to use it. not ignore transform altogether which is just confusing. behaviour like that very likely to cause programmer into long debugging session trying to figure it out. not the best practice - is all i’m saying.

I agree. It wasn’t apparent to me from your post that you were referring to PhysX ignoring the entire transform. I interpreted your post as PhysX ignored the scaling component of the matrix. Now that you’ve clarified, that is indeed odd. I’ll try to run some test to see if I can replicate what your are seeing. Which version of the SDK are you using?

thanks, it’s 3.24, windows