15 #include "physxControllerReport.h" 17 PStatCollector PhysxControllerReport::_pcollector(
"App:PhysX:Controller Reporting");
24 void PhysxControllerReport::
29 _shape_hit_cbobj = NULL;
30 _controller_hit_cbobj = NULL;
38 void PhysxControllerReport::
49 bool PhysxControllerReport::
60 NxControllerAction PhysxControllerReport::
61 onShapeHit(
const NxControllerShapeHit& hit ) {
64 return NX_ACTION_NONE;
69 if (_shape_hit_cbobj) {
72 _shape_hit_cbobj->do_callback(&cbdata);
77 NxActor& actor = hit.shape->getActor();
78 if (actor.isDynamic() && !actor.readBodyFlag(NX_BF_KINEMATIC)) {
79 if (hit.dir.z == 0.0f) {
80 NxF32 controllerMass = hit.controller->getActor()->getMass();
81 NxF32 coeff = actor.getMass() * hit.length * controllerMass;
82 actor.addForceAtLocalPos(hit.dir*coeff, NxVec3(0,0,0), NX_IMPULSE);
90 return NX_ACTION_NONE;
98 NxControllerAction PhysxControllerReport::
99 onControllerHit(
const NxControllersHit& hit) {
102 return NX_ACTION_NONE;
107 if (_controller_hit_cbobj) {
110 _controller_hit_cbobj->do_callback(&cbdata);
114 if (1 && hit.other) {
122 return NX_ACTION_NONE;
A lightweight class that represents a single element that may be timed and/or counted via stats...