Relative Motion in Ogre3d

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
DigitalGhost
Halfling
Posts: 62
Joined: Mon Feb 07, 2005 9:47 pm

Relative Motion in Ogre3d

Post by DigitalGhost »

Hey, I am new to ogre3d and I was wondering the easiest way to pull this off:

I want to make a very simple fighting game similar to Soul Caliber II. So, I want to have two models, and both of them move relative to the other one. So, if you hit left, your avatar will circle the enemy and vice versa.

It's possible to do this one-way by making one object the child of the other. The problem is that do to this both ways (IE, both avatars move relative ot ecah othre) would make circular children.

What's the easiest way to handle this?
User avatar
PeterNewman
Greenskin
Posts: 128
Joined: Mon Jun 21, 2004 2:34 am
Location: Victoria, Australia
Contact:

Post by PeterNewman »

I'm guessing your going to have to do a bit of maths. Make each node the child of a common parent (or the root), and when your user hits left, get the vector from the other players character to the players character, rotate the vector appropriately, then use that as your movement (target).
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

What about doing what it's supposed to do? Side step. Just move some units "in the direction of the camera" (towards the camera or not). As you move and update the position of the camera, the movement will be kind of circular (actually you'll move backwards slowly, but fixing that is as simple as advancing some units)
Image
DigitalGhost
Halfling
Posts: 62
Joined: Mon Feb 07, 2005 9:47 pm

Post by DigitalGhost »

Got it, thanks =)
Post Reply