[SOLVED] Actor::addForceAtLocalPos error in log

Night Elf

17-09-2007 21:28:30

I'm getting a lot of these in NxOgre.log:

PhysX Error (NXE_INVALID_PARAMETER) 'Actor::addForceAtLocalPos: Actor must be (non-kinematic) dynamic!' in line 394 of g:\scm\release\PhysX_2.7.2\novodex\SDKs\Physics\src\NpActor.cpp

I'm not calling Actor::addForceAtLocalPos(), though. Any ideas?

betajaen

17-09-2007 21:34:43

Are you using a character?

Night Elf

17-09-2007 21:39:14

Several.

betajaen

17-09-2007 23:16:20

I think it's the default response of the BaseCharacterHitReport, hitting a kinematic actor.

You could try this, NxOgreCharacterHitReport, around line 37 add:

if (!a->hasBodyFlag(NX_BF_KINEMATIC))
return RS_Push;


If it works, I'll leave it in NxOgre.

Night Elf

18-09-2007 17:07:21

No, that doesn't seem to work... The errors still appear on the log. Anything else I can try?

By the way, I made a couple of changes to my local copy of NxOgre that you may want to integrate:

In NxOgreContainer.h I changed empty() to:

void empty() {
items.clear()
}

It was items.empty() before, but the empty() function just returns a boolean (true if the container is empty), clear() actually empties it.

In NxOgreCharacterController.h I added this function:

void removeAllHitReports() {
mHitReports.EraseAll();
}

I tried to make it so that you could remove a particular hit report, but I run into trouble with the container definition... So I added this one which is useful enough for me.

betajaen

18-09-2007 18:16:31

No nothing I can think of. Can you temporarily remove the characters from the game, to see if it is the Character system doing it? Perhaps we can trace it down.

As for your fixes; Container already has that for some reason (I did some work ago on it, to make the template actually be exported across the DLL), perhaps I did it then.

removeAllHitReports will be added, and here is something for you.

void removeHitReport(CharacterHitReport* report) {
if (mHitReports.has(report))
mHitReports.remove(report);
}


Untested of course.

Night Elf

18-09-2007 19:07:10

I got it to work. The line should be like this, without the not (!):

if (a->hasBodyFlag(NX_BF_KINEMATIC))
return RS_Push;

betajaen

18-09-2007 19:52:45

Whoops. Well another bug squished in NxOgre.