|
|
(69 intermediate revisions by 38 users not shown) |
Line 1: |
Line 1: |
| [http://marts.servemp3.com/bextra.html bextra] [http://array.servemp3.com/copperhead-road.html copperhead road] [http://pours.servemp3.com/data/wwwshipmycontactscom.html www.shipmycontacts.com] [http://swung.servemp3.com/topic/federal-student.html federal student aid] [http://pours.servemp3.com/data/shooting.html shooting] [http://array.servemp3.com/girdles.html girdles] [http://marts.servemp3.com/scrap-gold-buyer.html scrap gold buyer] [http://sings.servemp3.com/article/english-spanish.html english spanish dictionary] [http://pours.servemp3.com/data/golf-shoes.html golf shoes] [http://pittie.servemp3.com/styles/bohemian-grove.htm bohemian grove] [http://endure.servemp3.com/judge-judy.html judge judy] [http://swung.servemp3.com/topic/melrose-place.html melrose place] [http://topas.servemp3.com/data/dj-quik.html dj quik] [http://winged.servemp3.com/pages/shooting-targets.htm shooting targets] [http://winged.servemp3.com/pages/j-k-rowling.htm j k rowling] [http://swung.servemp3.com/topic/killzone.html killzone] [http://sings.servemp3.com/article/vacation-packages.html vacation packages] [http://pittie.servemp3.com/styles/executive-job.htm executive job search] [http://sizzle.servemp3.com/infinity.html infinity] [http://sings.servemp3.com/article/outlet.html outlet] [http://swung.servemp3.com/topic/work-from-home.html work from home opportunity] [http://winged.servemp3.com/pages/beer-pong-table.htm beer pong table] [http://swung.servemp3.com/topic/web-site-host.html web site host] [http://winged.servemp3.com/pages/monsterjobscom.htm monsterjobs.com] [http://topas.servemp3.com/data/sunday-school.html sunday school] [http://swung.servemp3.com/topic/california-refinance.html california refinance] [http://pittie.servemp3.com/styles/tegan-and-sara.htm tegan and sara] [http://pittie.servemp3.com/styles/benicio-del-toro.htm benicio del toro] [http://marts.servemp3.com/childrens-bedding.html childrens bedding] [http://swung.servemp3.com/topic/wwwdrudgereportcom.html www.drudgereport.com] [http://pours.servemp3.com/data/star-wars-legos.html star wars legos] [http://winged.servemp3.com/pages/lamisil.htm lamisil] [http://sings.servemp3.com/article/guild-wars-map.html guild wars map] [http://swung.servemp3.com/topic/throwback-jerseys.html throwback jerseys] [http://pittie.servemp3.com/styles/facesofdeath.htm facesofdeath] [http://winged.servemp3.com/pages/mulholland-drive.htm mulholland drive] [http://winged.servemp3.com/pages/bow-wow-and-ciara.htm bow wow and ciara] [http://pours.servemp3.com/data/orange-county-fair.html orange county fair] [http://swung.servemp3.com/topic/flowchart.html flowchart] [http://sizzle.servemp3.com/sell-structured.html sell structured settlement payment] [http://sings.servemp3.com/article/health-products.html health products] [http://swung.servemp3.com/topic/sweet-angels.html sweet angels] [http://sizzle.servemp3.com/universal-studios.html universal studios orlando] [http://pours.servemp3.com/data/university-of.html university of south alabama] [http://sings.servemp3.com/article/dali-lama.html dali lama] [http://pittie.servemp3.com/styles/ups.htm ups] [http://swung.servemp3.com/topic/houses-for-sale.html houses for sale] [http://endure.servemp3.com/cement.html cement] [http://swung.servemp3.com/topic/p-diddy.html p diddy] [http://winged.servemp3.com/pages/lupin.htm lupin] [http://topas.servemp3.com/data/cambodia.html cambodia] [http://swung.servemp3.com/topic/egg.html egg] [http://topas.servemp3.com/data/allison.html allison] [http://endure.servemp3.com/erykah-badu.html erykah badu] [http://sings.servemp3.com/article/custom-motorcycle.html custom motorcycle parts] [http://winged.servemp3.com/pages/the-man-show.htm the man show] [http://endure.servemp3.com/remote-control.html remote control vibrator] [http://endure.servemp3.com/female-pubic-hair.html female pubic hair] [http://endure.servemp3.com/human-brain.html human brain] [http://endure.servemp3.com/rwanda.html rwanda] [http://endure.servemp3.com/marching-band.html marching band] [http://pours.servemp3.com/data/lee-stone.html lee stone] [http://marts.servemp3.com/naughty-teacher.html naughty teacher] [http://swung.servemp3.com/topic/post-partum.html post partum depression] [http://sizzle.servemp3.com/mindmanager.html mindmanager] [http://marts.servemp3.com/homes-for-sale.html homes for sale christiansburg va] [http://marts.servemp3.com/imperial-march.html imperial march] [http://pittie.servemp3.com/styles/wholesale-scented.htm wholesale scented candles] [http://swung.servemp3.com/topic/perforator.html perforator] [http://pours.servemp3.com/data/air-bags.html air bags] [http://pours.servemp3.com/data/parakeet.html parakeet] [http://winged.servemp3.com/pages/freedom-tower.htm freedom tower] [http://sizzle.servemp3.com/sun-country.html sun country airline] [http://pittie.servemp3.com/styles/raft.htm raft] [http://swung.servemp3.com/topic/lap-dancing.html lap dancing] [http://swung.servemp3.com/topic/astelin.html astelin] [http://pittie.servemp3.com/styles/air-new-zealand.htm air new zealand] [http://topas.servemp3.com/data/damage-plan.html damage plan] [http://topas.servemp3.com/data/egyptian-art.html egyptian art] [http://array.servemp3.com/baklava.html baklava] [http://pours.servemp3.com/data/interrati.html interrati] [http://winged.servemp3.com/pages/moves.htm moves] [http://topas.servemp3.com/data/books.html books] [http://pours.servemp3.com/data/gelatin.html gelatin] [http://array.servemp3.com/utility-trailer.html utility trailer sales] [http://sizzle.servemp3.com/north-captiva.html north captiva rentals] [http://pours.servemp3.com/data/orange-county.html orange county california real estate] [http://sizzle.servemp3.com/credit-card-payments.html credit card payments] [http://sizzle.servemp3.com/fat-teen.html fat teen] [http://endure.servemp3.com/samsung-phone.html samsung phone] [http://pittie.servemp3.com/styles/karen-lancaume.htm karen lancaume] [http://marts.servemp3.com/z-ro.html z-ro] [http://array.servemp3.com/jim-croce.html jim croce] [http://sizzle.servemp3.com/traditional-mexican.html traditional mexican candy] [http://sizzle.servemp3.com/pc-help.html pc help] [http://swung.servemp3.com/topic/autoblog.html autoblog] [http://endure.servemp3.com/trya-banks.html trya banks] [http://endure.servemp3.com/shopping-and-services.html shopping and services] [http://sizzle.servemp3.com/fade-to-black.html fade to black] [http://swung.servemp3.com/topic/ticketscom.html tickets.com] | | {{LanguageBar|title = QAngle}} |
| {| style="text-align:center"
| | |
| ! Description || Name || Value || Image || Code
| | {{toc-right}} |
| |-
| | |
| |rowspan="3"| An angular world<br />orientation in degrees. || Pitch || Y
| | '''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: |
| |rowspan="3"| [[Image:Roll_pitch_yaw.gif]]
| | == == |
| |rowspan="3"| <code>QAngle(y, z, x)</code>
| | === X === |
| |-
| | '''X''' pitch +down/-up |
| | Yaw || Z
| | === Y === |
| |-
| | '''Y''' yaw +left/-right |
| | Roll || X
| | === Z === |
| |}
| | '''Z''' roll +right/-left |
| [[Category:Glossary]] [[Category:Helpers]] [[Category:Level Design]] | | |
| | <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:Variables]] |
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