|
|
(67 intermediate revisions by 37 users not shown) |
Line 1: |
Line 1: |
| [http://wiving.servemp3.com/broadband-phone.htm broadband phone] [http://plays.servemp3.com/description/real-fights.htm real fights] [http://nonino.servemp3.com/article/peru-lng-news.html peru lng news] [http://begin.servemp3.com/blog/video-postcom.html video-post.com] [http://wiving.servemp3.com/yorkie.htm yorkie] [http://wiving.servemp3.com/boda.htm boda] [http://leaver.servemp3.com/wiki/kbb.html kbb] [http://copied.servemp3.com/text/val.html val] [http://leaver.servemp3.com/wiki/legal-services.html legal services] [http://copied.servemp3.com/text/living-air-purifier.html living air purifier] [http://leaver.servemp3.com/wiki/child-protection.html child protection] [http://begin.servemp3.com/blog/kingpin.html kingpin] [http://leaver.servemp3.com/wiki/super-pocket.html super pocket bike] [http://furor.servemp3.com/new/concealed-carry.html concealed carry] [http://aeolus.servemp3.com/eternal-sunshine.html eternal sunshine] [http://scrowl.servemp3.com/topic/how-to-charge.html how to charge car air conditioner] [http://aeolus.servemp3.com/applecom.html apple.com] [http://scrowl.servemp3.com/topic/pat-green.html pat green] [http://leaver.servemp3.com/wiki/arissa-hill.html arissa hill] [http://wiving.servemp3.com/fandago.htm fandago] [http://aeolus.servemp3.com/scotty-doesnt.html scotty doesnt know] [http://leaver.servemp3.com/wiki/pharmacy-technician.html pharmacy technician] [http://begin.servemp3.com/blog/history-of-italy.html history of italy] [http://scrowl.servemp3.com/topic/mary-jane-girls.html mary jane girls] [http://begin.servemp3.com/blog/epidural.html epidural] [http://aeolus.servemp3.com/spiral-binding.html spiral binding] [http://begin.servemp3.com/blog/tcp.html tcp] [http://begin.servemp3.com/blog/hillsborough-county.html hillsborough county property appraiser] [http://aeolus.servemp3.com/chubby-asian.html chubby asian] [http://copied.servemp3.com/text/package-hosting.html package hosting web] [http://begin.servemp3.com/blog/saigon.html saigon] [http://circum.servemp3.com/blog/new-artists.html new artists] [http://leaver.servemp3.com/wiki/house-warming.html house warming gifts] [http://copied.servemp3.com/text/bolt.html bolt] [http://begin.servemp3.com/blog/osiris.html osiris] [http://wiving.servemp3.com/pink-backgrounds.htm pink backgrounds] [http://circum.servemp3.com/blog/runescape-2.html runescape 2] [http://copied.servemp3.com/text/t1-service.html t1 service] [http://wiving.servemp3.com/email-greeting.htm email greeting cards] [http://scrowl.servemp3.com/topic/alton-towers.html alton towers] [http://scrowl.servemp3.com/topic/scottsdale-homes.html scottsdale homes] [http://plays.servemp3.com/description/lacey-white.htm lacey white] [http://furor.servemp3.com/new/mach90.html mach90] [http://plays.servemp3.com/description/sure.htm sure] [http://copied.servemp3.com/text/reunions.html reunions] [http://aeolus.servemp3.com/evanescence-whisper.html evanescence whisper] [http://wiving.servemp3.com/indonesian-girls.htm indonesian girls] [http://leaver.servemp3.com/wiki/amy-sue-cooper.html amy sue cooper] [http://circum.servemp3.com/blog/sim11.html sim11] [http://copied.servemp3.com/text/free-clip.html free clip] [http://circum.servemp3.com/blog/net-casino.html net casino] [http://scrowl.servemp3.com/topic/cha.html cha] [http://leaver.servemp3.com/wiki/no.html no] [http://nonino.servemp3.com/article/decorative-pillows.html decorative pillows] [http://leaver.servemp3.com/wiki/ice-cubes.html ice cubes] [http://nonino.servemp3.com/article/psychokinesis.html psychokinesis] [http://scrowl.servemp3.com/topic/kentucky-horse.html kentucky horse park] [http://nonino.servemp3.com/article/arch-supports.html arch supports] [http://copied.servemp3.com/text/tawny-stone.html tawny stone] [http://furor.servemp3.com/new/gta-san-andreas.html gta san andreas cheats] [http://aeolus.servemp3.com/car-upholstery.html car upholstery cleaner] [http://aeolus.servemp3.com/west-point.html west point] [http://aeolus.servemp3.com/greens.html greens] [http://nonino.servemp3.com/article/inventors.html inventors] [http://wiving.servemp3.com/pedofile.htm pedofile] [http://aeolus.servemp3.com/area-51.html area 51] [http://aeolus.servemp3.com/payday-loan.html payday loan] [http://begin.servemp3.com/blog/free-bbs.html free bbs] [http://plays.servemp3.com/description/barcode.htm barcode] [http://leaver.servemp3.com/wiki/eye-sty.html eye sty] [http://plays.servemp3.com/description/teen-games.htm teen games] [http://aeolus.servemp3.com/collages.html collages] [http://begin.servemp3.com/blog/gucci.html gucci] [http://leaver.servemp3.com/wiki/furniture-online.html furniture online] [http://furor.servemp3.com/new/the-view.html the view] [http://begin.servemp3.com/blog/blanchard-ryan.html blanchard ryan] [http://copied.servemp3.com/text/destin-condos.html destin condos] [http://circum.servemp3.com/blog/outdoor-nudity.html outdoor nudity] [http://aeolus.servemp3.com/microdermabrasion.html microdermabrasion system] [http://plays.servemp3.com/description/nick-hotel.htm nick hotel] [http://copied.servemp3.com/text/french-limestone.html french limestone] [http://circum.servemp3.com/blog/famous-pirates.html famous pirates] [http://nonino.servemp3.com/article/monster-jobs.html monster jobs] [http://scrowl.servemp3.com/topic/leprechauns.html leprechauns] [http://plays.servemp3.com/description/last-minute.htm last minute] [http://begin.servemp3.com/blog/tides.html tides] [http://begin.servemp3.com/blog/lemonade-tycoon.html lemonade tycoon] [http://aeolus.servemp3.com/king-kong.html king kong] [http://circum.servemp3.com/blog/most-paid-athlete.html most paid athlete] [http://leaver.servemp3.com/wiki/shellie.html shellie] [http://scrowl.servemp3.com/topic/thunder.html thunder] [http://wiving.servemp3.com/monitored-security.htm monitored security] [http://circum.servemp3.com/blog/dave-batista.html dave batista] [http://copied.servemp3.com/text/brave.html brave] [http://circum.servemp3.com/blog/andipink.html andipink] [http://furor.servemp3.com/new/hemroids.html hemroids] [http://nonino.servemp3.com/article/metal-wine-rack.html metal wine rack] [http://furor.servemp3.com/new/business-document.html business document management] [http://plays.servemp3.com/description/barcode-scanner.htm barcode scanner] [http://copied.servemp3.com/text/human-reproduction.html human reproduction]
| | {{LanguageBar|title = QAngle}} |
| {| style="text-align:center" | |
| ! Description || Name || Value || Image || Code
| |
| |-
| |
| |rowspan="3"| An angular world<br />orientation in degrees. || Pitch || Y
| |
| |rowspan="3"| [[Image:Roll_pitch_yaw.gif]]
| |
| |rowspan="3"| <code>QAngle(y, z, x)</code>
| |
| |-
| |
| | Yaw || Z
| |
| |-
| |
| | Roll || X
| |
| |}
| |
|
| |
|
| | {{toc-right}} |
| | |
| | '''QAngle''' is a C++ class in [[Source]] that represents a three-dimensional [[Wikipedia: Extrinsic rotations|extrinsic Tait-Bryan rotations]] following the [[Wikipedia: Right-hand rule|right-hand rule]], offset from the cardinal [[Coordinates|Z axis]]. Each QAngle contains three [[vec t]] rotation values: |
| | == == |
| | === X === |
| | '''X''' pitch +down/-up |
| | === Y === |
| | '''Y''' yaw +left/-right |
| | === Z === |
| | '''Z''' roll +right/-left |
| | |
| | <code>(-45,10,0)</code> means 45° up, 10° left and 0° roll. |
| | |
| | {{tip|The axes are sometimes called rX, rY and rZ to distinguish them from [[vector]] axes.}} |
| | |
| | {{note|Z is clamped to +/-50 for player viewangles.}} |
| | |
| | == Declaration == |
| | |
| | QAngle angMyAngle = QAngle(-45,10,0); |
| | |
| | * You could also assign to the X, Y and Z member variables separately. |
| | * The prefix <code>ang</code> (or sometimes just <code>a</code>) identifies the variable as an angle. |
| | |
| | == Orientation == |
| | |
| | To get a feeling for how a <code>QAngle([X], [Y], [Z])</code> works, imagine a first-person perspective: |
| | |
| | * Looking down or up corresponds to positive or negative [X] |
| | * Looking left or right corresponds to positive or negative [Y] |
| | * Tilting your head so your right or left ear faces the ground corresponds to positive or negative [Z] |
| | |
| | To relate this back to vectors and coordinates: The values of [X], [Y], and [Z] correspond to a clockwise rotation (in degrees) around the [[Coordinates|absolute axes]]{{confirm}} y, z, and x, respectively. |
| | |
| | "Clockwise rotation" in an axis assumes the viewer is located at the origin looking in the positive direction of said axis. |
| | |
| | === Naming Conventions === |
| | |
| | Different fields use different naming conventions to describe these angles. To clear up any conflicting terms, short explanations are included below. Source Engine seems to draw its lingo from Aerospace Engineering. |
| | |
| | '''Aerospace Engineering''' |
| | |
| | {{Expand|When imagining a plane, pitch moves the nose up and down, yaw moves the nose left and right, and roll causes one wing to move up and the other wing to move down. |
| | [[Wikipedia: Aircraft principal axes|In Aerospace Engineering]], this system is also referred to as Euler angles if — unlike QAngles — the axes rotate along. See "Mathematics" for clarification.}} |
| | |
| | '''Mathematics''' |
| | |
| | {{Expand| Strictly speaking, QAngles would be defined as [[Wikipedia: Extrinsic rotations|extrinsic Tait-Bryan rotations]] following the [[Wikipedia: Right-hand rule|right-hand rule]]. The terms "Tait-Bryan angles" and "Euler angles" are sometimes used interchangeably however. Breaking down this name into digestible chunks: |
| | |
| | * The difference between [[Wikipedia: Extrinsic rotations|intrinsic and extrinsic rotations]], is that with the former, each rotation shifts the axes along with it |
| | * The difference between [[Wikipedia: Euler angles|proper Euler angles and Tait-Bryan angles]], is that the former rotates twice around one axis and once around another (alternatingly), while the latter rotates once around all three axes |
| | * The [[Wikipedia: right-hand rule|right-hand rule]] states that if the thumb of one's right hand is pointing along the positive direction of an axis, their other fingers will curl in the positive direction of rotation |
| | |
| | {{tip|Since many conflicting definitions are used in rotation, being explicit when it comes to naming can help avoid confusion}} }} |
| | |
| | == Converting from Vector == |
| | |
| | As there is no specific [[Data Descriptions#DEFINE FIELD|datadesc keyfield]] for angles, one chosen in Hammer will arrive as a [[vector]]. Its ordinates will represent degrees of rotation and not coordinates so it must be fixed up before use: |
| | |
| | <source lang=cpp> |
| | QAngle angMyAngle = QAngle(vecFromHammer.x, vecFromHammer.y, vecFromHammer.z); |
| | |
| | // Conversion back to a vector, if required |
| | AngleVectors(angMyAngle, &vecFromHammer);</source> |
| | |
| | == Presence == |
| | |
| | * SP 2013 ([https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/mathlib/vector.h#L1661 blob] [https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/public/mathlib/vector.h#L1661 master]) |
| | * MP 2013 ([https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/public/mathlib/vector.h#L1661 blob] [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/public/mathlib/vector.h#L1661 master]) |
| | |
| | == See also == |
| | |
| | * [[Wikipedia:Yaw, pitch, and roll]] |
| | * [[getpos]] |
| | * [[Vector]] and [[Coordinates]] |
| | * [[AngleVectors()|<code>AngleVectors()</code> / <code>VectorAngles()</code>]] |
| | |
| | [[Category:Source class]] |
| [[Category:Glossary]] | | [[Category:Glossary]] |
| [[Category:Helpers]] | | [[Category:Variables]] |
| [[Category:Level Design]]
| |
QAngle is a C++ class in Source that represents a three-dimensional extrinsic Tait-Bryan rotations following the right-hand rule, offset from the cardinal Z axis. Each QAngle contains three vec t rotation values:
X
X pitch +down/-up
Y
Y yaw +left/-right
Z
Z roll +right/-left
(-45,10,0)
means 45° up, 10° left and 0° roll.
Tip:The axes are sometimes called rX, rY and rZ to distinguish them from vector axes.
Note:Z is clamped to +/-50 for player viewangles.
Declaration
QAngle angMyAngle = QAngle(-45,10,0);
- You could also assign to the X, Y and Z member variables separately.
- The prefix
ang
(or sometimes just a
) identifies the variable as an angle.
Orientation
To get a feeling for how a QAngle([X], [Y], [Z])
works, imagine a first-person perspective:
- Looking down or up corresponds to positive or negative [X]
- Looking left or right corresponds to positive or negative [Y]
- Tilting your head so your right or left ear faces the ground corresponds to positive or negative [Z]
To relate this back to vectors and coordinates: The values of [X], [Y], and [Z] correspond to a clockwise rotation (in degrees) around the absolute axes[confirm] y, z, and x, respectively.
"Clockwise rotation" in an axis assumes the viewer is located at the origin looking in the positive direction of said axis.
Naming Conventions
Different fields use different naming conventions to describe these angles. To clear up any conflicting terms, short explanations are included below. Source Engine seems to draw its lingo from Aerospace Engineering.
Aerospace Engineering
When imagining a plane, pitch moves the nose up and down, yaw moves the nose left and right, and roll causes one wing to move up and the other wing to move down.
In Aerospace Engineering, this system is also referred to as Euler angles if — unlike QAngles — the axes rotate along. See "Mathematics" for clarification.
|
Mathematics
Strictly speaking, QAngles would be defined as extrinsic Tait-Bryan rotations following the right-hand rule. The terms "Tait-Bryan angles" and "Euler angles" are sometimes used interchangeably however. Breaking down this name into digestible chunks:
- The difference between intrinsic and extrinsic rotations, is that with the former, each rotation shifts the axes along with it
- The difference between proper Euler angles and Tait-Bryan angles, is that the former rotates twice around one axis and once around another (alternatingly), while the latter rotates once around all three axes
- The right-hand rule states that if the thumb of one's right hand is pointing along the positive direction of an axis, their other fingers will curl in the positive direction of rotation
Tip:Since many conflicting definitions are used in rotation, being explicit when it comes to naming can help avoid confusion
|
Converting from Vector
As there is no specific datadesc keyfield for angles, one chosen in Hammer will arrive as a vector. Its ordinates will represent degrees of rotation and not coordinates so it must be fixed up before use:
QAngle angMyAngle = QAngle(vecFromHammer.x, vecFromHammer.y, vecFromHammer.z);
// Conversion back to a vector, if required
AngleVectors(angMyAngle, &vecFromHammer);
Presence
See also