hi,
the 2D facing of an object (on the X/Y plane) can be read via
addr1 = WoW.ReadInteger(curObj + 0x110);
facing = WoW.ReadFloat(addr1 + 0x1C);
but how to get the angle of the flight direction relative to the X/Y plane? (pitch)
thanks in advance![]()
hi,
the 2D facing of an object (on the X/Y plane) can be read via
addr1 = WoW.ReadInteger(curObj + 0x110);
facing = WoW.ReadFloat(addr1 + 0x1C);
but how to get the angle of the flight direction relative to the X/Y plane? (pitch)
thanks in advance![]()
Getting the "pitch" isn't as easy as a mere memory read, you'll have to calculate it yourself. (getting the angle between your object and the origin, easy trignometry)
You can either use sin(Z,3D distance) or cos(2D distance, 3D distance) or tan(Z, 2D distance)
You can use these formula's because the angle between (1) and (2) is 90°
Quick whipped up paint:
![]()
Last edited by Robske; 01-15-2009 at 02:36 PM.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
well, thanks for your reply. (gave you +rep)
but i'm already doing it that way.
- let the character fly
- get coordinates
- wait
- get coordinates
- calcuate position deltas and using that for getting the pitch
but i wondered if there is an easier way just by getting it through memory reading.
because models of other players are also displayed with pitch angle when they are flying.
the memory reading method doesnt require me to "differentiate" and gives me the correct angle without delay
Last edited by g3gg0; 01-15-2009 at 05:14 PM.
Such a value is not found in memory. I don't see how such a small calculation could cause any sort of delay.
well the calculation itself is nothing
i talk about caclucating a modified, delayed value - that requires a contoller (in means of control theory).
i read position, wait, read again, differentiate to get the angle and modify that angle. this changes my next position that is differentiated again.
what i now do is:
> read XYZ, delay, read XYZ, calculate angle, correct angle, wait
what i wanted to have:
> read angle, correct angle, wait
its obviously cleaner and faster to directly get the angle instead of calculating with measured values.
of course the other method works also - but its less clean imho.
Last edited by g3gg0; 01-15-2009 at 04:10 PM.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
just writing some offending lines doesnt help anyone.
- i thankfully gave +rep to Robske007a (the creator of the image) for his work
- i explained WHY i wanted to have the angle from WoW - not the one i calculated from movement
- wow definitely has the angle of the unit somewhere, how else would it be able to render units, players and objects that are not standing on a even surface or are flying upside down (pitchlimit)?
@Robske007a:
> but it sure isn't part of the player struct.
thanks again
yeah, i was afraid of that.
my next alternative would be to use the camera pitch, since when using
mouse-movement (rightclick and hold) the camera is bound to the players pitch.
but for now i will focus on some other code cleanup. hehe
After some poking around I've found 2 settings in WoW - keybinds: a key to increase your pitch and one to decrease your pitch. Pressing these buttons while flying would make you loop up/down.
Perhaps you should take a look at those functions to find your "current pitch" adress.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
I thought this was controlled by the camera angle offsets if i'm not mistaken, Kind of like an Xy / Zy rotation.
It's really early in the morning so don't hound me if I get you wrong, but are trying to make a flying bot?
@Robske007a:
ok thanks. but since i just have reverse engineered really few code, this would
take too much time then. but thx for figuring out.
@suicidity:
yeah, right. its already working fine.
It will be in the player structure, just not how you would have thought. Each object in WoW is rendered based on a Matrix. Inside of that matrix, is the Rotation/Location and Scale of an object.
If i get bored later on, i'll reverse it for you. You can easily find it for yourself however, in that you just need to get on a flying mount and scan for changing floats when you change your pitch. But, ensure you start the scan from your player base otherwise you will get values from the number of client-side local player data.
yeah, thanks
will try to figure out that address!
ok, got it. working perfectly now
thanks guys. the address was not very hard to find hehe....Code:addr1 = WoW.ReadInteger(curObj + 0x110); facing = WoW.ReadFloat(addr1 + 0x1C); pitch = WoW.ReadFloat(addr1 + 0x20);
Ah, i forgot all about that. Obj+0x100 is the CMovementData structure which contains the Pos,Etc.
It actually points to about Obj+0x7D0 which is where you guys read the position from.