Author |
Message |
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Angles and HFlipped
Angles are measured in radians, right?
So, half a circle would be 3.14 radians. 0 radians would be 3 o'clock, right? Then, if I kept adding 1.57 I'd get 6 o'clock, 9 o'clock and 12 o'clock until I got back to 0 radians or 3 o'clock position.
What the ♥♥♥♥ happens with the measuring of the angles when the sprite is HFlipped?
|
Sat Jan 21, 2012 12:07 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Angles and HFlipped
If I remember correctly, HFlipped is a graphical effect only, so the Angle value does not change. It would merely point to the "back" of the sprite instead of the "front".
It's been a while since I dealt with this stuff though. Probably better to just experiment.
|
Sat Jan 21, 2012 8:16 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Angles and HFlipped
Asklar wrote: So, half a circle would be 3.14 radians. Nope, a full circle is 3.14.
Last edited by Roast Veg on Sat Jan 21, 2012 4:49 pm, edited 1 time in total.
|
Sat Jan 21, 2012 4:02 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Angles and HFlipped
Wat, no, a full circle is 2pi, not pi. 6.28ish.
|
Sat Jan 21, 2012 4:47 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Angles and HFlipped
Oh.
Oops.
|
Sat Jan 21, 2012 4:49 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
Wait a minute.
If I have the 0 rad angle and add 1.57 it would be added counter-clockwise, right?
I'm having some flashbacks to my geometry class, and I think it was that way.
I've been measuring angles wrong.
Wait so, if HFlipped does nothing to the angles, I'm having a different problem. I'll try to check stuff out and then I'll post if I keep having the problem.
|
Sat Jan 21, 2012 5:31 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
I'm not sure, I've been doing the coding assuming that the HFlipped thingie didn't do anything to angles and everything works fine.
Except the attachables which doesn't HFlip with it's parent, maybe because I'm making them rotate.
What's wierd is that even if I make them HFlip when it's parent is HFlipped, they won't HFlip, but everything related to angles still work.
|
Sat Jan 21, 2012 7:08 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
Ok so, to set the angle of a turret, which is an attachable, I use a simple code to restrict it's aiming arc and make it aim changing it's RotAngle using self:GetController().AnalogAim.AbsRadAngle.
Now, when I HFlip the entire actor, the attachables won't HFlip, but they do rotate as they should, and the guns fire as they should. But they are not HFlipped.
So, I thought on HFlipping it when the actor is HFlipped, but still, it won't HFlip, and I don't get any kind of error.
Halp?
|
Sat Jan 21, 2012 8:30 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Angles and HFlipped
Have you tried transferring ownership?
|
Sun Jan 22, 2012 1:03 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
What's that? Transferring ownership?
I've only read about it in the wiki, but only things like "Ownership is NOT TRANSFERRED".
|
Sun Jan 22, 2012 7:26 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Angles and HFlipped
Basically it's when you can't quite access everything about an MO properly from outside a script attached to itself, so you use ToActor/ToAttachable etc.
|
Sun Jan 22, 2012 11:01 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
Aaahhhhh!
Let me try that.
|
Sun Jan 22, 2012 11:06 pm |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Angles and HFlipped
Hah, it worked, the sprite is HFlipped.
But, it keeps pointing in the opposite direction.
|
Sun Jan 22, 2012 11:15 pm |
|
|
|