Couple quick notes about my setup:
SDK: 188.8.131.52 (it’s the latest version currently hooked up to the engine I use)
Language: Python (wrapper for the c++ calls)
Ok that being said I seem to be having an issue with my NxController not applying any forces to the other objects in the world when I run into them, and they all seem to be fine when they bounce off each other. I make all their DominanceGroups set to 15 by default, and the controller to 0. All the other objects are having their mass set to 10. I’m using NxController::move to do my actual movement but I’ve also tried just applying forces and that doesn’t seem to affect it either. Any ideas what I might have setup wrong that would be causing it to not have the ‘push’ effect I’m looking for?
I don’t have time to write an elaborate reply, but to put it simple, you have to handle how the objects should react to the collision through a callback system for the controllers. You can give the objects force, ignore them, and give the other reactions through this system.
I am pretty sure the PhysX example of the controller for 2.8.4 uses this callback system and interacts differently with different shapes. I would urge you to look through the example code.
class ControllerHitReport : public NxUserControllerHitReport
virtual NxControllerAction onShapeHit(const NxControllerShapeHit& hit)
if(1 && hit.shape)
NxCollisionGroup group = hit.shape->getGroup();
NxActor& actor = hit.shape->getActor();
if ((gPts[gNbPts].x != hit.worldPos.x) || (gPts[gNbPts].y != hit.worldPos.y) || (gPts[gNbPts].z != hit.worldPos.z))
gPts[gNbPts++].x = hit.worldPos.x;
gPts[gNbPts++].y = hit.worldPos.y;
gPts[gNbPts++].z = hit.worldPos.z;
if (gNbPts==MAX_NB_PTS) gNbPts = 0;
// We only allow horizontal pushes. Vertical pushes when we stand on dynamic objects creates
// useless stress on the solver. It would be possible to enable/disable vertical pushes on
// particular objects, if the gameplay requires it.
NxF32 coeff = actor.getMass() * hit.length * 10.0f;
actor.[b][u]addForceAtLocalPos[/u][/b](hit.dir*coeff, NxVec3(0,0,0), NX_IMPULSE);
// actor.addForceAtPos(hit.dir*coeff, hit.controller->getPosition(), NX_IMPULSE);
// actor.addForceAtPos(hit.dir*coeff, hit.worldPos, NX_IMPULSE);
virtual NxControllerAction onControllerHit(const NxControllersHit& hit)