Hey Thomas, no, I'd sure not want you to need to rewrite the engine! :)

However, you should simply be able to set your player's point of view so that 
the world is oriented the way you want. I.E. With OpenAL I can set my  
orientation so that Up is Z positive and ahead is Y positive just like you can 
in DirectX.

I'm actually totally aware of the heading system and I agree with you; I like 
it as well. -Am using it in a GPS app I'm coding so am using it in the real 
world in real time. -Working with GPS coords is just like working with a 
ginormous game grid! -Woohoo! fun fun! :)

In the game, you can call 'north' whatever you'd like, as you know. So my use 
of sine and cosine was just to eliminate the need to jump through all sorts of 
mental hoops and keep the code cleaner, but if you've got it all straight in 
your head, then by all means continue on. :) The updates I made to the code 
should still make a diff even if you switch back to using Z as you were, and 
switching sine and cosine back. As long as you've got your relative orientation 
the way you need it, then you should be fine. The getX and getZ functions 
should return just your movement vector with the little change I made to both, 
but you may need to change around your component vectors for your arc tan as 
you had them with the exception that your subtractions should still be in the 
same order as I'd modified them, as that can change the whole calculation, 
regardless of which axis you'd like to have as your 'north.' 

Anyway, I'm rapidly turning into Tada!Sleepy Girl! -The world's most somnolent 
superheroine! So I'll be off!… -My work here, is done for now! lol!

Have a lovely night and talk with you on the flippers!…

Smiles,

Cara :)
On Dec 11, 2010, at 7:40 PM, Thomas Ward wrote:

Hi Cara,

The GetX() and GetZ() functions simply calculates the vector for any
and all game objects moving in the game world. It doesn't actually
move any of them. They have their own functions to actually move them.
They juste use the functions to calculate the new vector.

As for reversing sine and cosine in this instants would totally break
the engine. The reason is I use 0 as do north, 90, as east, 180 as
south, and 270 degrees as west. Yes, I know this is totally not
standard, but there is a reason I do it that way rather than having 0
as do east etc.

Are you aware of the bearing system? Basically, if you ever were to
plot a course using a ship 000 would be do north, 090 would be do
east, 180 do south, and 270 do west. It is a system I've always liked
and feel most comfortable with so wrote my engine to orient using 000
as do north. If I switch that sine and cosine as you suggest orienting
000 as do east, which is what I think will happen here, everything and
anything will immediately blow up. We are talking rewriting the enemy
A.I. system, rewriting the walk/jump/run commands, rewriting the
targeting system, speak direction functions, etc. Basically, I might
as well trash the current engine and start over from scratch. As you
can see I'm not exactly enthused of reversing the sine and cosine in
this case unless you have a pretty convincing argument why I must do
so other than it is the accepted/standard way of doing things.

Smile.


On 12/11/10, Cara Quinn <caraqu...@draconisentertainment.com> wrote:
> Thomas;
> 
> I have a question for you. By removing the + in the getX and getY functions,
> I may have taken out a feature you wanted. Were you just wanting to
> calculate the new vector or actually change Mara's position with the two
> functions? If you simply want to calculate the new movement vector, then the
> changes I made are what you want. If you're wanting to also apply the new
> vector to Mara's current coordinates, then the += are what you want. Sorry
> if I misinterpreted. :)
> 
> The reversal of sine and cosine is still correct though, but I wanted to
> make sure I know what you're after and what code you're using for what. :)
> 
> I personally split up my code into less complex functions and combine them
> rather than placing a lot of  steps in one method. For example, I have one
> method to simply get the angle the player is facing and another method to
> set the angle. So naturally, these really basic functions get called in
> other methods in the course of doing more complex calculations.
> 
> Depending on what you want to do, you may not want to normalize as in my
> second note. Normalizing is good if you need to keep a particular vector but
> change its length. I.E. change velocity on a game object.
> 
> This brings up an interesting point, in that a vector is not a point. The
> player's position in space can be represented by a point, but their movement
> can be represented with a vector. A vector is in essence, a point's movement
> in a direction over time. the confusion can come because you can represent a
> vector as it's end point. So it's not always easy to tell what someone's
> code is meant to do in this regard. -Know what I mean?… If you project a
> vector on to a point, then you end up with the same vector but another end
> point. If you project a vector on to another vector, you have a third
> vector. -Confused yet?… lol!
> 
> Anyway, hope the changes to the code work well.
> 
> As a note, my use of X and Y is meant with a positive Z in the up direction.
> 
> Smiles,
> 
> Cara :)

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.


---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to