Background character rotation

HookerBoots

18-01-2011 00:12:37

Hi everyone,

I have been working with Ogre for a while now, but just moved onto the physics side of my development. I have got the 1.7 terrain working with heightfields, collision detection working, but the one thing, I cannot figure out, is how to change the rotation of the background character. I've searched the forums, looked at the documentation, but I cannot seem to find out what I am missing.

I figured it would be in the helper class "Critter::CharacterInputHelper" but from what I can tell, it doesn't deal with the rotation of your character. Nor is there anything that I can find in the "Critter::BackgroundCharacter" class. This leaves the "NxOgre::Actor" class, but unfortunately I am still unfamiliar with all of it thus-far.

My goal, change the rotation of the character based on mouse movement. (360 rotation obviously). Also, yes, I know the plans for background character's to be used with NPC's, and I fully intend to use them for that when I have all this figured out and the player controlled class is completed by Master B.

Anyways, if anyone has a solution to this, it would be greatly appreciated. Thanks in advance!


Cheers!

*EDIT*
I'm using the latest NxOgre / Critter from github. Unless new commits were made in the last 12 hours.... (from this post)
*END EDIT*

deshan

18-01-2011 03:19:58

Hello HookerBoots,

Faced the same problem.

But if you looked into physx sdk sample code, there is no such thing for rotation (at least i didn't found).

If you need to set the direction of cc to current camera direction you could do this by changing x,z values of the displacement vector.
function
move(displacement)

for this you need to modify input and helper class.

~deshan

HookerBoots

18-01-2011 03:59:37

Thanks for the info, guess I have to do some more reading. I figured there might be a way to do it since both physx and nxogre are both large libraries. And there probably is, just not something that I can pinpoint. Guess its back to the drawing board for my character controlling / AI design.

Thanks again, and when/if I find a simple method to do this, I'll be sure to post it.

Cheers.

betajaen

18-01-2011 08:59:18

I haven't worked in rotation yet, most likely that will be done via the Input classes.

But if your going to use the "move" function directly, then you may as well just not use the BackgroundAnimatedCharacter and just make your own.

deshan

18-01-2011 09:51:47

Not to highjack someone else thread, but to clarify.

Betajaen could you please put some word about the difference between BackgroundCharacter and BackgroundAnimatedCharacter?

Thanks

~deshan

betajaen

18-01-2011 12:00:50

There is no BackgroundCharacter class.

The Background part was my original idea of having two types Animated Characters. One for NPCs (Background) and one for the Player (Leading), but since the BackgroundAnimatedCharacter is pretty good. It's probably for the best to rename it to AnimatedCharacter.

HookerBoots

18-01-2011 13:29:49

So betajaen, I take from what you said as your going to add rotation to the input class for background characters. So would it be safe to assume that, that is one of the many things planned for buggyswires? Or is this planned for post buggyswires? Just asking because I'm going to leave the character control aspect alone right now and work on other features until this rotation thing can get sorted out. Just trying to build a picture as to how long that'll be! Haha!

*EDIT*
Oh yeah, you said there is no BackgroundCharacter class, and just BackgroundAnimatedCharacter, I assume it is safe to say that, if that is so, it hasn't made it to the github yet, as I cannot find the BackgroundAnimatedCharacter class.
*END EDIT*

Anyways, great job on this, and look forward to seeing whats to come :)


Cheers!

betajaen

18-01-2011 15:20:53

Everything to do with the CC will be completed within the BuggySwires version. The whole reason why BuggySwires exists is due to the Character Controller.

HookerBoots

18-01-2011 16:00:40

Awesome! Thats great to hear, it gives me much hope for the future! I look forward to future releases!

Cheers, and thanks for the reply!