5/23/2012
VIRTUAL REALITY | JAEGER & ZGTR & HASSNOV & POD
2102
‫اهلل‬ ‫عبد‬ ‫أبو‬ ‫إسماعيل‬‫شاكر‬ ‫محمد‬
‫سرحان‬ ‫حسه‬ ‫مح...
STYX Physics Engine with Augmented Reality
STYX Team Page 1
‫اىفهشط‬
1.‫مقدمة‬‫المشروع‬......................................
STYX Physics Engine with Augmented Reality
STYX Team Page 2
1.6.1.1.‫السرعة‬‫الزاوٌة‬........................................
STYX Physics Engine with Augmented Reality
STYX Team Page 3
3.6.1.2.‫شعاع‬‫الدفع‬ً‫الخط‬Linear Impulse.......................
STYX Physics Engine with Augmented Reality
STYX Team Page 4
3.1.1.‫القوى‬‫الموئرة‬‫على‬‫النوابض‬‫المترابطة‬..................
STYX Physics Engine with Augmented Reality
STYX Team Page 5
5.‫الواقع‬‫المزاد‬...............................................
STYX Physics Engine with Augmented Reality
STYX Team Page 6
STYX Physics Engine with Augmented Reality
STYX Team Page 7
‫األول‬ ‫الفصل‬
‫المشروع‬ ‫مقدمة‬
STYX Physics Engine with Augmented Reality
STYX Team Page 8
1.‫اىَششوع‬ ‫ٍقذٍخ‬
‫تَهُذ‬Abstract
‫ص‬ ‫ثٌذسثعز‬ ٖ‫٘ز‬َ‫ثٌظذ‬...
STYX Physics Engine with Augmented Reality
STYX Team Page 9
1.1.‫ٍفتبحُخ‬ ‫ميَبد‬
Collision Detection, Collision Resolutio...
STYX Physics Engine with Augmented Reality
STYX Team Page 10
‫الفصل‬‫الثاني‬
‫الصلبة‬ ‫األجسام‬ ‫حركة‬
STYX Physics Engine with Augmented Reality
STYX Team Page 11
1.‫اى‬ُِّ‫قىا‬ٍ‫ف‬ ‫األعبعُخ‬‫اىحشمخ‬Laws of Motion
1.1.‫ٍقذٍ...
STYX Physics Engine with Augmented Reality
STYX Team Page 12
1.2.‫اىتحشَل‬ ٍ‫ف‬ ‫األعبعُخ‬ ‫اىؼالقخ‬Newton’s Law
:‫ثٌضقش٠ه...
STYX Physics Engine with Augmented Reality
STYX Team Page 13
.ٜ‫ثألخش‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ؽّ١غ‬ ٍٝ‫ػ‬ ‫ثٌّمذثس‬ ‫دٕفظ‬ ‫ثٔغقج...
STYX Physics Engine with Augmented Reality
STYX Team Page 14
ٞٚ‫ثٌضث‬ ‫ثٌّٛلغ‬
1.4.1.ُ‫اىذوسا‬ ‫تَثُو‬Rotation
‫صثٚ٠ز‬ ‫دّ...
STYX Physics Engine with Augmented Reality
STYX Team Page 15
1.5.ً‫األجغب‬ ً‫ػي‬ ‫اىَإثشح‬ ‫اىخبسجُخ‬ ‫اىقىي‬
1.5.1.‫اىثقو...
STYX Physics Engine with Augmented Reality
STYX Team Page 16
1.6.1.)‫االّغحبثُخ‬ ‫(اىحشمخ‬ ٌ‫اىجغ‬ ‫ٍؼيىٍبد‬ ‫تحذَث‬
1.6.1...
STYX Physics Engine with Augmented Reality
STYX Team Page 17
1.6.1.1.ٌ‫اىضاو‬ ‫اىتغبسع‬
ٞٚ‫ثٌضث‬ ‫ثٌضغجسع‬ ‫ٔظش٠ز‬ ِٓ‫ٌذ٠ٕ...
STYX Physics Engine with Augmented Reality
STYX Team Page 18
ٟ‫ف‬ ُ‫ثٌؾغ‬ ‫ِٛػغ‬ ٍٝ‫ػ‬ ‫ؽش٠مٙج‬ ٓ‫ػ‬ ً‫ٌٕقظ‬ ُ‫ٌٍؾغ‬ ‫ثٌؾذ...
STYX Physics Engine with Augmented Reality
STYX Team Page 19
‫الثالث‬ ‫الفصل‬
‫محرك‬‫الصدم‬
Collision Engine
STYX Physics Engine with Augmented Reality
STYX Team Page 20
1.‫ٍحشك‬ً‫اىصذ‬
1.1.‫أّىاع‬ً‫اىصذ‬Collision Types
‫الرئٌسٌٌن‬...
STYX Physics Engine with Augmented Reality
STYX Team Page 21
.‫التماس‬ ‫لنقاط‬ ‫المختلفة‬ ‫األنواع‬ ً‫التال‬ ‫المخطط‬ ‫ٌبٌ...
STYX Physics Engine with Augmented Reality
STYX Team Page 22
1.1.‫اىتَبط‬ ‫ثُْخ‬Contact Data
‫بحاجة‬ ‫فنحن‬ ‫تماس‬ ‫نقطة‬ ...
STYX Physics Engine with Augmented Reality
STYX Team Page 23
3.‫التداخل‬ ‫عمق‬Penetration Depth
‫ناظم‬ ‫بها‬ ‫ٌمر‬ ً‫الت‬ ...
STYX Physics Engine with Augmented Reality
STYX Team Page 24
1.2.1.‫حبفخ‬ ‫ّىع‬ ٍِ ‫تالٍظ‬–‫حبفخ‬Edge-Edge Contact
‫ثٌضظجد...
STYX Physics Engine with Augmented Reality
STYX Team Page 25
1.2.2.‫وجه‬ ‫ّىع‬ ٍِ ‫تالٍظ‬–‫وجه‬Face-Face Contact
‫ثٌض‬‫ّجط...
STYX Physics Engine with Augmented Reality
STYX Team Page 26
1.3.ً‫اىصذ‬ ‫مشف‬Collision Detection
‫ادم‬‫ا‬‫الص‬ ‫اف‬‫ا‬‫كش...
STYX Physics Engine with Augmented Reality
STYX Team Page 27
1.3.1.‫مش‬ ً‫تصبد‬ُِ‫ت‬Colliding Spheres
ْ‫وشصج‬ ‫صؼضذش‬.‫لطش...
STYX Physics Engine with Augmented Reality
STYX Team Page 28
:ً‫دجٌشى‬ ‫ثٌخٛثسصِ١ز‬ ْٛ‫صى‬ ٌٟ‫ٚدجٌضج‬
1.3.1.ً‫تصبد‬‫ٍنؼت‬–...
STYX Physics Engine with Augmented Reality
STYX Team Page 29
1.3.2.‫مشح‬ ً‫اصطذا‬-‫ٍنؼت‬Colliding a Sphere and a Box
ْ‫أ‬ ...
STYX Physics Engine with Augmented Reality
STYX Team Page 30
1.3.3.ً‫تصبد‬‫ٍنؼت‬-‫ٍنؼت‬Colliding two boxes
‫ثٌٕٛع‬ ‫٘زث‬ ‫...
STYX Physics Engine with Augmented Reality
STYX Team Page 31
ً‫ج‬١ٍّ‫ػ‬ِ ‫ثٌضظجدِجس‬‫(ٔمطز‬ ‫ٔٛع‬ ٓ–)‫ٔمطز‬‫(ٔمطز‬ ‫ٔٛع‬ ٓ...
STYX Physics Engine with Augmented Reality
STYX Team Page 32
1.3.4.‫اىتَبط‬ ‫ّقبغ‬ ‫حغبة‬ ٍ‫ف‬ ‫اىَغبػذح‬ ‫اىخىاسصٍُبد‬ً‫ا...
STYX Physics Engine with Augmented Reality
STYX Team Page 33
‫ٍغ‬ ‫ٍغتطُو‬ ً‫تصبد‬‫آخش‬ ‫ٍغتطُو‬
ٟ‫ف‬ ‫دل١ك‬ ‫فقض‬ ٌٝ‫إ‬ ...
STYX Physics Engine with Augmented Reality
STYX Team Page 34
ٌٟٛ‫ثٌط‬ ٓ٠‫دجٌّقٛس‬ ‫ثٌّضّغٍز‬ ‫ثألسدؼز‬ ‫ثٌّقجٚس‬ ٍٝ‫ػ‬ ‫ٌإ...
STYX Physics Engine with Augmented Reality
STYX Team Page 35
‫حبفخ‬ ‫ّىع‬ ٍِ ‫اىتَبط‬-‫حبفخ‬Edge-Edge
‫فجف‬ ً‫و‬ ‫أخز‬ ٌٝ...
STYX Physics Engine with Augmented Reality
STYX Team Page 36
1.4.ً‫اىصذ‬ ‫ٍؼبىجخ‬Collision Resolution
.‫الصدم‬ ‫معالجة‬ ‫ا...
STYX Physics Engine with Augmented Reality
STYX Team Page 37
:ٌٟ‫ج‬‫ثٌض‬ ْٛٔ‫ثٌمج‬ ِٓ ٞٚ‫ثٌضث‬ ‫ثٌذفغ‬ ٚ
.ٓ١ّ‫ثٌؾغ‬ ٓ١‫د‬ ...
STYX Physics Engine with Augmented Reality
STYX Team Page 38
:‫بالشكل‬ ‫فٌكون‬ ‫مادٌة‬ ‫جملة‬ ‫حالة‬ ً‫ف‬ ‫أما‬
⃗ ⃗
:‫حٌث‬...
STYX Physics Engine with Augmented Reality
STYX Team Page 39
:‫ف١ظ‬
َ‫ثٌظذ‬ ‫دغذخ‬ ُ‫ٌٍؾغ‬ ‫ثٌخط١ز‬ ‫ثٌغشػز‬ ‫صغ١ش‬ ̇
1.4....
STYX Physics Engine with Augmented Reality
STYX Team Page 40
‫ثٌم‬ ٖ‫٘ز‬ ْ‫فئ‬ ‫دثالِذ١ش‬ ‫ٔظش٠ز‬ ‫دقغخ‬ ٟٚ‫خط‬ ٓ١ّ‫لغ‬ ٍٝ...
STYX Physics Engine with Augmented Reality
STYX Team Page 41
̇
:‫ف١ظ‬
‫ثٌذفغ‬ ‫شؼجع‬ِٟٚ‫ثٌؼض‬
Inertia Tensor
‫ثٌضثٚ٠ز‬ ‫ثٌ...
STYX Physics Engine with Augmented Reality
STYX Team Page 42
‫ثٌذفغ‬ ‫شؼجع‬
َ‫ثٌظذ‬ ‫ٔمطز‬ ٓ١‫د‬ ٞ‫ثٌؼّٛد‬ ‫ثٌذؼذ‬ُٚ‫ثٌؾغ‬...
STYX Physics Engine with Augmented Reality
STYX Team Page 43
ً‫ثٌغم‬ ‫ِشوض‬ ‫ِٛلغ‬ ،ً‫ثٌىض‬..‫ِخضٍفز‬ َٚ‫ٚػض‬ ‫فشوز‬ ‫ؽٙجس...
STYX Physics Engine with Augmented Reality
STYX Team Page 44
6.‫إ‬ ‫ثٌذفغ‬ ً‫ٔفظ‬ ‫ػٕذ٘ج‬ٚ ‫ٚثٌذٚسثٔ١ز‬ ‫ثٌخط١ز‬ ٗ١‫ِشوذض‬...
STYX Physics Engine with Augmented Reality
STYX Team Page 45
‫الثالث‬ ‫اإلحداثٌات‬ ‫صدم‬ ‫نقطة‬ ‫لكل‬ ‫سٌكون‬ ً‫وبالتال‬‫ب...
STYX Physics Engine with Augmented Reality
STYX Team Page 46
1.4.3.‫ىشؼبع‬ ‫ثبىْغجخ‬ ‫اىغشػخ‬ ٍ‫ف‬ ‫اىتغُش‬‫اىذفغ‬Velocity...
STYX Physics Engine with Augmented Reality
STYX Team Page 47
‫الزاوٌة‬ ‫السرعة‬ ً‫ف‬ ‫التغٌر‬ ً‫تعط‬ ً‫الت‬ ‫العالقة‬ ‫ونح...
STYX Physics Engine with Augmented Reality
STYX Team Page 48
1.4.5.‫اىَجتغبح‬ ‫اىغشػخ‬ ‫تغُش‬ ‫حغبة‬Calculating the desire...
STYX Physics Engine with Augmented Reality
STYX Team Page 49
‫ؽش٠ك‬ ٓ‫ػ‬ ُ‫ٚ٠ض‬:ْٛٔ‫ثٌمج‬
، ‫ثٌذفغ‬ ‫شؼجع‬ ‫ٌقغجح‬ ‫ثٌالصِ...
STYX Physics Engine with Augmented Reality
STYX Team Page 50
‫الرابع‬ ‫الفصل‬
‫الفيزيائي‬ ‫المحرك‬ ‫وتحسين‬ ‫االتزانية‬ ‫ت...
STYX Physics Engine with Augmented Reality
STYX Team Page 51
2.ٍ‫اىفُضَبئ‬ ‫اىَحشك‬ ُِ‫وتحغ‬ ‫االتضاُّخ‬ ‫تحقُق‬
2.1.‫اىتذ...
STYX Physics Engine with Augmented Reality
STYX Team Page 52
2.1.1.ٍ‫خط‬ ‫اىغُش‬ ‫اإلعقبغ‬ ‫تحقُق‬Nonlinear projection imp...
STYX Physics Engine with Augmented Reality
STYX Team Page 53
‫ف١ظ‬linearMove[0]،angularMove[0]‫ثألٚي‬ ُ‫ٌٍؾغ‬،
linearMove[...
STYX Physics Engine with Augmented Reality
STYX Team Page 54
1.‫بحساب‬ ‫نقوم‬‫واحدة‬ ‫بواحدة‬ ‫التماس‬ ‫نقطة‬ ‫المراد‬ ‫ال...
STYX Physics Engine with Augmented Reality
STYX Team Page 55
‫ضمن‬ ‫وٌحفظ‬ ‫ٌحسب‬ ‫والزاوي‬ ً‫الخط‬ ‫التحرٌك‬ ‫فإن‬ ‫ا‬‫ا‬...
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
3D Physical Bodies Interaction, Augmented Reality Approach - Documentation
Upcoming SlideShare
Loading in …5
×

3D Physical Bodies Interaction, Augmented Reality Approach - Documentation

772 views

Published on

An engine that enables the user to fully interact and manipulate the virtual physical bodies around him with his own hands through a computer screen and a camera. My CRUST 3D V1.0 has been used as the physics engine.

Published in: Entertainment & Humor
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
772
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

3D Physical Bodies Interaction, Augmented Reality Approach - Documentation

  1. 1. 5/23/2012 VIRTUAL REALITY | JAEGER & ZGTR & HASSNOV & POD 2102 ‫اهلل‬ ‫عبد‬ ‫أبو‬ ‫إسماعيل‬‫شاكر‬ ‫محمد‬ ‫سرحان‬ ‫حسه‬ ‫محمد‬‫زوجي‬ ‫مهدي‬ ‫الصوص‬ ‫مدحت‬ STYX 2D and 3D Physics Engines with Augmented Reality
  2. 2. STYX Physics Engine with Augmented Reality STYX Team Page 1 ‫اىفهشط‬ 1.‫مقدمة‬‫المشروع‬.............................................................................................6 ‫تمهٌد‬Abstract.....................................................................................................6 1.1.‫مقدمة‬............................................................................................................6 1.1.1.‫الفكرة‬..........................................................................................................6 1.1.1.‫توصٌف‬‫المشروع‬..........................................................................................6 1.1.‫كلمات‬‫مفتاحٌة‬.................................................................................................7 1.1.‫أهداف‬‫المشروع‬...............................................................................................7 2.‫القوانٌن‬‫األساسٌة‬ً‫ف‬‫الحركة‬Laws of Motion........................................................11 2.1.‫مقدمة‬.........................................................................................................11 1.1.‫الحركة‬‫االنسحابٌة‬...........................................................................................11 2.3.‫م‬‫بدأ‬‫دالمبٌر‬D’Alembert’s Principle...............................................................11 1.2.‫العالقة‬‫األساسٌة‬ً‫ف‬‫التحرٌك‬Newton’s Law.......................................................11 1.3.‫مبدأ‬‫إحداثٌات‬‫الجسم‬Origin of a Body..............................................................11 1.4.‫الحركة‬‫الدورانٌة‬............................................................................................11 1.4.1.‫العالقة‬‫األساسٌة‬ً‫ف‬‫التحرٌك‬ً‫الدوران‬...............................................................11 1.4.1.‫تمثٌل‬‫الدوران‬Rotation............................................................................12 2.7.‫القوى‬‫الخارجٌة‬‫المؤثرة‬‫على‬‫األجسام‬.....................................................................13 2.7.1.‫قوة‬‫الثقل‬Gravity.......................................................................................13 1.5.1.‫االحتكاك‬Friction....................................................................................13 1.6.‫حساب‬‫القوى‬‫وتحدٌث‬‫معلومات‬‫الجسم‬‫الصلب‬.........................................................13 1.6.1.‫تحدٌث‬‫معلومات‬‫الجسم‬(‫الحركة‬‫االنسحابٌة‬).......................................................14 2.8.1.1.‫التسارع‬.................................................................................................14 1.6.1.1.‫السرعة‬...................................................................................................14 1.6.1.1‫الموقع‬....................................................................................................14 1.6.1.‫تحدٌث‬‫معلومات‬‫الجسم‬(‫الحركة‬‫الدورانٌة‬).........................................................14 2.8.2.1.‫التسارع‬‫الزاوي‬........................................................................................15
  3. 3. STYX Physics Engine with Augmented Reality STYX Team Page 2 1.6.1.1.‫السرعة‬‫الزاوٌة‬........................................................................................15 1.6.1.1.‫الزاوٌة‬...................................................................................................15 1.‫محرك‬‫الصدم‬...................................................................................................12 1.1.‫أنواع‬‫الصدم‬Collision Types.........................................................................12 3.2.‫تولٌد‬‫نقاط‬‫الصدم‬‫بحسب‬‫نوع‬‫الصدم‬Generating Contacts....................................12 3.3.‫بنٌة‬‫التماس‬Contact Data..............................................................................11 3.4.‫أنواع‬‫التماس‬Contacts..................................................................................11 1.2.1.‫تالمس‬‫من‬‫نوع‬‫نقطة‬–‫حافة‬Point-Face Contact............................................11 1.2.1.‫تالمس‬‫من‬‫نوع‬‫حافة‬–‫حافة‬Edge-Edge Contact............................................12 1.2.1.‫تالمس‬‫من‬‫نوع‬‫حافة‬-‫وجه‬Edge-Face Contact..............................................12 3.4.4.‫تالمس‬‫من‬‫نوع‬‫وجه‬–‫وجه‬Face-Face Contact.............................................13 1.3.‫كشف‬‫الصدم‬Collision Detection....................................................................14 1.3.1.‫تصادم‬‫كرتٌن‬Colliding Spheres.................................................................15 1.3.1.‫تصادم‬‫كرة‬-‫مستوي‬Colliding a Sphere and a Plane....................................15 1.3.1.‫تصادم‬‫مكعب‬–‫مستوي‬Colliding a Box and a Plane......................................16 1.3.2.‫اصطدام‬‫كرة‬-‫مكعب‬Colliding a Sphere and a Box.......................................17 1.3.3.‫تصادم‬‫مكعب‬-‫مكعب‬Colliding two boxes...................................................12 3.5.6.‫الخوارزمٌات‬‫المساعدة‬ً‫ف‬‫حساب‬‫نقاط‬‫التماس‬‫وكشف‬‫الصدم‬...................................11 3.5.6.1.‫خوارزمٌة‬‫المحاور‬‫الفاصلة‬Separating Axes................................................11 ‫تصادم‬‫مستطٌل‬‫مع‬‫مستوي‬....................................................................................11 ‫تصادم‬‫كرة‬‫مع‬‫مستطٌل‬........................................................................................11 ‫تصادم‬‫مستطٌل‬‫مع‬‫مستطٌل‬‫آخر‬.............................................................................11 3.5.7.‫تولٌد‬‫التماس‬Contact Generation................................................................12 ‫التماس‬‫من‬‫نوع‬‫نقطة‬–‫حافة‬Point-Face................................................................12 ‫التماس‬‫من‬‫نوع‬‫حافة‬-‫حافة‬Edge-Edge...................................................................13 1.4.‫معالجة‬‫الصدم‬Collision Resolution................................................................14 1.4.1.‫مفاهٌم‬‫فٌزٌائٌة‬ً‫ف‬‫معالجة‬‫الصدم‬Physics concepts in collision resolution.........15 3.6.1.1.‫شعاع‬‫كمٌة‬‫الحركة‬.................................................................................15
  4. 4. STYX Physics Engine with Augmented Reality STYX Team Page 3 3.6.1.2.‫شعاع‬‫الدفع‬ً‫الخط‬Linear Impulse............................................................16 1.4.1.1.‫شعاع‬‫الدفع‬ً‫العزوم‬Impulsive Torque.....................................................17 1.4.1.‫تدوٌر‬‫التصادمات‬Rotating Collisions...........................................................21 1.4.1.‫الصدم‬-‫أشعة‬‫الدفع‬Impulses.......................................................................21 1.4.2.‫التغٌر‬ً‫ف‬‫إحداثٌات‬‫نقطة‬‫الصدم‬Change to contact coordinates......................22 1.4.2.1.‫المصفوفة‬‫الرئٌسة‬The Basis Matrix..........................................................23 1.4.3.‫التغٌر‬ً‫ف‬‫السرعة‬‫بالنسبة‬‫لشعاع‬‫الدفع‬Velocity change by Impulse....................24 3.6.6.‫تغٌر‬‫الدفع‬‫بالنسبة‬‫للسرعة‬Impulse change by Velocity..................................25 3.6.7.‫حساب‬‫تغٌر‬‫السرعة‬‫المبتغاة‬Calculating the desired velocity change.............26 3.6.8.‫تطبٌق‬‫الدفع‬Applying Impulse....................................................................27 2.‫تحقٌق‬‫االتزانٌة‬‫وتحسٌن‬‫المحرك‬ً‫الفٌزٌائ‬................................................................31 4.1.‫معالجة‬‫التداخل‬Resolving Interpenetration...................................................31 4.1.1.‫اختٌار‬‫طرٌقة‬‫معالجة‬‫التداخل‬Choosing a resolution method..........................31 4.1.2.‫تحقٌق‬‫اإلسقاط‬‫الغٌر‬ً‫خط‬Nonlinear projection implementation..................31 4.1.3.‫تطبٌق‬‫الحركة‬Applying the movement......................................................31 4.1.4.‫تجنب‬‫الدوران‬‫الزائد‬Avoiding excessive rotation.........................................32 4.1.5.‫معالجة‬‫التغلغل‬Resolving penetration........................................................33 2.1.3.1.‫تطبٌق‬‫الخوارزمٌة‬‫التكرارٌة‬Iterative collision resolution algorithm implementation..........................................................................................35 4.2.‫ماسات‬ّ‫ت‬‫ال‬‫المتساندة‬Resting Contacts...............................................................36 2.1.1.‫الصدم‬‫المٌكروي‬Micro-Collision.................................................................36 4.2.2.‫االحتكاك‬Friction......................................................................................41 4.2.2.1.‫االحتكاك‬‫ا‬‫ال‬‫ممث‬‫كأشعة‬‫دفع‬Friction as impulses...........................................41 2.1.1.1.‫االحتكاك‬‫ومعالجة‬‫نقاط‬‫التماس‬‫المتتالٌة‬FRICTION AND SEQUENTIAL CONTACT RESOLUTION...............................................................................44 3.‫الخدمات‬‫المضافة‬‫على‬‫المحرك‬ً‫الفٌزٌائ‬..................................................................46 3.1.‫محاكاة‬‫حركة‬‫النوابض‬‫المترابطة‬.........................................................................46 3.1.1.‫تمثٌل‬‫النوابض‬‫المترابطة‬‫ا‬‫ا‬ٌ‫فٌزٌائ‬......................................................................46 3.1.1.‫المتحوالت‬‫الفٌزٌائٌة‬‫المستخدمة‬........................................................................46
  5. 5. STYX Physics Engine with Augmented Reality STYX Team Page 4 3.1.1.‫القوى‬‫الموئرة‬‫على‬‫النوابض‬‫المترابطة‬..............................................................47 5.1.4.‫القوى‬‫المؤثرة‬‫على‬‫النابض‬.............................................................................52 ‫قوة‬‫ر‬ّ‫ت‬‫تو‬‫ابض‬ّ‫ن‬‫ال‬.................................................................................................52 ‫قوة‬‫االحتكاك‬Friction Force...............................................................................51 ‫قوى‬‫الجاذبٌة‬‫وقوى‬‫مقاومة‬‫الهواء‬‫والقوى‬‫األخرى‬‫المؤثرة‬‫على‬‫الكتل‬.................................51 3.1.3.‫محاكاة‬‫الحبال‬‫عن‬‫طرٌق‬‫النوابض‬‫المترابطة‬........................................................51 3.1.4.‫النوابض‬‫المترابطة‬‫والعقد‬...............................................................................51 3.1.5.‫النوابض‬‫المترابطة‬‫مع‬‫أنماط‬‫مختلفة‬‫للكتل‬...........................................................51 3.1.‫محاكاة‬‫حركة‬‫األجسام‬ً‫ف‬‫السوائل‬........................................................................51 3.1.1.‫مفاهٌم‬ً‫ف‬‫السوائل‬........................................................................................51 3.1.1.‫القوى‬‫الموثرة‬‫على‬‫األجسام‬ً‫ف‬‫السوائل‬..............................................................52 4.‫التوصٌف‬‫والتحقٌق‬ً‫البرمج‬.................................................................................55 4.1.‫اللغة‬‫البرمجٌة‬‫المستخدمة‬‫والبٌئة‬‫المستخدمة‬............................................................55 4.1.‫تحقٌق‬‫الصفوف‬..............................................................................................55 4.1.1.‫الهرمٌة‬1.............................................................................................57 4.1.1.‫الهرمٌة‬1.............................................................................................57 4.1.1.‫الهرمٌة‬1.............................................................................................61 6.2.4.‫الواجهة‬Interface IUpdatableComponent...............................................61 6.2.5.‫صف‬‫تحدٌث‬‫المحرك‬ً‫الفٌزٌائ‬‫الرئٌس‬EngineManager..................................61 4.1.4.‫صفوف‬‫معالجة‬‫الصدم‬...................................................................................61 6.2.7.‫األنماط‬‫المتعددة‬Enumerable.......................................................................62 ‫النمط‬‫المتعدد‬PlayPauseMode..............................................................................62 ‫النمط‬‫المتعدد‬ManipulationGameMode...............................................................63 ‫النمط‬‫المتعدد‬Material..........................................................................................64 6.2.8.‫محرك‬‫الدقائق‬Particles Engine...................................................................64 4.1.7.‫الدخل‬‫والخرج‬............................................................................................66 4.1.‫واجهة‬‫المستخدم‬.............................................................................................67 4.2.‫واجهة‬‫تعدٌل‬‫المحرك‬ً‫الفٌزٌائ‬...........................................................................75
  6. 6. STYX Physics Engine with Augmented Reality STYX Team Page 5 5.‫الواقع‬‫المزاد‬...................................................................................................121 5.1‫ا‬‫لفكرة‬.........................................................................................................121 5.1.‫الواقع‬‫المز‬‫اد‬‫والواقع‬ً‫االفتراض‬........................................................................121 5.1.‫تطبٌقات‬‫الواقع‬‫المزاد‬.....................................................................................121 ‫التسلٌة‬...........................................................................................................121 ‫األلعاب‬.......................................................................................................121 ‫االتصاالت‬......................................................................................................121 ‫الرٌاضة‬.........................................................................................................121 ‫عرض‬‫المناخ‬..................................................................................................122 ‫التعلٌم‬............................................................................................................122 ‫المجال‬ً‫اإلعالن‬...............................................................................................123 ‫الحٌاة‬‫ّة‬ٌ‫الٌوم‬...................................................................................................123 5.2.‫العتاد‬‫المستخدم‬.............................................................................................124 5.2.1.‫أدوات‬‫دخل‬.........................................................................................124 5.2.1.‫أدوات‬‫خرج‬........................................................................................125 5.3.‫نظام‬‫معالجة‬........................................................................................125 5.4.‫الفٌزٌاء‬‫مع‬‫الواقع‬‫المزاد‬.................................................................................126 5.4.1.‫التطبٌق‬‫الذي‬‫قمنا‬‫به‬...................................................................................126 5.5.‫أجزاء‬‫التطبٌق‬..............................................................................................127 5.5.1.‫أجهزة‬‫خل‬ّ‫د‬‫ال‬............................................................................................127 5.5.1.‫أجهزة‬‫الخرج‬............................................................................................127 5.5.1.‫أجهزة‬‫المعالجة‬.........................................................................................127 6.‫الرؤٌة‬‫المستقبلٌة‬..............................................................................................111 9.‫المراجع‬..............................................................................................111
  7. 7. STYX Physics Engine with Augmented Reality STYX Team Page 6
  8. 8. STYX Physics Engine with Augmented Reality STYX Team Page 7 ‫األول‬ ‫الفصل‬ ‫المشروع‬ ‫مقدمة‬
  9. 9. STYX Physics Engine with Augmented Reality STYX Team Page 8 1.‫اىَششوع‬ ‫ٍقذٍخ‬ ‫تَهُذ‬Abstract ‫ص‬ ‫ثٌذسثعز‬ ٖ‫٘ز‬َ‫ثٌظذ‬ ٛ٘ٚ ‫أال‬ ٟ‫ثٌف١ض٠جة‬ ‫ثٌّخذش‬ َ‫ألغج‬ ِٓ ٟ‫سة١غ‬ ُ‫لغ‬ ‫ششؿ‬collision engine‫ٚو١ف‬ ُ‫٠ض‬َ‫ثعضخذث‬ٟ‫ف‬ ُ‫ثٌمغ‬ ‫٘زث‬ٌ‫ث‬‫ضطذ١مجس‬ٌ‫ث‬‫دؼؼٙج‬ ‫ِغ‬ ‫صفجػٍٙج‬ ‫ٚو١ف١ز‬ ‫ثٌظٍذز‬ َ‫ثألؽغج‬ ٍٝ‫ػ‬ ‫ف١ض٠جة١ز‬‫ثٌذؼغ‬، ‫وّج‬‫ص‬ٟ‫ثٌف١ض٠جة‬ ‫ثٌّقشن‬ ‫دٕجء‬ ‫و١ف١ز‬ ‫ششؿ‬‫د‬ ً‫ث‬‫أخ١ش‬ ٗ‫ٚسدط‬ ‫ثٌذؼذ‬ ٟ‫ٚعالع‬ ‫ثٌذؼذ‬ ٟ‫عٕجة‬ ٗ١‫دٕٛػ‬‫ثٌّضثد‬ ‫جٌٛثلغ‬ Augmented Reality‫ٚثٌٛثلغ‬ ‫ثٌف١ض٠جة١ز‬ ‫ثٌّقشوجس‬ ٓ١‫د‬ ‫دجٌشدؾ‬ ‫ؽذ٠ذر‬ ‫فىشر‬ ٌٝ‫إ‬ ‫ٌٍٛطٛي‬. 1.1.‫ٍقذٍخ‬ 1.1.1.‫اىفنشح‬ ٟ‫ٚأعجع‬ َ‫٘ج‬ ‫ِٛػٛع‬ ٟ‫ثٌف١ض٠جة‬ ‫ثٌّقشن‬ ‫٠ؼضذش‬ٟ‫ف‬ ‫ٌ١ظ‬‫ثٌٛثلغ‬ ٍٝ‫ػ‬ ‫ثالخضذجسثس‬ّٓ‫ػ‬ ‫ٚإّٔج‬ ‫فقغخ‬ .ً‫ج‬١ٌ‫فج‬ ‫ٌؼذز‬ ٞ‫أ‬ ٟ‫ف‬ ٟ‫ثألعجع‬ ‫ثٌؾضء‬ ً‫٠شى‬ ٗٔ‫أل‬ ‫ثألٌؼجح‬ ‫ِقشوجس‬‫ثٌّقشوجس‬ َ‫ثعضخذث‬ ‫ٌظؼٛدز‬ ً‫ث‬‫ٔظش‬ ‫ثٌف١ض٠جة١ز‬‫ثٌّضطٍذجس‬ ‫ؽّ١غ‬ ‫صقم١ك‬ َ‫ٚػذ‬ ‫عّٕٙج‬ ‫السصفجع‬ ‫ثٌضؾجس٠ز‬ٌَ‫ٍّغضخذ‬،ّ‫ثٌؼ‬ ‫ثٌؾذ٠ش‬ ِٓ ْ‫وج‬ ‫ٌزٌه‬ً ‫دٕج‬ ‫خجص‬ ٟ‫ف١ض٠جة‬ ‫ِقشن‬ ‫دٕجء‬ ٍٝ‫ػ‬‫د‬ ‫ٚرٌه‬ ،َ‫ثٌّغضخذ‬ ‫ِغ‬ ًِ‫ثٌضؼج‬ ‫ٚعٌٙٛز‬ ‫ثٌّشٚٔز‬ ِٓ ‫ثٌّض٠ذ‬ ‫ضقم١ك‬ ٓ١‫ثٌذ١تض‬ ّٓ‫ػ‬ ‫ثألعجع١ز‬ ٗ‫دٕ١ض‬ ٍٝ‫ػ‬ ‫صؼذ٠الس‬ ‫أؽشثء‬ ْٚ‫دذ‬ ِٕٗ ‫ٚثٌقزف‬ ‫ثألػجفز‬ ٚ‫أ‬ ٗ١ٍ‫ػ‬ ً٠‫ثٌضؼذ‬ ‫ٚعٌٙٛز‬ ‫ؽش٠ك‬ ٓ‫ػ‬ ‫ِذضىشر‬ ‫دطش٠مز‬ ‫ثٌٛثلغ‬ ‫ِغ‬ ٗ‫دِؾ‬ ٌٝ‫إ‬ ً‫ال‬ٛ‫ٚط‬ ‫ثٌذؼذ‬ ‫ٚثٌغالع١ز‬ ‫ثٌغٕجة١ز‬‫ثٌّضثد‬ ‫ثٌٛثلغ‬. 1.1.1.‫اىَششوع‬ ‫تىصُف‬ ‫هذا‬ ‫ٌقوم‬‫ٌتٌح‬ ‫مما‬ ‫المحٌط‬ ‫والوسط‬ ‫بٌنها‬ ‫فٌما‬ ‫الصلبة‬ ‫األجسام‬ ‫لتفاعل‬ ً‫فٌزٌائ‬ ً‫لمحاك‬ ‫نواة‬ ‫ببناء‬ ‫المشروع‬ .‫علٌه‬ ‫جدٌدة‬ ‫فٌزٌائٌة‬ ‫مفاهٌم‬ ‫وإضافة‬ ‫المستقبل‬ ً‫ف‬ ‫التطوٌر‬ ‫عملٌة‬ ‫له‬
  10. 10. STYX Physics Engine with Augmented Reality STYX Team Page 9 1.1.‫ٍفتبحُخ‬ ‫ميَبد‬ Collision Detection, Collision Resolution, Rigid body, Force, Torque, Linked spring, spring, liquids, impulse. ،‫الصدم‬ ‫معالجة‬ ،‫الصدم‬ ‫اكتشاف‬،‫العزم‬ ،‫القوة‬ ،‫الصلب‬ ‫الجسم‬‫المترابطة‬ ‫النوابض‬،،‫النابض‬‫الواقع‬ ‫المزاد‬.‫الدفع‬ ،‫السوائل‬ ، 1.1.‫أ‬‫اىَششوع‬ ‫هذاف‬ ‫ّٔٛرػ‬ ‫دٕجء‬ٟ‫ف١ض٠جة‬ ‫ٌّقشن‬َ‫ٌٍّغضخذ‬ ‫٠ض١ـ‬ ‫دق١ظ‬ ‫ٚثٌضطٛ٠ش‬ ‫ٌإلػجفز‬ ً‫لجد‬‫ثٌف١ض٠جة١ز‬ ٗ‫صؾجسد‬ ‫دٕجء‬ ‫ثٌخجطز‬.ٗ١ٍ‫ػ‬ ‫ثإلػجفز‬ ٚ‫أ‬ ً٠‫ثٌضؼذ‬ ٚ‫أ‬ ‫و١ف١ز‬ ‫دسثعز‬ ٚ ‫ٚثفذر‬ ‫د١تز‬ ٟ‫ف‬ ‫ثٌف١ض٠جة١ز‬ ‫ثٌخٛثص‬ ٚ ‫ثٌطذ١ؼز‬ ‫ِخضٍفز‬ َ‫ثألؽغج‬ ِٓ ‫ِؾّٛػز‬ ‫ٚػغ‬ ‫ثٌّق١ؾ‬ ‫ثٌٛعؾ‬ ‫ِغ‬ ٚ ‫دؼؼٙج‬ ‫ِغ‬ َ‫ثألؽغج‬ ٖ‫٘ز‬ ً‫صفجػ‬‫ثٌذؼذ‬ ‫ٚعالع١ز‬ ‫عٕجة١ز‬ ٓ١‫ثٌذ١تض‬ ٟ‫ف‬. ‫خذِجس‬ ‫صطذ١ك‬Servicesٗ‫رثص‬ ‫دقذ‬ ‫ثٌّقشن‬ ٓ‫ػ‬ ‫ِؾشدر‬ ‫دطش٠مز‬ ‫ثٌغجدمز‬ َ‫ثألؽغج‬ ٍٝ‫ػ‬ ‫صطذ١ك‬‫ثٌّضثد‬ ‫ثٌٛثلغ‬.‫ثٌف١ض٠جة١ز‬ َ‫ثألؽغج‬ ٍٝ‫ػ‬
  11. 11. STYX Physics Engine with Augmented Reality STYX Team Page 10 ‫الفصل‬‫الثاني‬ ‫الصلبة‬ ‫األجسام‬ ‫حركة‬
  12. 12. STYX Physics Engine with Augmented Reality STYX Team Page 11 1.‫اى‬ُِّ‫قىا‬ٍ‫ف‬ ‫األعبعُخ‬‫اىحشمخ‬Laws of Motion 1.1.‫ٍقذٍخ‬ ‫ٚفغجح‬ ‫دششؿ‬ ً‫ثٌفظ‬ ٖ‫٘ز‬ ٟ‫ف‬ َٛ‫عٕم‬ٜٛ‫ثٌم‬ ُ١‫ل‬ٚ‫ثٌّطذمز‬ َٚ‫ثٌؼض‬َ‫ثألؽغج‬ ٍٝ‫ػ‬‫ثٌضقش٠ه‬ ‫ِٚذجدا‬ِٓ( )‫ٚصغجسع‬ ‫عشػز‬ ٚ ‫ِٛلغ‬‫ؽجٔخ‬ ٌٝ‫إ‬ًِ‫وج‬ ً‫دشى‬ ‫دجٌفىشر‬ َ‫ٌإلٌّج‬ ‫صٛػ١قٙج‬ ‫٠ؾخ‬ ٜ‫ثخش‬ ‫أِٛس‬‫ف١ّج‬ ‫ٔٛػقٙج‬ .ٍٟ٠ 1.1.‫االّغحبثُخ‬ ‫اىحشمخ‬ ‫ثٌّغجس‬ ‫دٕفظ‬ ‫صضقشن‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫وجفز‬ ‫وجٔش‬ ‫إرث‬ ‫ثٔغقجد١ز‬ ‫فشوز‬ ‫٠ضقشن‬ ٗٔ‫أ‬ ‫طٍخ‬ ُ‫ؽغ‬ ٓ‫ػ‬ ‫ٔمٛي‬ٚ‫٘زث‬ ‫ؽّ١غ‬ ‫عشػجس‬ ْ‫أ‬ ٌٝ‫إ‬ ٞ‫٠ؤد‬‫دق‬ ‫ثٌّضقشن‬ ‫ثٌظٍخ‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬‫ٌقظز‬ ً‫و‬ ٟ‫ف‬ ‫ِضغجٚ٠ز‬ ‫ثٔغقجد١ز‬ ‫شوز‬‫ٚدجٌض‬ٌٟ‫ج‬ ‫إ‬ ُ‫ثٌؾغ‬ ‫فشوز‬ ‫دسثعز‬ ‫صؤٚي‬‫(ِشوض‬ ٗ‫ٔمجؽ‬ ‫أفذ‬ ‫فشوز‬ ‫دسثعز‬ ٌٌٝ‫ػطج‬ٗ‫ض‬.) 1.1.‫داىَجُش‬ ‫ٍجذأ‬D’Alembert’s Principle ‫دثٌّذ١ش‬ ‫ِذذأ‬ ْ‫إ‬‫ِذذأ‬ ً‫ج‬ٔ‫أف١ج‬ ّٝ‫ثٌّغ‬‫الغشثٔؼ‬-‫دثٌّذ١ش‬ِٓ ٛ٘‫ثٌّذجدا‬‫ثألعج‬‫ف١ض٠جء‬ ٟ‫ف‬ ‫ع١ز‬‫ثٌقشوز‬ ‫ثٌىالع١ى١ز‬‫٠ٕض‬ .‫دثٌّذ١ش‬ ‫ِذذأ‬ٗٔ‫فئ‬ ‫ٚثفذ‬ ٍْ‫دآ‬ ُ‫ؽغ‬ ٍٝ‫ػ‬ ‫ش‬‫صؤع‬ ٜٛ‫ل‬ ‫ر‬‫ػذ‬ ‫ٚؽٛد‬ ‫فجي‬ ٟ‫ف‬ ٗٔ‫أ‬ ٍٝ‫ػ‬ :ْٛ‫٠ى‬ ‫دق١ظ‬ ‫ٚثفذر‬ ‫دمٛر‬ ‫ثعضذذثٌٙج‬ ‫دئِىجٕٔج‬ ⃗ ∑ ⃗⃗⃗⃗
  13. 13. STYX Physics Engine with Augmented Reality STYX Team Page 12 1.2.‫اىتحشَل‬ ٍ‫ف‬ ‫األعبعُخ‬ ‫اىؼالقخ‬Newton’s Law :‫ثٌضقش٠ه‬ ٟ‫ف‬ ٟ‫ثألعجع‬ ٓ‫ٔ١ٛص‬ ‫ِذذأ‬ ‫٠مٛي‬ "‫وضٍضٙج‬ ‫ِجد٠ز‬ ‫ؽٍّز‬ ‫خؼؼش‬ ‫إرث‬m‫ِقظٍضٙج‬ ‫خجسؽ١ز‬ ٜٛ‫ل‬ ٌٝ‫إ‬∑ ⃗⃗⃗⃗⃗‫٠ىضغخ‬ ‫ػطجٌضٙج‬ ‫ِشوض‬ ْ‫فئ‬ ً‫ج‬‫صغجسػ‬⃗⃗⃗⃗⃗‫ؽٙز‬ ٚ ًِ‫فج‬ ‫ٌقظز‬ ً‫و‬ ٟ‫ف‬ ٌٗ∑ ⃗⃗⃗⃗⃗" ٌٟ‫ٚدجٌضج‬ْٛ‫٠ى‬: ∑ ⃗⃗⃗⃗ ⃗⃗⃗⃗⃗ ‫ِؼش‬ ‫دؼذ‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ِٛػغ‬ ‫ٌضقذ٠ظ‬ ‫وذذث٠ز‬ ‫ثٌضغجسع‬ ‫فغجح‬ ‫٠ّىٕٕج‬ ‫ثٌؼاللز‬ ٖ‫٘ز‬ ِٓٚ ‫فز‬ً١‫صقظ‬ ٗ١ٍ‫ػ‬ ‫شر‬‫ثٌّؤع‬ ٜٛ‫ثٌم‬ٚ ‫وّج‬ٙ‫غ‬ُ‫ص‬ ٟ‫ثٌض‬ ‫ثالػضذجسثس‬ ‫دذؼغ‬ ‫ثألخز‬ ‫٠ؾخ‬‫ثٌقشوز‬ ‫صطذ١ك‬ ‫ػٍّ١ز‬ ً ُ‫ٌٍؾغ‬ ‫ثالٔغقجد١ز‬ ‫ثٌقشوز‬ ‫دسثعز‬ ‫ػٕذ‬ ‫ثٌٛثلغ‬ ٟ‫ف‬ ‫ألٕٔج‬ ‫طٍخ‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ِخضٍف‬ ٍٝ‫ػ‬ ‫ثالٔغقجد١ز‬ .ٗ‫ػطجٌض‬ ‫ِشوض‬ ‫فشوز‬ ‫فمؾ‬ ‫ٔذسط‬ ‫ثٌظٍخ‬ 1.3.ٌ‫اىجغ‬ ‫ئحذاثُبد‬ ‫ٍجذأ‬Origin of a Body ًِ‫ثٌضؼج‬ ‫ػٕذ‬ْ‫فئ‬ ‫طٍذز‬ َ‫أؽغج‬ ‫ِغ‬ٟ‫٠غط‬ ُ‫ثٌؾغ‬ ‫ٚثفذ‬ ٍْ‫دآ‬ ‫ٔمؾ‬ ‫ر‬‫ػذ‬‫ٔمٛي‬ ْ‫أ‬ ‫٠ّىٕٕج‬ ‫ال‬ ‫ٌزٌه‬ ْٚ‫أ‬ ‫ػٕذ‬ ‫٠مغ‬ ُ‫ثٌؾغ‬‫ِقذد‬ ‫ِٛلغ‬.‫ال‬ ٞ‫أ‬ ْ‫وج‬ ‫ٌٚزٌه‬ ‫ٚثفذر‬ ‫دٕمطز‬ ُ‫ثٌؾغ‬ ْ‫ِىج‬ ‫فظش‬ ٓ‫٠ّى‬ ‫دذ‬ ‫ال‬‫ٌٕج‬‫ثٌؾغ‬ ‫ِذذأ‬ ّٝ‫صغ‬ ‫ٔمطز‬ ‫ثخض١جس‬ ُِٓ‫دق١ظ‬ ٜ‫ثألخش‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ؽّ١غ‬ ‫إفذثع١جس‬ ‫ٔم١ظ‬ ‫ثٌٕمط‬ ٖ‫ٌٙز‬ ‫دجٌٕغذز‬،‫ز‬‫ثٔغقجح‬ ‫ػٍّ١ز‬ ٞ‫أ‬ ْ‫أ‬ ٞ‫أ‬
  14. 14. STYX Physics Engine with Augmented Reality STYX Team Page 13 .ٜ‫ثألخش‬ ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ؽّ١غ‬ ٍٝ‫ػ‬ ‫ثٌّمذثس‬ ‫دٕفظ‬ ‫ثٔغقجح‬ ‫ػٍّ١ز‬ ‫صىجفؤ٘ج‬ ُ‫ثٌؾغ‬ ‫ِذذأ‬ ٍٝ‫ػ‬ ‫صطشأ‬‫دؼذ‬ ‫ٚرٌه‬ َ‫ثألؽغج‬ ‫ٚعشػز‬ ‫ِٛلغ‬ ‫فغجح‬ ٓ‫٠ّى‬ ‫ثٌضغجسع‬ ‫فغجح‬‫ثٌضجٌ١ز‬ ‫ثٌؼاللجس‬ ‫صطذ١ك‬ ‫خالي‬ ِٓ: 1.4.‫اىذوساُّخ‬ ‫اىحشمخ‬ 1.4.1.ٍّ‫اىذوسا‬ ‫اىتحشَل‬ ٍ‫ف‬ ‫األعبعُخ‬ ‫اىؼالقخ‬ ٗ‫ػطجٌض‬ َ‫ػض‬ ‫طٍخ‬ ُ‫ؽغ‬ ‫دثس‬ ‫إرث‬Iٞٚ‫ثٌضث‬ ٗ‫صغجسػ‬ ‫ؽذثء‬ ْ‫وج‬ ‫عجدش‬ ‫ِقٛس‬ ‫فٛي‬َ‫ػض‬ ٟ‫ف‬ : ٌٟ‫دجٌضج‬ ٚ ،ٗ١‫ف‬ ‫ثٌّؤعشر‬ ‫ثٌخجسؽ١ز‬ ٜٛ‫ٌٍم‬ ً‫ثٌقجط‬ َ‫ثٌؼض‬ ً‫ج‬٠ٚ‫ِغج‬ ‫ثٌّقٛس‬ ‫رٌه‬ ‫فٛي‬ ٗ‫ػطجٌض‬ ∑ ‫ٚرٌه‬ َ‫ٌألؽغج‬ ‫ثٌضثٚ٠ز‬ ‫ٚثٌغشػز‬ ٗ‫ثٌضٛؽ‬ ‫فغجح‬ ٓ‫٠ّى‬ ٞٚ‫ثٌضث‬ ‫ثٌضغجسع‬ ‫فغجح‬ ‫دؼذ‬‫خالي‬ ِٓ ‫ثٌضجٌ١ز‬ ‫ثٌؼاللجس‬ ‫صطذ١ك‬: ‫ف١ظ‬: ‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ٞٚ‫ثٌضث‬ ‫ثٌضغجسع‬
  15. 15. STYX Physics Engine with Augmented Reality STYX Team Page 14 ٞٚ‫ثٌضث‬ ‫ثٌّٛلغ‬ 1.4.1.ُ‫اىذوسا‬ ‫تَثُو‬Rotation ‫صثٚ٠ز‬ ‫دّؼشفز‬‫ِشوض‬ ‫فٛي‬ ‫أؽش٠ش‬ ٟ‫ثٌض‬ ْ‫ثٌذٚسث‬ ‫ٔمجؽ‬ ‫ؽّ١غ‬ ‫ِٛلغ‬ ‫ثعضٕضجػ‬ ٓ‫٠ّى‬ ، ‫ثٌؼطجٌز‬ :‫ثٌضجٌ١ز‬ ‫دجٌؼاللز‬ ْ‫ثٌذٚسث‬ ‫دؼذ‬ ُ‫ثٌؾغ‬ ‫ف١ظ‬: ‫ِٛلغ‬ُ‫ثٌؾغ‬ُ٠‫ثٌمذ‬ ‫ثٌّطذك‬ ‫ثالٔغقجح‬ ‫ِمذثس‬ُ‫ثٌؾغ‬ ٍٝ‫ػ‬ T ْ‫ثٌذٚسث‬ ‫ِظفٛفز‬
  16. 16. STYX Physics Engine with Augmented Reality STYX Team Page 15 1.5.ً‫األجغب‬ ً‫ػي‬ ‫اىَإثشح‬ ‫اىخبسجُخ‬ ‫اىقىي‬ 1.5.1.‫اىثقو‬ ‫قىح‬Gravity ‫ثألسػ١ز‬ ‫ثٌؾجرد١ز‬ ‫دضغجسع‬ ‫صضؼٍك‬ ‫شذصٙج‬ ‫لٛر‬ ٟ٘gٍٝ‫ػ‬ ٜ‫ألخش‬ ‫ِٕطمز‬ ِٓ ‫ثٌضغجسع‬ ‫٘زث‬ ‫٠خضٍف‬ ٞٚ‫صغج‬ ‫ثٌذقش‬ ‫عطـ‬ ٜٛ‫دّغض‬ ‫ثالعضٛثء‬ ‫خؾ‬ ‫ػٕذ‬ ٗ‫ل١ّض‬ ٚ ‫ثألسع‬ ‫عطـ‬9.81 m.s-2 ْ‫فج‬ ‫ٚدزٌه‬ :‫دجٌؼاللز‬ ٝ‫صؼط‬ ُ‫ؽغ‬ ٞ‫أ‬ ً‫عم‬ ‫لٛر‬ ⃗⃗⃗⃗ ⃗ 1.5.1.‫االحتنبك‬Friction ٜٛ‫ثٌم‬ ٛ٘ ‫ثالفضىجن‬‫ػ‬ ‫ثٌٕجصؾز‬ٚ ‫ثٌضقشن‬ ُ‫ثٌؾغ‬ ‫ِقجٌٚز‬ ٚ‫أ‬ ‫صقشن‬ ٓ‫٘زث‬ ،‫آخش‬ ‫عطـ‬ ‫ِغ‬ ‫صالِظ‬ ٍٝ‫ػ‬ ٛ٘ ‫ؽغّج‬ ْٛ‫٠ى‬ ‫لذ‬ ‫ثٌغطـ‬‫آخ‬ ‫عجدش‬ ‫فجؽض‬ ٞ‫أ‬ ٚ‫أ‬ ‫ثألسع‬ ٚ‫أ‬ ‫آخش‬‫ش‬ً‫ث‬‫ؽ١ذ‬ ‫ِظمٌٛز‬ َ‫ثألؽغج‬ ٚ‫صذذ‬ ُ‫و‬ ُٙ٠ ‫ال‬ ٚ ، ً‫ج‬١‫فف١ض٠جة‬ً‫ج‬١ٍّ‫ػ‬ ٚ‫خشٕز‬ َ‫ثألؽغج‬ ً‫و‬ً‫ج‬‫الفم‬ ً‫ِفظ‬ ً‫دشى‬ ‫دسثعضٙج‬ ُ‫ع١ض‬ .. 1.6.‫ٍؼيىٍبد‬ ‫وتحذَث‬ ‫اىقىي‬ ‫حغبة‬‫اىصيت‬ ٌ‫اىجغ‬ َٛ‫ٔم‬ٚ ٜٛ‫ثٌم‬ ‫ؽّ١غ‬ ً١‫دضقظ‬ ً‫ال‬ٚ‫أ‬ ‫ٕ٘ج‬‫ِّٕٙج‬ ً‫ٌى‬ ‫فمؾ‬ ‫ثٌّقظٍز‬ ‫ِغ‬ ًِ‫ٌٕضؼج‬ ُ‫ؽغ‬ ً‫و‬ ٍٝ‫ػ‬ ‫ثٌّؤعشر‬ َٚ‫ثٌؼض‬ )ً‫ج‬‫عجدم‬ ‫ثٌّزوٛس‬ ‫دثٌّذ١ش‬ ‫(ِذذأ‬ٚ‫وّج‬ ٓ١‫ثٌّقظٍض‬ ٓ١‫ٌٙجص‬ ً‫ج‬‫ٚفم‬ ُ‫ثٌؾغ‬ ‫ِؼٍِٛجس‬ ‫دضقذ٠ظ‬ ‫ثٌضجٌ١ز‬ ‫ثٌخطٛر‬ ْٛ‫صى‬ :ٍٟ٠ )‫ثالٔغقجد١ز‬ ‫(ثٌقشوز‬ ُ‫ثٌؾغ‬ ‫ِؼٍِٛجس‬ ‫صقذ٠ظ‬ ٠‫صقذ‬‫(ثٌقشوز‬ ُ‫ثٌؾغ‬ ‫ِؼٍِٛجس‬ ‫ظ‬‫ثٌذٚسثٔ١ز‬) .ٍٟ٠ ‫ف١ّج‬ ‫ٚعٕذسعّٙج‬
  17. 17. STYX Physics Engine with Augmented Reality STYX Team Page 16 1.6.1.)‫االّغحبثُخ‬ ‫(اىحشمخ‬ ٌ‫اىجغ‬ ‫ٍؼيىٍبد‬ ‫تحذَث‬ 1.6.1.1.‫اىتغبسع‬ ‫ٔؾذ‬ ‫دثٌّذ١ش‬ ‫دّذذأ‬ ‫دجالعضؼجٔز‬ ٚ ‫ثٌؼطجٌز‬ ‫ِشوض‬ ‫ٔظش٠ز‬ ِٓ: ⃗ ⃗ 1.6.1.1.‫اىغشػخ‬ ‫ِج‬ ‫ٌقظز‬ ٟ‫ف‬ ُ‫ؽغ‬ ‫عشػز‬ ‫صقذ٠ظ‬ ُ‫٠ض‬‫ثٌغجدمز‬ ‫ثٌٍقظز‬ ٟ‫ف‬ ٗ‫عشػض‬ ‫دذالٌز‬ٟ‫ف‬ ٗ‫صغجسػ‬ ٚ ‫ثٌقجٌ١ز‬ ‫ثٌٍقظز‬:‫ثٌؼاللز‬ ‫خالي‬ ِٓ 1.6.1.1.‫اىَىقغ‬ ‫ثٌٍقظز‬ ٟ‫ف‬ ٗ‫ِٛلؼ‬ ٚ ‫ثٌٍقظز‬ ٖ‫٘ز‬ ٟ‫ف‬ ٗ‫صغجسػ‬ ٚ ٗ‫عشػض‬ ‫دذالٌز‬ ‫ِج‬ ‫ٌقظز‬ ٟ‫ف‬ ُ‫ؽغ‬ ‫ِٛلغ‬ ‫صقذ٠ذ‬ ُ‫٠ض‬ :‫ثٌؼاللز‬ ‫خالي‬ ِٓ ‫ثٌغجدمز‬ 1.6.1.)‫اىذوساُّخ‬ ‫اىحشمخ‬ ( ٌ‫اىجغ‬ ‫ٍؼيىٍبد‬ ‫تحذَث‬ ‫ٌٍقظٛي‬‫ثٌذٚس‬ ُ‫ثٌؾغ‬ ‫فشوز‬ ‫صظف‬ ٟ‫ثٌض‬ ‫ثٌّؼٍِٛجس‬ ٍٝ‫ػ‬ٞٚ‫ثٌضث‬ ‫ثٌضغجسع‬ ‫دضقذ٠ذ‬ َٛ‫ٔم‬ ‫ثٔ١ز‬،ُ‫ع‬ ِٓ ‫ثٌّٛلغ‬ ُ‫ع‬ ‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬.
  18. 18. STYX Physics Engine with Augmented Reality STYX Team Page 17 1.6.1.1.ٌ‫اىضاو‬ ‫اىتغبسع‬ ٞٚ‫ثٌضث‬ ‫ثٌضغجسع‬ ‫ٔظش٠ز‬ ِٓ‫ٌذ٠ٕج‬ ْٛ‫٠ى‬: ∑ 1.6.1.1.‫اىضاوَخ‬ ‫اىغشػخ‬ ‫ِج‬ ‫ٌقظز‬ ٟ‫ف‬ ‫ثٌضثٚ٠ز‬ ُ‫ؽغ‬ ‫عشػز‬ ‫صقذ٠ظ‬ ُ‫٠ض‬‫ثٌغجدمز‬ ‫ثٌٍقظز‬ ٟ‫ف‬ ‫ثٌضثٚ٠ز‬ ٗ‫عشػض‬ ‫دذالٌز‬ٚ ٞٚ‫ثٌضث‬ ٗ‫صغجسػ‬:‫ثٌؼاللز‬ ‫خالي‬ ِٓ ‫ثٌقجٌ١ز‬ ‫ثٌٍقظز‬ ٟ‫ف‬ 1.6.1.1.‫اىضاوَخ‬ ‫ِج‬ ‫ٌقظز‬ ٟ‫ف‬ ‫ثٌضثٚ٠ز‬ ‫صقذ٠ذ‬ ُ‫٠ض‬‫ثٌٍقظز‬ ‫صٍه‬ ٟ‫ف‬ ‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ‫دذالٌز‬ٟ‫ف‬ ‫ثٌضثٚ٠ز‬ ٚ ‫ثٌغجدمز‬ ‫ثٌٍقظز‬:‫ثٌؼاللز‬ ‫خالي‬ ِٓ ‫ثٌذشٔجِؼ‬ ٟ‫ف‬ َٛ‫ثٌّشع‬ ‫ٌإلؽجس‬ ‫صقذ٠ظ‬ ‫ػٍّ١ز‬ ً‫و‬ ٟ‫ف‬ َٛ‫ٔم‬Frameً‫و‬ ٍٝ‫ػ‬ ‫ثٌّؤعشر‬ ٜٛ‫ثٌم‬ ‫دقغجح‬ ‫ثأل‬ ِٓ ُ‫ؽغ‬‫ف١ظ‬ ِٓ ‫ثٌذ١تز‬ ٟ‫ف‬ ‫ثٌّٛؽٛدر‬ َ‫ؽغج‬‫صؤع١ش٘ج‬ ‫ٔمطز‬ٚ‫شذصٙج‬ٚ‫ؽٙضٙج‬. ٚ‫صٍه‬ ‫ِقظٍز‬ ‫فغجح‬ ُ‫ع‬ ِٜٓٛ‫ثٌم‬ ‫ِقظٍز‬ ٓ‫ػ‬ ‫٠ؼذش‬ ‫خجص‬ ‫شؼجع‬ ّٓ‫ػ‬ ‫ٚففظٙج‬ ٜٛ‫ثٌم‬،ٍٝ‫ػ‬ ٚ ُ‫ثٌؾغ‬ ‫صغجسع‬ ‫عٕقغخ‬ ‫ثٌضقش٠ه‬ ٟ‫ف‬ ‫ثألعجع١ز‬ ‫ثٌؼاللز‬ ِٓ ‫دجالعضفجدر‬ ٚ ‫ثٌّقظٍز‬ ‫صٍه‬ ‫أعجط‬
  19. 19. STYX Physics Engine with Augmented Reality STYX Team Page 18 ٟ‫ف‬ ُ‫ثٌؾغ‬ ‫ِٛػغ‬ ٍٝ‫ػ‬ ‫ؽش٠مٙج‬ ٓ‫ػ‬ ً‫ٌٕقظ‬ ُ‫ٌٍؾغ‬ ‫ثٌؾذ٠ذر‬ ‫ثٌغشػز‬ ‫فغجح‬ ِٓ ‫٠ّىٕٕج‬ ٖ‫دذٚس‬ ٞ‫ثٌز‬ :‫ثٌؼاللز‬ ‫ٚفك‬ ٌٟ‫ثٌضج‬ ‫ثإلؽجس‬ ٓ١١ٌ‫ِضضج‬ ٓ١‫صقذ٠غ‬ ً‫و‬ ٓ١‫د‬ ً‫ثٌفجط‬ ِٓ‫ثٌض‬‫ٌإلؽجس‬ِٟٕ‫ثٌض‬Frame t ْٛ‫٠ى‬t‫ثٌّضؼ‬ ‫ثٌقذ‬ ْ‫أ‬ ‫دّج‬ ٚ ً‫ث‬‫ؽذ‬ ‫طغ١ش‬ ِٓ‫ص‬ ٛ٘‫ثٌغجدمز‬ ‫ثٌؼاللز‬ ٟ‫ف‬ ‫دجٌضغجسع‬ ‫ٍك‬‫ِغ‬ ً‫ث‬‫ؽشد‬ ‫٠ضٕجعخ‬ ِٓ‫ثٌض‬ ‫ِشدغ‬ ‫ٔظف‬‫ثٌقذ‬ ‫خالي‬ ِٓٗٔ‫فئ‬:ً‫دجٌشى‬ ‫ثٌؼاللز‬ ‫ٌضظذـ‬ ‫ثٌقذ‬ ‫٘زث‬ ‫إّ٘جي‬ ٓ‫٠ّى‬
  20. 20. STYX Physics Engine with Augmented Reality STYX Team Page 19 ‫الثالث‬ ‫الفصل‬ ‫محرك‬‫الصدم‬ Collision Engine
  21. 21. STYX Physics Engine with Augmented Reality STYX Team Page 20 1.‫ٍحشك‬ً‫اىصذ‬ 1.1.‫أّىاع‬ً‫اىصذ‬Collision Types ‫الرئٌسٌٌن‬ ‫الشكلٌن‬ ‫لدٌنا‬ ً‫الفٌزٌائ‬ ‫المحرك‬ ً‫ف‬ ‫سنعالج‬ ‫حٌث‬ ،‫للصدم‬ ‫العدٌدة‬ ‫األشكال‬ ً‫ٌل‬ ‫فٌما‬ ‫سنشرح‬ ‫المحرك‬ ً‫ف‬ ‫المستطٌل‬ ‫ومتوازي‬ ‫الكرة‬ ‫وهما‬ ‫للصدم‬ ً‫ثنائ‬ ‫المحرك‬ ً‫ف‬ ‫والدائرة‬ ‫والمستطٌل‬ ‫البعد‬ ً‫الثالث‬ .‫البعد‬ ‫ٌبٌن‬‫أي‬ ‫إرجاع‬ ‫النهاٌة‬ ً‫ف‬ ‫ٌمكن‬ ‫أنه‬ ‫المجاور‬ ‫الشكل‬ ‫وهما‬ ‫الرئٌسٌٌن‬ ‫الشكلٌن‬ ‫معالجة‬ ‫إلى‬ ‫البنٌة‬ ‫معقد‬ ‫شكل‬ ‫بالتقٌسم‬ ‫الدقة‬ ‫زٌادة‬ ‫ٌمكن‬ ‫حٌث‬ ‫والدائرة‬ ‫المستطٌل‬ .‫األداء‬ ‫حساب‬ ‫على‬ ‫ذلك‬ ‫سٌكون‬ ‫ولكن‬ ‫فأدق‬ ‫أدق‬ ‫بشكل‬ 1.1.ً‫اىصذ‬ ‫ّقبغ‬ ‫تىىُذ‬ً‫اىصذ‬ ‫ّىع‬ ‫ثحغت‬Generating Contacts ‫التمٌٌز‬ ‫المهم‬ ‫من‬‫عام‬ ‫بشكل‬ ‫الصدم‬ ‫كشف‬ ‫بٌن‬Collision Detection‫الصدم‬ ‫التماس‬ ‫نقاط‬ ‫وكشف‬ Contacts Detection:‫المفهومٌن‬ ‫بٌن‬ ‫الفرق‬ ً‫التال‬ ‫الشكل‬ ‫ٌبٌن‬ .
  22. 22. STYX Physics Engine with Augmented Reality STYX Team Page 21 .‫التماس‬ ‫لنقاط‬ ‫المختلفة‬ ‫األنواع‬ ً‫التال‬ ‫المخطط‬ ‫ٌبٌن‬
  23. 23. STYX Physics Engine with Augmented Reality STYX Team Page 22 1.1.‫اىتَبط‬ ‫ثُْخ‬Contact Data ‫بحاجة‬ ‫فنحن‬ ‫تماس‬ ‫نقطة‬ ‫كل‬ ‫أجل‬ ‫من‬-‫سنرى‬ ‫كما‬- ‫ألن‬:‫التالٌة‬ ‫بالمعلومات‬ ‫نحتفظ‬ 1.‫التماس‬ ‫نقطة‬Contact Point ‫نقاط‬ ‫ٌوجد‬ ً‫وبالتل‬ ‫سٌتداخالن‬ ‫الجسمٌن‬ ‫فإن‬ ‫ا‬‫ا‬ٌ‫عمل‬ ‫التطبٌق‬ ‫عند‬ ،‫الجسمٌن‬ ‫بٌن‬ ‫التماس‬ ‫نقطة‬ ‫عن‬ ‫تعبر‬ ‫التداخل‬ ‫سنعالج‬ ‫ألننا‬ ً‫الفٌزٌائ‬ ‫المحرك‬ ‫عمل‬ ‫على‬ ‫ٌأثر‬ ‫وال‬ ‫ا‬‫ا‬ٌ‫اعتباط‬ ‫ٌتم‬ ‫أحدها‬ ‫اختٌار‬ ،‫كثٌرة‬ ‫تماس‬ ‫الص‬ ‫عملٌة‬ ‫ونرجع‬.‫سنرى‬ ‫كما‬ ‫مختلفة‬ ‫تماس‬ ‫نقاط‬ ‫لمعالجة‬ ‫دم‬ 2.‫التماس‬ ‫ناظم‬Contact Normal ‫الصدم‬ ‫دفع‬ ‫جهة‬ ‫وهو‬impact‫الحاالت‬ ‫بعض‬ ً‫ف‬ ‫بسهولة‬ ‫حسابه‬ ‫ٌتم‬ .‫الجسمٌن‬ ‫بٌن‬ ‫ستحصل‬ ً‫الت‬ .‫ا‬‫ا‬‫أبد‬ ‫السهولة‬ ‫بهذه‬ ‫لٌس‬ ‫فإنه‬ ‫األخرى‬ ‫الحاالت‬ ‫بعض‬ ً‫وف‬ ،)‫سطح‬ ‫مع‬ ‫نقطة‬ ‫تصادم‬ ‫(كحالة‬ ‫متصادمٌن‬ ‫جسمٌن‬ ‫ٌوجد‬ ‫إنه‬ ‫بما‬‫سنعتبر‬ ‫فإننا‬‫دراستنا‬ ‫ضمن‬ ‫ا‬‫ا‬‫دائم‬‫التماس‬ ‫ناظم‬ ‫جهة‬ ‫أن‬‫هو‬‫الجسم‬ ‫من‬ .ً‫للثان‬ ‫األول‬
  24. 24. STYX Physics Engine with Augmented Reality STYX Team Page 23 3.‫التداخل‬ ‫عمق‬Penetration Depth ‫ناظم‬ ‫بها‬ ‫ٌمر‬ ً‫الت‬ ‫المسافة‬ ‫خالل‬ ‫من‬ ‫تحسب‬ ،‫بٌنهما‬ ‫فٌما‬ ‫المتصادمٌن‬ ‫الجسمٌن‬ ‫تداخل‬ ‫عمق‬ ‫عن‬ ‫ٌعبر‬ .‫التماس‬ ‫بنقطة‬ ‫التماس‬ 1.2.‫اىتَبط‬ ‫أّىاع‬Contacts ‫فٌما‬ ‫سنوضح‬ّ‫د‬‫المتع‬ ‫األشكال‬ ً‫ٌل‬‫دة‬‫التماس‬ ‫لنقاط‬. 1.2.1.‫ّقطخ‬ ‫ّىع‬ ٍِ ‫تالٍظ‬–‫حبفخ‬Point-Face Contact ً‫ج‬‫ش١ٛػ‬ ‫ثألوغش‬ ٛ٘ ‫ثٌضظجدِجس‬ ِٓ ‫ثٌٕٛع‬ ‫٘زث‬ٚ‫أّ٘١ز‬،‫ثٌض‬ ُ‫ٔجظ‬ ٝ‫٠ؼط‬ّ‫ج‬ُ‫دجٌٕجظ‬ ‫ثٌقجٌز‬ ٖ‫٘ز‬ ٟ‫ف‬ ‫ط‬ ‫عطـ‬ ٍٝ‫ػ‬‫ثٌضّجط‬‫ٔمطز‬ ٟ‫ف‬‫ثٌضّجط‬:ً‫ثٌشى‬ ‫٠ٛػـ‬ ‫وّج‬ ‫ثٌغطـ‬ ً‫دثخ‬ ‫ثٌٕمطز‬ ‫وجٔش‬ ‫فجي‬ ٟ‫ف‬penetrated‫ٌٍغطـ‬ ‫ٚإعمجؽٙج‬ ‫ثٌٕمطز‬ ‫إسؽجع‬ ُ‫ع١ض‬ ٗٔ‫فئ‬ ‫ٚرٌه‬.َ‫ثٌضظجد‬ ‫ٔٛع‬ ِٓ ‫ٌقغجح‬
  25. 25. STYX Physics Engine with Augmented Reality STYX Team Page 24 1.2.1.‫حبفخ‬ ‫ّىع‬ ٍِ ‫تالٍظ‬–‫حبفخ‬Edge-Edge Contact ‫ثٌضظجدِجس‬ ِٓ ‫ٔٛع‬ ُ٘‫أ‬ ٟٔ‫عج‬ ٟ٘ ٚٚ‫فجٌز‬ ٟ٘‫ثٌّضغجٔذر‬ ‫ثٌضّجعجس‬ ‫فجٌز‬ ٟ‫ف‬ ً‫ث‬‫ؽذ‬ ‫٘جِز‬Resting Contacts.‫ٕ٘ج‬ ‫ثٌضّجط‬ ُ‫ٔجظ‬ٌ‫ث‬ ٛ٘‫ثٌّّجط‬ ٍٝ‫ػ‬ ‫ؼّٛد‬ٓ١‫ثٌقجفض‬ ٓ١‫د‬‫ف١ظ‬‫ثٌؾذثء‬ ًّ‫٠غضؼ‬ ٟ‫ثٌشؼجػ‬‫ٌقغجح‬ُ‫ثٌٕجظ‬.‫ثأللشح‬ ‫ثٌٕمطز‬ ٟ٘ ‫ثٌضّجط‬ ‫ٔمطز‬‫أل‬‫ثٌقٛثف‬ ‫فذ‬‫ث‬ ِٜٓ‫ثألخش‬ ‫ٌقجفز‬. 1.2.1.‫حبفخ‬ ‫ّىع‬ ٍِ ‫تالٍظ‬-‫وجه‬Edge-Face Contact ‫ثٌضظجدِجس‬ ِٓ ‫ثٌٕٛع‬ ‫٘زث‬‫ال‬‫٠قذط‬‫إال‬‫ثٌّٕقٕ١ز‬ ‫ثألعطـ‬ ‫ِغ‬ً١‫ِغضط‬ ٓ١‫د‬ ‫فمؾ‬ ‫فجٌضٕج‬ ٟ‫(ٚف‬ )‫ٚدثةشر‬ٚ‫ٌقجٌز‬ ‫ِشجدٙز‬ ‫دطش٠مز‬ ‫ٕ٘ج‬ ‫ٌذ‬ٛ‫ص‬ ‫ثٌضّجط‬ ‫ِؼٍِٛجس‬Point-Face.ُ‫ٔجظ‬ ٛ٘ ‫ثٌضّجط‬ ُ‫ٔجظ‬ ‫ثٌغطـ‬.
  26. 26. STYX Physics Engine with Augmented Reality STYX Team Page 25 1.2.2.‫وجه‬ ‫ّىع‬ ٍِ ‫تالٍظ‬–‫وجه‬Face-Face Contact ‫ثٌض‬‫ّجط‬‫عطـ‬ ‫صالِظ‬ ‫ػٕذ‬ ‫٠قذط‬ ‫ثٌّٕؾ‬ ‫٘زث‬ ِٓ‫دثةشر‬ ْ‫وج‬ ‫عٛثء‬ ‫آخش‬ ‫ِغ‬ ٟٕ‫ِٕق‬ٚ‫أ‬.ٞٛ‫ِغض‬ُ‫ٔجظ‬ ‫ثٌضّجط‬‫ٕ٘ج‬‫٠قذط‬ ٝ‫فض‬ ‫ث٢خش‬ ٗ‫ثٌٛؽ‬ ُ‫ٌٕجظ‬ ‫صّجِج‬ ً‫ج‬‫ِؼجوغ‬ ْٛ‫٠ى‬ ْ‫أ‬ ‫٠ؾخ‬ ٞ‫ثٌز‬ ‫ثألٚي‬ ٗ‫ثٌٛؽ‬ ُ‫ٔجظ‬ ٛ٘ ‫ثٌضّجط‬ْ‫وج‬ ٟ‫ف‬ ‫إال‬ ‫ثٌضالِظ‬ ‫٠ّىّٕٙج‬ ‫ال‬ ٓ١‫عطق‬ ْ‫دؤ‬ ‫صمٛي‬ ٟ‫ثٌض‬ ٓ١‫عطق‬ َ‫ٌضظجد‬ ‫ثٌف١ض٠جة١ز‬ ‫ٌٍقجٌز‬ ً‫ج‬‫صذؼ‬ ‫ٚرٌه‬ ّ‫ثٌؾغ‬ ْ‫أ‬ ‫ثػضذجس‬ ٍٝ‫ػ‬ ‫وجٍِز‬ ‫غ١ش‬ ‫ثٌقجٌز‬ ٖ‫٘ز‬ ٓ‫ٌٚى‬ ‫ثٌؾٙز‬ ٟ‫ف‬ ٓ١‫ِضؼجوغ‬ ‫عطق١ّٙج‬ ّٟ‫ٔجظ‬ْ‫أ‬ ‫٠ّىّٕٙج‬ ٓ١ ً‫ج‬١ٍّ‫ػ‬ ‫ثٌضطذ١ك‬ ‫ػٕذ‬ ٜ‫أؽذ‬ ْٛ‫٠ى‬ ‫ثألٚي‬ ‫ثٌغطـ‬ ُ‫ٔجظ‬ ‫ِغ‬ ًِ‫ٚثٌضؼج‬ ‫فجٌشؽٛع‬ ٌٟ‫ٚدجٌضج‬ ٜ‫عٕش‬ ‫وّج‬ ‫٠ضذثخال‬. ‫ثٌض‬ ‫ٔمطز‬ ‫فغجح‬ً‫ج‬‫غجٌذ‬ ‫طؼخ‬ ‫أِش‬ ٛ٘ ‫ّجط‬‫ٚػجدر‬ً‫ال‬‫ٚصذثخ‬ ً‫ج‬‫ػّم‬ ‫ثألوغش‬ ‫ثٌٕمطز‬ ‫ٔؤخز‬ ‫ِج‬‫ثٌش‬ ٓ١‫٠ذ‬ ‫وّج‬ً‫ى‬.
  27. 27. STYX Physics Engine with Augmented Reality STYX Team Page 26 1.3.ً‫اىصذ‬ ‫مشف‬Collision Detection ‫ادم‬‫ا‬‫الص‬ ‫اف‬‫ا‬‫كش‬ ‫أن‬ ‫اا‬‫ا‬‫بم‬‫امن‬‫ا‬‫ض‬ ‫اة‬‫ا‬ٌ‫عمل‬ ‫أي‬ ‫ارٌع‬‫ا‬‫لتس‬ ‫ارق‬‫ا‬‫ط‬ ‫ان‬‫ا‬‫ع‬ ‫اث‬‫ا‬‫البح‬ ‫اب‬‫ا‬‫فٌج‬ ‫ا‬‫ا‬‫اد‬‫ا‬‫ج‬ ‫اة‬‫ا‬‫مكلف‬ ‫اة‬‫ا‬ٌ‫عمل‬ ‫اه‬‫ا‬‫ومعالجت‬ .‫أمكن‬ ‫ما‬ ‫السابقتٌن‬ ‫المرحلتٌن‬ ‫السابقتٌن‬ ‫المرحلتٌن‬ ‫معالجة‬ ‫تسرٌع‬ ‫تقنٌات‬ ‫ٌخص‬ ‫فٌما‬ ‫طرق‬ ‫لعدة‬ ‫باللجوء‬ ‫ا‬‫ا‬‫غالب‬ ‫الفٌزٌائٌة‬ ‫المحركات‬ ‫تقوم‬ ‫الصدم‬ ‫كشف‬ ‫مراحل‬ ‫كتعدد‬‫أو‬.‫معالجته‬‫عاالم‬ ‫بتقساٌم‬ ‫األفكار‬ ‫بعض‬ ‫تقوم‬‫فٌاه‬ ‫ٌحادث‬ ‫الاذي‬ ‫(العاالم‬ ‫المساألة‬ ( ‫مكعباات‬ ‫إلى‬ )‫التصادم‬QuadTree‫وتكارار‬ ‫المكعاب‬ ‫نفاس‬ ‫ضامن‬ ‫تقاع‬ ً‫التا‬ ‫األجساام‬ ‫مقارناة‬ ‫ثام‬ ‫ومان‬ ) ‫األصااغر‬ ‫المكعبااات‬ ‫ضاامن‬ ‫ا‬‫ا‬‫عمقاا‬ ‫بااالتجول‬ )‫وجااوده‬ ‫حااال‬ ً‫(فاا‬ ‫التصااادم‬ ‫مكااان‬ ‫علااى‬ ‫للحصااول‬ ‫العملٌااة‬ .‫فاألصغر‬ ‫الت‬ ‫(أو‬ ‫الحصول‬ ‫إمكانٌة‬ ‫على‬ ‫هنا‬ ‫المطروحة‬ ‫الفكرة‬ ‫تقوم‬ً‫فا‬ ‫الخاوض‬ ‫دون‬ ‫وذلاك‬ ‫ال‬ ‫أم‬ ‫صادم‬ ‫بوجود‬ )‫ّؤ‬‫ب‬‫ن‬ ‫ا‬‫ا‬‫جاد‬ ‫المتباعادة‬ ‫األجساام‬ ‫حالاة‬ ً‫فا‬ ‫الصادم‬ ‫لكشاف‬ ‫الاالزم‬ ‫الازمن‬ ‫ٌقل‬ ‫وذلك‬ ‫كاملة‬ ‫الصدم‬ ‫كشف‬ ‫مراحل‬ ‫كل‬ .‫ا‬‫ا‬‫جد‬ ‫كبٌر‬ ‫بشكل‬ ‫الخوارزمٌة‬ ‫تعقٌد‬ ‫تخفٌف‬ ً‫وبالتال‬ ‫ا‬‫ال‬‫مث‬ ‫تعتمد‬‫ِشفٍز‬ٍٝ‫ػ‬ً‫ث‬‫دجوش‬ َ‫ثٌظذ‬ ‫وشف‬َ‫ثٌضظجد‬ ‫ٔٛع‬ً١‫ِغعضط‬ ‫ِعغ‬ ‫(وشر‬ٚ‫أ‬‫ِعغ‬ ً١‫ِغعضط‬‫ِغع‬ً١‫ضط‬ٚ‫أ‬،))‫ثٌع‬ .. َ‫ثٌضظجد‬ ‫أٔٛثع‬ ‫دؼغ‬ ‫صٛؽذ‬ ‫وّج‬ٟ‫ثٌض‬ٌٝ‫إ‬ ‫صقضجػ‬ ‫ال‬‫وشف‬ ‫ِشفٍز‬ ِٓ ‫أوغش‬)ٞٛ‫ِغض‬ ‫ِغ‬ ‫وشر‬ :‫(ِغجي‬ٓ١‫ٚععٕذ‬ .ٜ‫عٕش‬ ‫وّج‬ ً‫ج‬‫الفم‬ ‫٘زث‬ ‫ثٌّخضظز‬ ‫ثإلؽشثة١جس‬ ِٓ ‫ِؾّٛػز‬ ْ٢‫ث‬ ‫عٕؼشع‬ْٚٛ‫ٚ٠ى‬ ،َ‫ثألؽغج‬ ‫ٔٛع‬ ‫فغخ‬ ٝ‫صغضذػ‬ ٟ‫ثٌض‬ ‫ث‬ ‫ِؼٍِٛجس‬ ‫صٌٛ١ذ‬ َ‫ٌٍضظجد‬ ‫وشفٙج‬ ‫دؼذ‬ ‫ثإلؽشثة١جس‬ ٖ‫٘ز‬ ‫٘ذف‬ً‫ج‬‫الفم‬ ‫ٌّؼجٌؾضٙج‬ ‫ثٌّٕجعذز‬ ‫ٌضّجط‬.
  28. 28. STYX Physics Engine with Augmented Reality STYX Team Page 27 1.3.1.‫مش‬ ً‫تصبد‬ُِ‫ت‬Colliding Spheres ْ‫وشصج‬ ‫صؼضذش‬.‫لطش٠ّٙج‬ ٟ‫ٔظف‬ ‫ِؾّٛع‬ ِٓ ‫أطغش‬ ‫ِشوض٠ّٙج‬ ٓ١‫د‬ ‫ثٌذؼذ‬ ْ‫وج‬ ‫إرث‬ ْ‫ِضظجدِضج‬ ‫أّٔٙج‬ ْ‫فئ‬ ‫ٚثفذ‬ ‫عطـ‬ ِٓ ‫ِىٛٔز‬ ‫وشر‬ ً‫و‬ ْ‫أ‬ ‫ٚدّج‬ ‫ٚثفذر‬ ‫ٔمطز‬ ٟ‫ف‬ ْ‫ع١ٍضم١ج‬ ‫فئّٔٙج‬ ٓ١‫وشص‬ َ‫صظجد‬ ‫فجي‬ ٟ‫ف‬ ‫ٔٛع‬ ِٓ ْٛ‫ع١ى‬ ‫ثٌٕجشب‬ َ‫ثٌضظجد‬face – face)ً‫صذثخ‬ ‫ٚؽٛد‬ ‫ثالػضذجس‬ ٓ١‫دؼ‬ ‫ثألخز‬ ‫ِغ‬ ً‫ج‬‫(ؽذؼ‬. 1.3.1.‫مشح‬ ً‫تصبد‬-ٌ‫ٍغتى‬Colliding a Sphere and a Plane ‫ِغ‬ ‫ِضظجدِز‬ ‫صؼضذش‬ ‫ثٌىشر‬ٞٛ‫ِغض‬ٓ١‫د‬ ‫ثٌّغجفز‬ ‫وجٔش‬ ‫إرث‬ ‫ثٌىشر‬ ‫ِشوض‬ٚٞٛ‫ثٌّغض‬.‫ثٌىشر‬ ‫لطش‬ ‫ٔظف‬ ِٓ ً‫أل‬ ٓ١‫د‬ ‫ثٌّغجفز‬ ‫صقغخ‬ٞٛ‫ِٚغض‬ ‫ٔمطز‬‫دجٌؼاللز‬‫ثٌضجٌ١ز‬: ‫المستوي‬ ‫ناظم‬ ‫ثإلفذثع١جس‬ ‫ِشوض‬ ٓ‫ػ‬ ٞٛ‫ثٌّغض‬ ‫دؼذ‬ Vector3 midline = positionOne - positionTwo; real size = midline.magnitude(); // See if it is large enough. if (size <= 0.0f || size >= one.radius+two.radius) { return 0; }
  29. 29. STYX Physics Engine with Augmented Reality STYX Team Page 28 :ً‫دجٌشى‬ ‫ثٌخٛثسصِ١ز‬ ْٛ‫صى‬ ٌٟ‫ٚدجٌضج‬ 1.3.1.ً‫تصبد‬‫ٍنؼت‬–ٌ‫ٍغتى‬Colliding a Box and a Plane َ‫صظجد‬ ‫ػٕذ‬‫فجفز‬‫ِغ‬ ً١‫ثٌّغضط‬ٞٛ‫ِغض‬ ٟ‫ٔمطض‬ َ‫صظجد‬ ٛ٘ َ‫ثٌضظجد‬ ‫٘زث‬ ‫٠ؼضذش‬ .‫ثٌغطـ‬ ‫ِغ‬ ٓ١‫ثٌطشف‬ٍّٗ‫ٔغضؼ‬ ٞ‫ثٌز‬ ‫ثٌفقض‬ ‫فىشر‬ ‫ِغ‬ َ‫ثٌّغضخذ‬ ٗ‫٠شذ‬ ‫ٕ٘ج‬ َ‫ثٌضظجد‬ ‫ٌىشف‬ ‫وشر‬ َ‫صظجد‬‫ِغ‬ٞٛ‫ِغض‬ٍٝ‫ػ‬ ‫ٕ٘ج‬ ‫٠طذك‬ ٓ‫ٌٚى‬ .ً‫ثٌشى‬ ‫ٔمجؽ‬ ِٓ ‫ٔمطز‬ ً‫و‬‫٠ٛؽذ‬ ‫ال‬ ‫ٕ٘ج‬ ٓ‫ٌى‬ ‫لطش‬ ‫ٔظف‬ ‫ٌذ٠ٕج‬ْ‫دؤ‬ َ‫ثٌضظجد‬ ٓ‫ػ‬ ‫ٔؼذش‬ ‫ٌزٌه‬ ْٛ‫٠ى‬:ٞٛ‫ثٌّغض‬ ‫ِغ‬ ‫ثٌىشر‬ ٟ‫ف‬ ‫وّج‬ ‫المستوي‬ ‫ناظم‬ ‫ثإلفذثع١جس‬ ‫ِشوض‬ ٓ‫ػ‬ ٞٛ‫ثٌّغض‬ ‫دؼذ‬ :‫ثٌششؽ‬ ‫صقمك‬ ‫٠ؾخ‬ ‫ف١ظ‬ real ballDistance = plane.direction * position - sphere.radius - plane.offset; if (ballDistance >= 0) return 0;
  30. 30. STYX Physics Engine with Augmented Reality STYX Team Page 29 1.3.2.‫مشح‬ ً‫اصطذا‬-‫ٍنؼت‬Colliding a Sphere and a Box ْ‫أ‬ ٓ‫٠ّى‬ ‫ثٌضّجط‬ ‫ّٔؾ‬ ْ‫فئ‬ ‫ثٌّىؼخ‬ ‫ِغ‬ ‫ثٌىشر‬ َ‫صظذ‬ ‫ػٕذِج‬ .‫ثٌشٟء‬ ‫دؼغ‬ ‫ثٌؼٍّ١جس‬ ‫ثٌّىؼخ‬ ‫٠ؼمذ‬ ٗ‫ٚؽ‬ ‫ٔٛع‬ :ً‫شى‬ ٞ‫أ‬ ِٓ ْٛ‫٠ى‬-ٗ‫ٚؽ‬Face-Faceِٓ ٚ‫أ‬‫ٔٛع‬‫فجفز‬-ٗ‫ٚؽ‬Edge-Face‫ٔٛع‬ ِٓ ٚ‫أ‬ ‫ٔمطز‬-ٗ‫ٚؽ‬Point-Face. ٓ‫ػ‬ ً‫ج‬‫ػٛػ‬ ‫ٔمطز‬ ‫ٔٛع‬ ِٓ ‫صّجط‬ ٌٝ‫إ‬ ‫ثٌقجٌز‬ ٖ‫٘ز‬ ٟ‫ف‬ َ‫ثٌظذ‬ ‫دئسؽجع‬ َٛ‫ٔم‬ ْ‫دؤ‬ ‫ثٌؼٍّ١ز‬ ‫صذغ١ؾ‬ ‫٠ّىٕٕج‬ .‫وشر‬‫ث‬ ‫صٍؼخ‬ ‫ثٌقجالس‬ ٖ‫٘ز‬ ً‫و‬ ٟ‫ف‬‫ثٌغ‬ ‫دٚس‬ ‫ٌىشر‬‫طـ‬‫ف١ظ‬ُ‫د‬ ‫ثخضذجس‬ ُ‫٠ض‬ٓ‫ػ‬ ً١‫ثٌّغضط‬ ‫ٔمجؽ‬ ‫وجفز‬ ‫ؼذ‬ .‫ثٌىشر‬‫ثٌضظجد‬ ‫٠قذط‬ ‫ػٕذ٘ج‬ ،‫ثٌىشر‬ ‫لطش‬ ‫ٔظف‬ ِٓ ً‫أل‬ ‫ٚثٌىشر‬ ‫ٔمطز‬ ‫ألشح‬ ٓ١‫د‬ ‫ثٌذؼذ‬ ‫أطذـ‬ ‫إرث‬َ. :‫ثٌضجٌ١ز‬ ‫ثٌّؼط١جس‬ ‫ٔقضجػ‬ ‫ف١ظ‬ // Transform the center of the sphere into box coordinates Vector3 center = sphere.getAxis(3); Vector3 relCenter = box.transform.transformInverse(center);
  31. 31. STYX Physics Engine with Augmented Reality STYX Team Page 30 1.3.3.ً‫تصبد‬‫ٍنؼت‬-‫ٍنؼت‬Colliding two boxes ‫ثٌٕٛع‬ ‫٘زث‬ ‫فغجدجس‬ ْ‫إ‬‫ثألوغ‬ ٛ٘ ‫ثٌضظجدِجس‬ ِٓ‫ثٌضظجدِجس‬ ‫أٔٛثع‬ ‫ؽّ١غ‬ ٓ١‫د‬ ‫وٍفز‬ ‫ش‬‫٠ٛؽذ‬ ‫ف١ظ‬ ‫ٌذ٠ٕج‬:‫ثٌضجٌ١ز‬ ‫ثٌقجالس‬ ‫ؽّ١غ‬ ٌ‫ث‬ ‫ٌّؼجٌؾز‬ ً‫ال‬ٛ‫ٚط‬ ‫ثٌقجالس‬ ‫ؽّ١غ‬ ‫صؾٕخ‬ ‫ٔقجٚي‬١‫قجٌض‬ٓ‫(ٔمطز‬–)‫فجفز‬ٚ‫أ‬‫(فجفز‬–)‫فجفز‬‫ؽّ١غ‬ ْ‫أل‬ ‫ٚرٌه‬ ٌٟ‫ثٌضج‬ ً‫ثٌشى‬ ٓ١‫٠ذ‬ ‫وّج‬ ‫ٚأعشع‬ ‫أدغؾ‬ ‫صّجط‬ ‫ٌقجالس‬ ‫صقٛ٠ٍٙج‬ ٓ‫ٚ٠ّى‬ ‫ِىٍفز‬ ٜ‫ثألخش‬ ‫ثٌقجالس‬.
  32. 32. STYX Physics Engine with Augmented Reality STYX Team Page 31 ً‫ج‬١ٍّ‫ػ‬ِ ‫ثٌضظجدِجس‬‫(ٔمطز‬ ‫ٔٛع‬ ٓ–)‫ٔمطز‬‫(ٔمطز‬ ‫ٔٛع‬ ِٓ ٚ‫أ‬-)‫فجفز‬‫صقذط‬ ‫ال‬ً‫ث‬‫ؽذ‬ ً‫ث‬‫ؽذ‬ ‫لٍ١ٍز‬ ‫دٕغذز‬ ‫إال‬ َ‫ػذ‬ ٌٝ‫إ‬ ‫إػجفز‬ ٟ‫ثٌف١ض٠جة‬ ‫ثٌّقشن‬ ّٓ‫ػ‬ ‫إٌٙج‬ ‫ثٌٕظش‬ ُ‫٠ض‬ ٌُ ٌٟ‫ٚدجٌضج‬ُ‫ٔجظ‬ ‫ٌقغجح‬ ‫ٚثػقز‬ ‫ؽش٠مز‬ ‫ٚؽٛد‬ ‫أل‬ ‫ٔغّـ‬ ٌٟ‫ٚدجٌضج‬ .‫ثٌضّجط‬‫ٔٛثع‬‫ثٌضظجدِجس‬ًٍ‫خ‬ ٞ‫أ‬ ‫فظٛي‬ ْٚ‫دذ‬ ‫ِؼجٌؾضٙج‬ ُ‫٠ض‬ ُ‫ع‬ ِٓٚ ‫دجٌقذٚط‬ ٜ‫ثألخش‬ ٟ‫ف١ض٠جة‬. :‫ثٌضجٌ١ز‬ ً‫دجٌّشثف‬ ‫صّش‬ ٓ١‫ِىؼذ‬ ٓ١‫د‬ ‫ثٌضظجدِجس‬ ‫وشف‬ ‫خٛثسصِ١ز‬ ً‫ج‬‫خجسؽ‬ ‫(ثألعٛء‬ ‫ػٍّ١ز‬ ‫دئؽشثء‬ َٛ‫ٔم‬ً‫ال‬ٚ‫أ‬Early-Out‫ثٌفظ‬ ‫خٛثسصِ١ز‬ َ‫دجعضخذث‬ )ٓ‫ػ‬ ً ‫ثٌّقجٚس‬ ‫ؽش٠ك‬Separating Axes.‫ثٌذسثعز‬ ٟ‫ف‬ ‫ثٌّششٚفز‬ ‫فمؾ‬ ٚ‫ٚثفذ‬ ‫صّجط‬ ‫ٔمطز‬ ‫ٌّؼشفز‬ ًِ‫وج‬ َ‫طذ‬ ‫ثخضذجس‬ ‫دئؽشثء‬ َٛ‫ٔم‬ ٓ١‫ثٌّىؼذ‬ ٓ١‫د‬ ً‫ج‬‫ِغذم‬ ‫ثٌّٛؽٛدر‬ ‫ثٌضّجط‬ ‫ٔمجؽ‬ ٌٝ‫إ‬ ً‫ث‬‫آخش‬ ‫ثٌّقغٛدز‬ ‫ثٌضّجط‬ ‫ٔمطز‬ ُ‫دؼ‬ َٛ‫ٔم‬
  33. 33. STYX Physics Engine with Augmented Reality STYX Team Page 32 1.3.4.‫اىتَبط‬ ‫ّقبغ‬ ‫حغبة‬ ٍ‫ف‬ ‫اىَغبػذح‬ ‫اىخىاسصٍُبد‬ً‫اىصذ‬ ‫ومشف‬ 1.3.4.1.‫اىفبصيخ‬ ‫اىَحبوس‬ ‫خىاسصٍُخ‬Separating Axes "ً‫ال‬ٚ‫أ‬ ً‫ج‬‫خجسؽ‬ ‫"ثألعٛأ‬ ‫ِذذأ‬ ٍٝ‫ػ‬ ‫ثٌخٛثسصِ١ز‬ ٖ‫٘ز‬ ‫صؼضّذ‬Early out.‫أوغش‬ ِٓ ‫ثٌخٛثسصِ١ز‬ ٖ‫٘ز‬ ‫صؼضذش‬ :ٌٟ‫ثٌضج‬ ‫ثٌّذذأ‬ ٍٝ‫ػ‬ َٛ‫صم‬ ‫ثألعجع١ز‬ ‫فىشصٙج‬ ،َ‫ثٌظذ‬ ‫وشف‬ ٟ‫ف‬ ً‫ج‬ِ‫ثعضخذث‬ ‫ثٌخٛثسصِ١جس‬ ٓ١ّ‫ؽغ‬ ْٛ‫٠ى‬ ‫دق١ظ‬ ‫ثٌفشثؽ‬ ٟ‫ف‬ ٖ‫ثصؾج‬ ٞ‫أ‬ ‫ٚؽٛد‬ ‫فجي‬ ٟ‫"ف‬‫غ١ش‬ ‫فّٙج‬ ،ٓ١ِ‫ِضظجد‬ ‫غ١ش‬ )ٓ١‫(ِقذد‬ ‫ِج‬ ".ً‫ث‬‫أدذ‬ ٓ١ِ‫ِضظجد‬ ٌ‫ٍغتى‬ ‫ٍغ‬ ‫ٍغتطُو‬ ً‫تصبد‬ ‫ف١ظ‬ ،‫دغ١طز‬‫ٔمجؽ‬ ِٓ ‫ٔمطز‬ ‫ألشح‬ ‫دئ٠ؾجد‬ َٛ‫ٔم‬،ٞٛ‫ثٌّغض‬ ٌٝ‫إ‬ ‫ثٌّغضط١الس‬ ٞ‫ِضٛثص‬ٖ‫٘ز‬ ‫وجٔش‬ ‫فئرث‬ ‫صذثخ‬ ‫ٌذ٠ٕج‬ ْٛ‫٠ى‬ ‫ػٕذ٘ج‬ ‫عجٌذز‬ ‫ثٌّغجفز‬ٓ١ّ‫ثٌؾغ‬ ٓ١‫د‬ ً. ‫ٍغتطُو‬ ‫ٍغ‬ ‫مشح‬ ً‫تصبد‬ ‫ثٌذثةشر‬ ٟ‫ٔمطض‬ ‫ٔفقض‬‫ِقٛس‬ ٍٝ‫ػ‬ ٓ١‫ثٌٕمطض‬ ٓ١‫٘جص‬ ٜ‫إفذ‬ ‫ِغمؾ‬ ْ‫وج‬ ‫فئرث‬ ً١‫ٌٍّغضط‬ ‫ثأللشح‬ ً١‫ثٌّغضط‬ ‫دؼذ‬ ِٓ ‫أوذش‬ ‫ثٌّٛثفك‬ ً١‫ثٌّغضط‬ٍُ‫ٔؼ‬ ‫ػٕذةز‬ ،‫ثٌذثةشر‬ ‫فجٌز‬ ٟ‫ف‬ ‫وّج‬ َ‫صظجد‬ ‫ٌذ٠ٕج‬ ‫ٌ١ظ‬ ٗٔ‫أ‬ A.‫ثٌّؾجٚس‬ ً‫ثٌشى‬ ٟ‫ف‬ ‫صؤوذ‬ ‫ٔض١ؾز‬ ‫ٌٕج‬ َ‫صمذ‬ ٌُ ‫ثٌضظجدِجس‬ ِٓ ‫ثٌٕٛع‬ ‫٘زث‬ ٟ‫ف‬ ٌٝٚ‫ثأل‬ ‫ثٌّشفٍز‬ ْ‫أ‬ ‫ٕ٘ج‬ ‫ثٌّالفظز‬ ‫٠ؾخ‬ ‫فذ‬‫ثٌذثةشر‬ ‫فجٌز‬ ٟ‫ف‬ ‫وّج‬ َ‫ثٌضظجد‬ ‫ٚط‬B‫ٌذ٠ٕج‬ ‫٠ٕضؼ‬ ٌُ ٓ‫ٌى‬ ٚ ً‫ِضذثخ‬ ٓ١‫ثٌّغمط‬ ‫فىال‬ ً‫ثٌشى‬ ٟ‫ف‬ َ‫ػذ‬ ٚ‫أ‬ َ‫ثٌضظجد‬ ‫فذٚط‬ ‫ٌضؤو١ذ‬ ‫ثٌغجٔ١ز‬ ‫ثٌّشفٍز‬ ٌٝ‫إ‬ ‫ٔقضجػ‬ ‫عٛف‬ ‫ثٌقجالس‬ ٖ‫٘ز‬ ً‫ِغ‬ ٟ‫ف‬ ٚ َ‫صظجد‬ ٗ‫فذٚع‬ٟ‫ف‬ ‫صف١ذ‬ ‫ٚال‬ ً‫ال‬‫ِغ‬ ‫ٚثفذر‬ ‫فجٌز‬ ٟ‫ف‬ ‫ٕ٘ج‬ ‫صف١ذ‬ ‫ثٌفجطٍز‬ ‫ثٌّقجٚس‬ ‫خٛثسصِ١ز‬ ْ‫أ‬ ‫ٔؾذ‬ ٌٟ‫ٚدجٌضج‬ .ٜ‫ثألخش‬
  34. 34. STYX Physics Engine with Augmented Reality STYX Team Page 33 ‫ٍغ‬ ‫ٍغتطُو‬ ً‫تصبد‬‫آخش‬ ‫ٍغتطُو‬ ٟ‫ف‬ ‫دل١ك‬ ‫فقض‬ ٌٝ‫إ‬ ‫ٔقضجػ‬ ‫عٛف‬ ‫ٌزٌه‬ ٍٝ‫ثألػ‬ ‫ثٌىٍفز‬ ٚ‫ر‬ ‫ثٌضظجدِجس‬ ِٓ ‫ثٌٕٛع‬ ‫٘زث‬ ْٛ‫ٌى‬ ً‫ث‬‫ٔظش‬ ُ٠ ‫ثٌّشفٍز‬ ٖ‫٘ز‬‫ّى‬‫ثٌّشفٍز‬ ‫ثخضذجس‬ ً‫لذ‬ ‫ِذجششر‬ ٗ‫فذٚع‬ َ‫ػذ‬ ٚ‫أ‬ َ‫صظجد‬ ‫فذٚط‬ ‫فجٌز‬ ‫ِؼشفز‬ ِٓ ‫ٕٕج‬ ‫ثٌغجٔ١ز‬ٚ‫دجٌض‬ٌٟ‫ج‬‫٠ّىٕٕج‬.ٓ١ّ‫ثٌؾغ‬ َ‫صظجد‬ َ‫ػذ‬ ‫فجي‬ ٟ‫ف‬ ‫ثٌخٛثسصِ١ز‬ ٖ‫٘ز‬ ‫صؼم١ذ‬ ‫صمٍ١ض‬
  35. 35. STYX Physics Engine with Augmented Reality STYX Team Page 34 ٌٟٛ‫ثٌط‬ ٓ٠‫دجٌّقٛس‬ ‫ثٌّضّغٍز‬ ‫ثألسدؼز‬ ‫ثٌّقجٚس‬ ٍٝ‫ػ‬ ‫ٌإلعمجؽ‬ ‫فمؾ‬ ‫ٔقضجػ‬‫ٚث‬‫ٌىال‬ ٟ‫ٌؼشػ‬ ٓ١ٍ١‫ثٌّغضط‬xAxis, yAxis. ً‫ثٌشى‬ ٟ‫ف‬ٌٝٚ‫ثأل‬ ‫ثٌقجٌز‬ ٟ‫ف‬ ‫ثٌغجدك‬‫ِؼشفز‬ ِٓ ٓ‫ٔضّى‬ ٌُ ٓ‫ٌى‬ ٚ ً‫ال‬‫صذثخ‬ ‫ٌٕج‬ ‫أظٙش‬ ‫ثٌّقٛس‬ ٍٝ‫ػ‬ ‫ثإلعمجؽ‬ ‫إال‬ َ‫ثٌضظجد‬ ‫فذٚط‬‫أِج‬ ،ٜ‫ثألخش‬ ‫ثٌّقجٚس‬ ٍٝ‫ػ‬ ‫دجإلعمجؽ‬‫ف‬ ‫ثٌغجٔ١ز‬ ‫ثٌقجٌز‬‫ٚثفذ‬ ‫إعمجؽ‬ ‫١ىف١ٕج‬ٍٝ‫ػ‬ ‫(ٕ٘ج‬ ٌ ٌٟٛ‫ثٌط‬ ‫ثٌّقٛس‬ُ‫ٍؾغ‬Bَ‫صظجد‬ ‫ٚؽٛد‬ َ‫ػذ‬ ِٓ ‫ٌٕضؤوذ‬ ‫ثألسدؼز‬ ‫ثإلعمجؽجس‬ ِٓ ). 1.3.5.‫اىتَبط‬ ‫تىىُذ‬Contact Generation ‫اىتَبط‬‫ّقطخ‬ ‫ّىع‬ ٍِ–‫حبفخ‬Point- Face :‫ثٌّؾجٚس‬ ً‫ثٌشى‬ ٟ‫ف‬ ‫وّج‬ :‫ثٌضجٌ١ز‬ ‫دجٌخطٛثس‬ ‫ثٌخٛثسصِ١ز‬ ‫صّش‬ a.ُ‫ثٌؾغ‬ ِٓ ‫ٔمطز‬ ً‫و‬ ً‫أؽ‬ ِٓA. b.ٔ‫قغخ‬ٌ‫ث‬ً‫ضذثخ‬ُ‫ثٌؾغ‬ ‫ِغ‬B. c.‫ثٌّٛثفم‬ ٝٔ‫ثألد‬ ً‫ثٌضذثخ‬ ‫ل١ّز‬ ‫ٔؤخز‬‫ز‬. d.ُ‫ثٌؾغ‬ ‫ٔمجؽ‬ ‫ؽّ١غ‬ ً‫أؽ‬ ِٓ ‫ثٌغجدك‬ ‫ثٌفقض‬ ‫ٔؼ١ذ‬Bُ‫ثٌؾغ‬ ‫ِغ‬A. e.‫ثٌض‬ ٓ١‫د‬ ِٓ ‫ٔخضجس‬‫ذث‬ٍٝ‫ثألػ‬ ‫ثٌم١ّز‬ ٚ‫ر‬ ً‫ثٌضذثخ‬ ‫خالس‬)ً‫ال‬‫صذثخ‬ ‫(ثألوغش‬.
  36. 36. STYX Physics Engine with Augmented Reality STYX Team Page 35 ‫حبفخ‬ ‫ّىع‬ ٍِ ‫اىتَبط‬-‫حبفخ‬Edge-Edge ‫فجف‬ ً‫و‬ ‫أخز‬ ٌٝ‫إ‬ ‫ٕ٘ج‬ ‫ٔقضجػ‬ ‫ف١ظ‬ ‫عجدمضٙج‬ ِٓ ً‫ال‬١ٍ‫ل‬ ‫أػمذ‬ ‫ثٌقجٌز‬ ٖ‫٘ز‬ ْ‫إ‬‫ثألٚي‬ ً١‫ثٌّغضط‬ ِٓ ‫ز‬ ‫ِغ‬ً‫و‬‫ثالخش‬ ً١‫ثٌّغضط‬ ‫فجفجس‬‫ٚفغجدٙج‬ ٓ١‫فجفض‬ ً‫و‬ ٓ١‫د‬ ‫ثٌّغجفز‬ ‫دؤخز‬ ‫ٕ٘ج‬ ْٛ‫٠ى‬ ‫ثٌفقض‬ ٓ‫ٌٚى‬ ٓ‫ػ‬ٜ‫ثألخش‬ ‫ثٌقجفز‬ ٌٝ‫إ‬ ٓ١‫ثٌقجفض‬ ٜ‫إفذ‬ ِٓ ‫ٔمطز‬ ‫ألشح‬ ‫إ٠ؾجد‬ ‫ؽش٠ك‬ٚ.‫دجٌؼىظ‬ ٓ١‫ثٌّضذثخٍض‬ ٓ١‫ثٌقجفض‬ ٍٝ‫ػ‬ ‫ثٌقظٛي‬ ‫ػٕذ‬‫ٚرٌه‬‫ِشثس‬ ‫ػذر‬ ‫ثٌفقض‬ ‫٘زث‬ ‫صىشثس‬ ‫دؼذ‬،‫لذ‬ ْٛ‫ٔى‬ ‫ث٢خش‬ ً١‫ثٌّغضط‬ ‫ِشوض‬ ٌٝ‫إ‬ ٓ١ٍ١‫ثٌّغضط‬ ‫وال‬ ِٓ ‫ٔمطز‬ ‫ألشح‬ ‫ٚؽذٔج‬،ٍٚٝ‫ػ‬ ‫فظٍٕج‬ ٌٟ‫دجٌضج‬ ‫ثٌضّجط‬ ‫ٔمطز‬.‫ثٌّطٍٛدز‬ ‫صؤخز‬:ٌٟ‫ثٌضج‬ ً‫ثٌشى‬ ‫ثٌخٛثسصِ١ز‬ a.‫فجفز‬ ً‫و‬ ً‫أؽ‬ ِٓEُ‫ثٌؾغ‬ ِٓA. b.ُٔ‫ثٌؾغ‬ ِٓ ‫فجفز‬ ً‫و‬ ‫ِغ‬ ‫صذثخٍٙج‬ ‫قغخ‬B. c.ٝٔ‫ثألد‬ ً‫ثٌضذثخ‬ ‫ل١ّز‬ ‫ٔؤخز‬‫ثٌقجفز‬ ٖ‫٘ز‬ ً‫أؽ‬ ِٓٓ‫ٌٚ١ى‬E. d.‫ثٌض‬ ٓ١‫د‬ ِٓ ‫ٔخضجس‬‫ذث‬ٍٝ‫ثألػ‬ ‫ثٌم١ّز‬ ٚ‫ر‬ ً‫ثٌضذثخ‬ ‫خالس‬)ً‫ال‬‫صذثخ‬ ‫(ثألوغش‬ُ‫ثٌؾغ‬ ِٓA.
  37. 37. STYX Physics Engine with Augmented Reality STYX Team Page 36 1.4.ً‫اىصذ‬ ‫ٍؼبىجخ‬Collision Resolution .‫الصدم‬ ‫معالجة‬ ‫اآلن‬ ‫حان‬ ‫فقد‬ ،‫الصدم‬ ‫بكشف‬ ‫قمنا‬ ‫أن‬ ‫بعد‬‫من‬ ً‫رئٌس‬ ‫بشكل‬ ‫التصادم‬ ‫معالجة‬ ‫تتضمن‬ ‫لها‬ ‫شكل‬ ‫بأبسط‬ ‫التالٌة‬ ‫الخوارزمٌة‬‫الفقرات‬ ً‫ف‬ ‫بالتفصٌل‬ ‫خطواتها‬ ‫من‬ ‫خطوة‬ ‫كل‬ ‫شرح‬ ‫سٌتم‬ ً‫والت‬ ‫التالٌة‬: 1-‫ثٌّطٍٛدز‬ ‫ثالٔفظجي‬ ‫عشػز‬ ‫دقغجح‬ َٛ‫ٔم‬Separating Velocity:‫ثٌضجٌ١ز‬ ‫ثٌؼاللز‬ ِٓ ‫ثٌضّجعجس‬ ‫ؽّ١غ‬ ً‫أؽ‬ ِٓContacts‫ثخض١جس‬ ‫ػٍّ١ز‬ ‫ٚصخضٍف‬ ‫ثٌضّجعجس‬ ً‫دق‬ َٛ‫ٔم‬ ،ٓ١ّ‫ثٌؾغ‬ ٓ١‫د‬ ٟ‫ثٌض‬ ٜ‫عٕش‬ ‫وّج‬ ‫دٙج‬ ‫ثوضشفش‬ ٟ‫ثٌض‬ ً‫دجٌضغٍغ‬ ‫ِؼجٌؾضٙج‬ ُ‫٠ض‬ ْ‫أ‬ ‫دجٌؼشٚسر‬ ‫فٍ١ظ‬ ‫د١ٕٙج‬ ‫ف١ّج‬ ‫ثٌضّجعجس‬ ‫ِؼجٌؾز‬ .‫وذ١ش‬ ً‫دشى‬ ‫ثٌظٙٛس‬ ِٓ ً‫ثٌضذثخ‬ ً‫ِغ‬ ٜ‫أخش‬ ‫ظٛث٘ش‬ ‫٠ّٕغ‬ ‫دّج‬ ‫ٌزٌه‬ ‫ثعضشثص١ؾ١جس‬ ‫ػذر‬ ‫٠ٛؽذ‬ ‫ف١ظ‬ 2-‫ثٌغشػز‬ ‫وجٔش‬ ‫فجي‬ ٟ‫ف‬‫دئ٠مجف‬ َٛ‫ٔم‬ )ٍٗ‫ف‬ ُ‫ص‬ ‫لذ‬ َ‫ثٌضظجد‬ ْ‫أ‬ ٟٕ‫٠ؼ‬ ‫(ِّج‬ ‫ٌٍظفش‬ ‫ِغجٚ٠ز‬ ّٝ‫ثٌؼظ‬ .‫ثٌخٛثسصِ١ز‬ 3-‫ثٌذفغ‬ ‫دقغجح‬ ُ‫صض‬ َ‫ثٌضظجد‬ ً‫ف‬ ‫ػٍّ١ز‬impulse‫ثٌخط١ز‬ ٗ١‫ِشوذض‬ ‫خالي‬ ِٓ َ‫ثٌضظجد‬ ً‫ٌق‬ ‫ثٌّطٍٛح‬ .‫ٚثٌضثٚ٠ز‬ :ٌٟ‫ج‬‫ثٌض‬ ْٛٔ‫دجٌمج‬ ٝ‫٠ؼط‬ ٟ‫ثٌخط‬ ‫ثٌذفغ‬ ̇
  38. 38. STYX Physics Engine with Augmented Reality STYX Team Page 37 :ٌٟ‫ج‬‫ثٌض‬ ْٛٔ‫ثٌمج‬ ِٓ ٞٚ‫ثٌضث‬ ‫ثٌذفغ‬ ٚ .ٓ١ّ‫ثٌؾغ‬ ٓ١‫د‬ َ‫ثٌضظجد‬ ٓ‫ػ‬ ‫ٔؾّش‬ ٟ‫ثٌض‬ ‫ٚثٌضثٚ٠ز‬ ‫ثٌخط١ز‬ ‫ثٌغشػز‬ ِٓ ً‫و‬ ‫فغجح‬ ُ‫٠ض‬ ِٕٗٚ 4-‫ٚؽٛد‬ ‫فجي‬ ٟ‫ف‬ ٓ١ّ‫ثٌؾغ‬ ‫فغجدجس‬ ٟ‫ف‬ ً‫صذخ‬ ٟ‫ثٌض‬ ‫ثٌذفغ‬ ٜٛ‫ل‬ ٌٝ‫إ‬ ‫ثالفضىجن‬ ‫شؼجع‬ ‫إػجفز‬ ‫ِشثػجر‬ ُ‫٠ض‬ ٟ‫ٚثٌذ٠ٕجِ١ى‬ ٟٔٛ‫ثٌغى‬ ‫ثالفضىجن‬ ‫فجٌز‬ ٟ‫ف‬ ‫ثالفضىجن‬ ‫فمشر‬ ٟ‫ف‬ ٗ‫ششف‬ ُ‫(٠ض‬ ‫د١ّٕٙج‬ ‫ثفضىجن‬.)ٟ‫ثٌقشو‬ 1.4.1.ً‫اىصذ‬ ‫ٍؼبىجخ‬ ٍ‫ف‬ ‫فُضَبئُخ‬ ٌُ‫ٍفبه‬Physics concepts in collision resolution 1.4.1.1.‫اىحشمخ‬ ‫مَُخ‬ ‫شؼبع‬⃗⃗⃗ ‫دجٌؼاللز‬ ٝ‫٠ؼط‬‫ِجد٠ز‬ ‫ٔمطز‬ ‫فجٌز‬ ٟ‫ف‬: ⃗ ⃗ :‫حٌث‬ ‫الحركة‬ ‫كمٌة‬ ‫شعاع‬ ⃗ ‫الكتلة‬ ‫المادٌة‬ ‫النقطة‬ ‫سرعة‬ ⃗
  39. 39. STYX Physics Engine with Augmented Reality STYX Team Page 38 :‫بالشكل‬ ‫فٌكون‬ ‫مادٌة‬ ‫جملة‬ ‫حالة‬ ً‫ف‬ ‫أما‬ ⃗ ⃗ :‫حٌث‬ ‫المادٌة‬ ‫الجملة‬ ‫عطالة‬ ‫مركز‬ ‫سرعة‬ ⃗ ‫المادٌة‬ ‫الجملة‬ ‫كتلة‬ 1.4.1.1.ٍ‫اىخط‬ ‫اىذفغ‬ ‫شؼبع‬Linear Impulse ‫عجدش‬ ‫فجؽض‬ ‫ِغ‬ َ‫ثألؽغج‬ َ‫صظجد‬ ‫ػٕذ‬ٚ‫أ‬‫دؼؼٙج‬ ‫ِغ‬‫ثٌذؼغ‬ً‫ِشثف‬ ‫عالط‬ ٟ‫ف‬ ‫صّش‬ ‫فئٔٙج‬: 1.‫اىتغبسع‬ ‫ٍشحيخ‬ ٠‫دؼؼٙج‬ ِٓ َ‫ثألؽغج‬ ‫ف١ٙج‬ ‫مضشح‬ٚ‫أ‬‫عشػز‬ ‫دشؼجع‬ ‫ثٌغجدش‬ ‫ثٌقجؽض‬ ِٓٓ١‫ِؼ‬. 2.ً‫اىتصبد‬ ‫ٍشحيخ‬ ْٛ‫صى‬‫ِؼذِٚز‬ ٓ١ِ‫ثٌّضظجد‬ ٓ١ّ‫ثٌؾغ‬ ‫وال‬ ‫عشػز‬. 3.‫االستذاد‬ ‫ٍشحيخ‬ ْ‫ثٌؾغّج‬ ‫٠شصذ‬ٚ‫ثٌضغجسع‬ ‫ِشفٍز‬ ٓ‫ػ‬ ‫ِخضٍف‬ ‫عشػز‬ ‫دشؼجع‬ ‫دؼؼّٙج‬ ٓ‫ػ‬ ْ‫٠ضذجػذث‬. ‫ثٌضغجسع‬ ٟ‫ِشفٍض‬ ٓ١‫د‬ ‫ثٌقشوز‬ ‫وّ١ز‬ ‫شؼجع‬ ٟ‫ف‬ ‫ثالخضالف‬ ّٟ‫ٔغ‬ٚ‫ثٌذف‬ ‫دشؼجع‬ ‫ثالسصذثد‬:‫ثٌؼاللز‬ ِٓ ‫ٚ٠قغخ‬ ‫غ‬ ̇
  40. 40. STYX Physics Engine with Augmented Reality STYX Team Page 39 :‫ف١ظ‬ َ‫ثٌظذ‬ ‫دغذخ‬ ُ‫ٌٍؾغ‬ ‫ثٌخط١ز‬ ‫ثٌغشػز‬ ‫صغ١ش‬ ̇ 1.4.1.1.‫اىذفغ‬ ‫شؼبع‬ٍٍ‫اىؼضو‬Impulsive Torque ٞٚ‫ٚثٌضث‬ ٟ‫ثٌخط‬ ‫ثٌذفغ‬ ‫شؼجع‬ ً‫ج‬‫أ٠ؼ‬ ٝ‫٠ذػ‬ ٞ‫ٚثٌز‬Linear and Angular Impulse‫ِغ‬ ًِ‫ٔضؼج‬ ‫إٔٔج‬ ‫دّج‬ ً‫ث‬‫ثػضّجد‬ ‫ثٌغشػز‬ ‫دضقذ٠ظ‬ ْٛ‫صى‬ ٌٓ َ‫ثٌضظجد‬ ‫ِؼجٌؾز‬ ْ‫فئ‬ ْ‫ٌٍذٚسث‬ ‫لجدٍز‬ َ‫أؽغج‬ٟ‫ثٌخط‬ ‫ثٌذفغ‬ ‫شؼجع‬ ٍٝ‫ػ‬ ‫فقغخ‬‫ف‬ ٌٟ‫ٚدجٌضج‬ ،ُ‫ثٌؾغ‬ ٍٝ‫ػ‬ ٗ‫صطذ١م‬ ‫ثٌٛثؽخ‬ ٟٔ‫ثٌذٚسث‬ َ‫ثٌؼض‬ ‫ثالػضذجس‬ ٓ١‫دؼ‬ ‫ثألخز‬ ‫ٚإّٔج‬‫ٕ٘ج‬ ‫جٌّؼجٌؾز‬ ً١ٍ‫دم‬ ‫أطؼخ‬ ْٛ‫عضى‬. َ‫٠ظذ‬ ‫ثٌّشٚٔز‬ َ‫صج‬ ‫طٍخ‬ ُ‫ؽغ‬ ٌٝ‫إ‬ ‫ثٌٕظش‬ ‫ػٕذ‬ٞٛ‫ثٌّغض‬ٌٟٚ‫ثٌضج‬ ً‫ثٌشى‬ ٟ‫ف‬ ‫وّج‬ ْ‫دٚسث‬ ‫فجٌز‬ ٟ‫ف‬ ٛ٘: ‫صذفغ‬ ‫لٛر‬ ‫ع١ٌٛذ‬ َ‫ثٌظذ‬ ‫٘زث‬ ْ‫فئ‬‫دٕض١ؾ‬ ُ‫ثٌؾغ‬ٗ‫ثٔؼغجؽ‬ ‫ز‬‫د‬ٞٛ‫جٌّغض‬‫ح‬‫ثٌّمش‬ ً‫ثٌشى‬ ‫٠ٛػـ‬ ‫وّج‬ٌٟ‫ثٌضج‬:
  41. 41. STYX Physics Engine with Augmented Reality STYX Team Page 40 ‫ثٌم‬ ٖ‫٘ز‬ ْ‫فئ‬ ‫دثالِذ١ش‬ ‫ٔظش٠ز‬ ‫دقغخ‬ ٟٚ‫خط‬ ٓ١ّ‫لغ‬ ٍٝ‫ػ‬ ْٛ‫عضى‬ ٜٟٛٚٔ‫دٚسث‬،ٝ‫٠ؼط‬ ٟ‫ثٌخط‬ ًِ‫ثٌؼج‬ ‫دجٌؼاللز‬: ̈ ٚٔ‫ثٌذٚسث‬ ًِ‫ثٌؼج‬َ‫ثٌؼض‬ ٍٝ‫ػ‬ ‫دجالػضّجد‬ ٝ‫٠ؼط‬ ٟ:‫ثٌضجٌ١ز‬ ‫دجٌؼاللز‬ :‫ف١ظ‬ ُ‫ثٌؾغ‬ ٍٝ‫ػ‬ ‫ثٌّؤعشر‬ ‫ثٌمٛر‬ ‫ثٌمٛر‬ ‫رسثع‬ ٟ‫ثٌشؼجػ‬ ‫ؽذثء‬ ‫ف١ظ‬‫صغجسػٙج‬ ‫دٚسثٔ١ز‬ ‫فشوز‬ ‫٠ٌٛذ‬ َ‫ثٌؼض‬: ̈ ًٚ‫ث‬‫صغ١١ش‬ ‫ع١ٌٛذ‬ َ‫ثٌظذ‬ ْ‫أ‬ ‫دّج‬( ‫ثٌقشوز‬ ‫وّ١ز‬ ‫شؼجع‬ ٟ‫ف‬ٞ‫أ‬ً‫ث‬‫صغ١ش‬‫د‬ً‫ث‬‫صغ١١ش‬ ‫ع١ٌٛذ‬ ٗٔ‫فئ‬ )‫جٌغشػز‬ً‫ج‬‫أ٠ؼ‬ٟ‫ف‬ ( ٟ‫ثٌقشو‬ َ‫ثٌؼض‬ ‫شؼجع‬‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ٞ‫أ‬)ٚ‫ثٌؼاللز‬ ٍٝ‫ػ‬ ‫ف١ٙج‬ ‫فظٍٕج‬ ٟ‫ثٌض‬ ‫ثٌطش٠مز‬ ‫دٕفظ‬ ̈ : ‫ثٌؼاللز‬ ٍٝ‫ػ‬ ً‫ٔقظ‬ ‫فئٕٔج‬
  42. 42. STYX Physics Engine with Augmented Reality STYX Team Page 41 ̇ :‫ف١ظ‬ ‫ثٌذفغ‬ ‫شؼجع‬ِٟٚ‫ثٌؼض‬ Inertia Tensor ‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ̇ ‫ثٌذفغ‬ ‫شؼجع‬ ‫٠ؼذش‬ِٟٚ‫ثٌؼض‬ً‫ث‬‫صغ١ش‬ ‫٠ىجفب‬ ٞ‫ٚثٌز‬ ‫ثٌغجدك‬ ٟ‫ثٌٍقظ‬ َ‫ثٌظذ‬ ‫أعٕجء‬ ‫ثٌذٚسثٔ١ز‬ ‫ثٌغشػز‬ ‫صغ١ش‬ ٓ‫ػ‬ ً‫ج‬١‫ٌقظ‬‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ٟ‫ف‬،ْٚٛ‫٠ى‬ ً‫دجٌّمجد‬( ‫ثٌضثٚ٠ز‬ ‫ثٌغشػز‬ ٟ‫ف‬ ‫ثٌضغ١ش‬ ‫فغجح‬ٔ‫أ‬ ِٓ ُ‫ثٌشغ‬ ٍٝ‫ػ‬‫صغ١ش‬ ٗ ً‫ث‬‫ؽذ‬ ‫طغ١شر‬ ‫صِٕ١ز‬ ‫فضشر‬ ّٓ‫ػ‬ٌٟ‫وجٌضج‬ ): ̇ ْٛ‫صى‬ ‫ثٌّؼجدالس‬ ‫ؽّ١غ‬ ٟ‫ف‬ ‫ف١ظ‬ٌُ‫ثٌؼج‬ ‫ثفذثع١جس‬ ّٓ‫ػ‬.‫ثٌذفغ‬ ‫أشؼز‬ ْ‫إ‬‫صظشفجس‬ ‫ٌٙج‬ً‫ج‬ِ‫صّج‬‫وجٌم‬ٜٛ،ٚ‫٘زث‬ ‫ثٌذفغ‬ ‫أشؼز‬ ْ‫أ‬ ٟٕ‫٠ؼ‬ٟ‫خط‬ ٓ١ٍِ‫ػج‬ ‫صٍّه‬ ‫دذٚس٘ج‬ٟٚٔ‫دٚسث‬ٚ٘ ٍٝ‫ػ‬‫ثألعجط‬ ‫زث‬ٚ‫ثٌؼاللز‬ ٍٝ‫ػ‬ ‫ثػضّجدث‬: ‫دجٌؼاللز‬ ٝ‫ِؼط‬ ‫ثٌّضٌٛذ‬ ٞٚ‫ثٌضث‬ ‫ثٌذفغ‬ ‫شؼجع‬ ْٛ‫٠ى‬: ‫ف١ظ‬:
  43. 43. STYX Physics Engine with Augmented Reality STYX Team Page 42 ‫ثٌذفغ‬ ‫شؼجع‬ َ‫ثٌظذ‬ ‫ٔمطز‬ ٓ١‫د‬ ٞ‫ثٌؼّٛد‬ ‫ثٌذؼذ‬ُٚ‫ثٌؾغ‬ ‫ػطجٌز‬ ‫ِشوض‬ 1.4.1.‫تذوَش‬‫اىتصبدٍبد‬Rotating Collisions ٓ١‫د‬ ‫ثٌؼاللز‬ ْ‫إ‬ٓ١ّ‫ثٌؾغ‬ ً‫ٌفظ‬ ‫ثٌالصِز‬ ‫ثٌغشػز‬َ‫ثٌظذ‬ ً‫لذ‬َٚ‫ثٌظذ‬ ‫دؼذ‬:ً‫دجٌشى‬ ٝ‫صؼط‬ :‫ف١ظ‬ ‫ثالسصذثد‬ ًِ‫ِؼج‬restitution coefficient)ُ‫ثٌؾغ‬ ‫دٕٛع‬ ‫(٠ضؼٍك‬ c َ‫ثٌظذ‬ ً١‫ذ‬ُ‫ل‬ ً‫ج‬ِ‫صّج‬ ُ‫ثٌؾغ‬ ‫عشػز‬ َ‫ثٌظذ‬ ‫ُؼ١ذ‬‫د‬ ً‫ج‬ِ‫صّج‬ ُ‫ثٌؾغ‬ ‫عشػز‬ ٓ١ّ‫ثٌؾغ‬ ٓ١‫د‬ ً‫ثٌفظ‬ ‫عشػز‬ ْ‫فئ‬ ‫آخش‬ ٕٝ‫ٚدّؼ‬Separating velocity‫ثٌغشػز‬ ٖ‫ثصؾج‬ ‫دؼىظ‬ ً‫ج‬ّ‫دثة‬ ْٛ‫صى‬ ‫ثٌضمجسد١ز‬Closing velocity. َ‫ثٌضظجد‬ ٟ‫ف‬ ‫ثٌذثخٍز‬ ‫ثٌّٛثد‬ ‫ٔٛػ١ز‬ ٍٝ‫ػ‬ ‫دجالػضّجد‬ٚٓ١ٍِ‫ػج‬ ِٓ ْٛ‫عضضى‬ ‫ثٌغشػز‬ ٖ‫٘ز‬ ْ‫فئ‬ َ‫ثٌظذ‬ ُ‫ٔجظ‬ ‫ؽٙز‬ ٟ‫خط‬ٚ‫ِخضٍفز‬ ‫دٕغخ‬ ٓ‫ٌى‬ ٟٔ‫دٚسث‬. ً‫ثٌشى‬ ٓ١‫٠ذ‬‫ٌٙج‬ َ‫أؽغج‬ ‫ػذر‬ ‫ثٌّشثفك‬ ‫ِٕٙج‬ ً‫ٌى‬ ْٛ‫ع١ى‬ ٓ‫ٌٚى‬ ‫ِضؼذدر‬ ‫أشىجي‬ ٓ‫ٌٚى‬ ً‫ثٌفظ‬ ‫عشػز‬ ‫ٔفظ‬ْٚ‫أ‬ ‫دّالفظز‬ ‫(صشوض‬ ‫ِخضٍفز‬ ‫خٛثص‬ ٌٗ ‫ِٕٙج‬ ً‫و‬
  44. 44. STYX Physics Engine with Augmented Reality STYX Team Page 43 ً‫ثٌغم‬ ‫ِشوض‬ ‫ِٛلغ‬ ،ً‫ثٌىض‬..‫ِخضٍفز‬ َٚ‫ٚػض‬ ‫فشوز‬ ‫ؽٙجس‬ ‫ٌٙج‬ ْٛ‫ع١ى‬ ٗٔ‫فئ‬ ))ٌ‫إ‬. 1.4.1.ً‫اىصذ‬-‫اىذفغ‬ ‫أشؼخ‬Impulses ‫ب‬ ‫فنحن‬ ‫الصدم‬ ‫بعد‬ ‫جسمٌن‬ ‫حركة‬ ‫كٌفٌة‬ ‫لمعالجة‬ً‫ه‬ ً‫والت‬ ‫دفع‬ ‫أشعة‬ ‫أربعة‬ ‫معرفة‬ ‫إلى‬ ‫حاجة‬ً‫شعاع‬ ‫ال‬‫والزاوي‬ ً‫الخط‬ ‫دف‬‫جسم‬ ‫لكل‬‫المتصادمٌن‬ ‫الجسمٌن‬ ‫من‬. ‫ثٌذفغ‬ ٟ‫شؼجػ‬ ‫ٌقغجح‬ٟ‫ثٌخط‬ٚ‫ؽغ‬ َ‫طذ‬ ٓ‫ػ‬ ‫ثٌٕجصؼ‬ ٞٚ‫ثٌضث‬ ‫ثٌذفغ‬‫عجدش‬ ‫فجؽض‬ ‫ِغ‬ ُٚ‫أ‬‫دذؼؼّٙج‬ ٓ١ّ‫ؽغ‬، : ‫ثٌخطٛثس‬ ِٓ ‫ِؾّٛػز‬ ‫ثصذجع‬ ٌٝ‫إ‬ ‫دقجؽز‬ ٓ‫ٔق‬ 1.‫ؽذ٠ذر‬ ‫إفذثع١جس‬ ‫ؽٍّز‬ ٍٝ‫ػ‬ ًّ‫عٕؼ‬،ْٛ‫ٚعضى‬َ‫ثٌظذ‬ ُ‫ٌٕجظ‬ ‫دجٌٕغذز‬ ‫ثٌؾٍّز‬ ٖ‫٘ز‬،ًٚ‫ع١ؾؼ‬ ‫ِج‬ ‫٘زث‬ ‫ثٌقغجدجس‬‫دىغ١ش‬ ًٙ‫أع‬ ‫ٔؾش٠ٙج‬ ٟ‫ثٌض‬ ‫ثٌش٠جػ١ز‬،ِٚٓ ً٠ٛ‫صق‬ ‫ِظفٛفز‬ ‫عٕٕشب‬ٚ‫إ‬‫ثٌؾٍّز‬ ٖ‫٘ز‬ ٌٝ ‫ثٌؾذ٠ذر‬ ‫ثإلفذثع١ز‬.ٖ٘‫٘ز‬ ‫إفذثع١جس‬ ‫دذِؼ‬ ( ‫ٔفغٙج‬ ‫ثإلفذثع١ز‬ ‫ثٌؾٍّز‬ ِٓ ْٛ‫عضضى‬ ‫ثٌّظفٛفز‬ ٖ‫ز‬ ‫ثٌؼج‬ ‫إلفذثع١جس‬ ‫دجٌٕغذز‬ ‫ثٌّقجٚس‬ٟ‫ف‬ ٌُ‫ٚثفذر‬ ‫ِظفٛفز‬ٟٙ‫ف‬ ‫ثٌؼىغ١ز‬ ً٠ٛ‫ثٌضق‬ ‫ِظفٛفز‬ ‫أِج‬ )‫دذغجؽز‬ ‫ثٌغجدمز‬ ‫ثٌّظفٛفز‬ ‫ِمٍٛح‬. ً‫ج‬‫دغ١ط‬ ْٛ‫ع١ى‬ ‫ثإلفذثع١ز‬ ‫ثٌؾٍّز‬ ‫فغجح‬ ْ‫إ‬‫وّقٛس‬ َ‫ثٌظذ‬ ُ‫ٔجظ‬ ‫دجصخجر‬Xٚ‫ثٌّقٛس‬ ‫فغجح‬Y ٌ‫ث‬ ْٛ‫صى‬ ‫دق١ظ‬ ‫ثألعجط‬ ‫٘زث‬ ٍٝ‫ػ‬‫طق١ـ‬ ً‫دشى‬ ‫ِضؼجِذر‬ ‫ثٌٕجصؾز‬ ‫ّقجٚس‬. 2.َ‫ثٌظذ‬ ٓ‫ػ‬ ‫ثٌٕجصؾز‬ ‫ثٌغشػز‬ ‫عٕؼجٌؼ‬ٚ‫ثٌؾ‬ ‫ٌىال‬ٓ١ِ‫ثٌّضظجد‬ ٓ١ّ‫غ‬‫ٚأل‬ ،ْ‫خط١ز‬ ‫فشوز‬ ‫ع١غذخ‬ ‫ثٌذفغ‬ ٚ‫دٚسثٔ١ز‬‫ع‬ ‫ثٌغشػز‬ ٖ‫٘ز‬ ‫ل١ّز‬ ْ‫فئ‬ ،ٓ١‫ثٌغجدم‬ ٓ١ٍِ‫ثٌؼج‬ ‫وال‬ ٍٝ‫ػ‬ ‫ضؼضّذ‬. 3.ً‫ج‬١ٍّ‫ػ‬ ‫ٔشث٘ج‬ ْ‫أ‬ ‫ٔش٠ذ‬ ٟ‫ثٌض‬ ‫ثٌغشػز‬ ٍُ‫ٔؼ‬ ‫إٔٔج‬ ‫دّج‬)‫ثٌمجدِز‬ ‫ثٌخطٛر‬ ٟ‫(ف‬‫ثٌٕض١ؾز‬ ‫عٕؼىظ‬ ‫ٌزٌه‬ ،ٟ‫ف‬ ‫ثٌغجدمز‬ ‫ثٌّشفٍز‬‫ٌضٌٛ١ذ‬ َ‫ثٌالص‬ ‫ثٌذفغ‬ ٍٝ‫ػ‬ ً‫ٌٕقظ‬‫ثٌغشػز‬ ٟ‫ف‬ ‫صغ١١ش‬ ٞ‫أ‬. 4.‫ٔقغخ‬‫عشػز‬‫ثٌظق١قز‬ ‫ثٌضذجػذ‬ٚ‫ثٌقجٌ١ز‬ ‫ثٌضمجسح‬ ‫عشػز‬ٚٚ ‫د١ّٕٙج‬ ‫ثٌفشق‬‫٘زث‬‫دفشق‬ ٗ١ّ‫عٕغ‬ ‫ِج‬ ‫ثٌّذضغجر‬ ‫ثٌغشػز‬. 5.ٓ‫ػ‬ ‫٠ٕضؼ‬ ْ‫أ‬ ‫٠ؾخ‬ ٞ‫ثٌز‬ ‫ثٌذفغ‬ ‫فغجح‬ ِٓ ٓ‫عٕضّى‬ ‫ػٍ١ٙج‬ ‫فظٍٕج‬ ٟ‫ثٌض‬ ‫ثٌّذضغجر‬ ‫ثٌغشػز‬ ‫فشق‬ ِٓ َ‫ثٌظذ‬.
  45. 45. STYX Physics Engine with Augmented Reality STYX Team Page 44 6.‫إ‬ ‫ثٌذفغ‬ ً‫ٔفظ‬ ‫ػٕذ٘ج‬ٚ ‫ٚثٌذٚسثٔ١ز‬ ‫ثٌخط١ز‬ ٗ١‫ِشوذض‬ ٌٝ‫ٌذ٠ٕج‬ ٟ‫ثٌض‬ َ‫ثألؽغج‬ ٍٝ‫ػ‬ ‫ٔطذمّٙج‬. ً‫ال‬١ٍ‫ل‬ ‫ثٌخطٛثس‬ ‫دؼغ‬ ٟ‫ف‬ ً‫عٕفظ‬. 1.4.2.ً‫اىصذ‬ ‫ّقطخ‬ ‫ئحذاثُبد‬ ٍ‫ف‬ ‫اىتغُش‬Change to contact coordinates ‫هو‬ ‫هدفنا‬‫على‬ ‫العمل‬‫والذي‬ ‫الالزم‬ ‫الدفع‬ ‫إٌجاد‬‫بحاجة‬ ‫نحن‬‫لتطبٌقه‬‫نتٌجة‬‫لالصطدام‬.‫س‬ٌ‫ول‬‫الدفع‬ ‫د‬ ‫تغٌٌر‬‫ا‬‫ا‬ً‫ف‬‫ال‬،‫سرعة‬‫بحاجة‬ ‫ونحن‬‫للعثور‬‫الذي‬ ‫الدفع‬ ‫شعاع‬ ‫هذا‬ ‫على‬‫ٌولد‬‫تغٌٌر‬‫ا‬‫ا‬ً‫ف‬‫السرعة‬. :ٟ٘ ٟ‫ٚثٌض‬ ‫ٌإلفذثع١جس‬ ‫ثٌغالعز‬ ‫ثألٔٛثع‬ ٌٟ‫ثٌضج‬ ً‫ثٌشى‬ ٓ١‫٠ذ‬ 1.ٌُ‫دجٌؼج‬ ‫ثٌّشصذطز‬ ‫ثإلفذثع١جس‬ 2.ُ‫دجٌؾغ‬ ‫ثٌّشصذطز‬ ‫ثٌّقٍ١ز‬ ‫ثإلفذثع١جس‬ 3.َ‫ثٌظذ‬ ‫دٕمطز‬ ‫ثٌّشصذطز‬ ‫ثإلفذثع١جس‬
  46. 46. STYX Physics Engine with Augmented Reality STYX Team Page 45 ‫الثالث‬ ‫اإلحداثٌات‬ ‫صدم‬ ‫نقطة‬ ‫لكل‬ ‫سٌكون‬ ً‫وبالتال‬‫بٌن‬ ‫فٌما‬ ‫االنتقال‬ ‫على‬ ‫وسنعمل‬ ‫بها‬ ‫الخاصة‬ ‫السابقة‬ ‫الصدم‬ ‫لمعالجة‬ ‫طرٌقنا‬ ً‫ف‬ ‫هذه‬ ‫الثالثة‬ ‫اإلحداثٌات‬. 1.4.2.1.‫اىشئُغخ‬ ‫اىَصفىفخ‬The Basis Matrix ‫أشعة‬ ‫ثالث‬ ‫عن‬ ‫ا‬‫ا‬‫عوض‬ ‫مصفوفات‬ ‫مع‬ ‫سنتعامل‬‫الثالث‬ ‫األشعة‬ ‫وضع‬ ‫طرٌق‬ ‫عن‬ ‫إحداثٌات‬ ‫منظومة‬ ‫لكل‬ ‫واحدة‬ ‫مصفوفة‬ ً‫ف‬.:ً‫التال‬ ‫الشكل‬ ‫ٌكون‬ ‫المحلٌة‬ ‫لإلحداثٌات‬ ‫ا‬‫ال‬‫فمث‬ :‫التالٌة‬ ‫الرئٌسة‬ ‫المصفوفة‬ ‫لتنتج‬ :‫بالشكل‬ ‫العالم‬ ‫إحداثٌات‬ ‫إي‬ ‫المحلٌة‬ ‫اإلحداثٌات‬ ‫من‬ ‫االنتقال‬ ‫ٌمكننا‬ ً‫وبالتال‬ :‫المصفوفة‬ ‫مقلوب‬ ‫طرٌق‬ ‫عن‬ ‫معاكس‬ ‫بشكل‬ ‫االنتقال‬ ‫ٌمكن‬ ‫ا‬‫ا‬‫جد‬ ‫بسٌط‬ ‫وبشكل‬
  47. 47. STYX Physics Engine with Augmented Reality STYX Team Page 46 1.4.3.‫ىشؼبع‬ ‫ثبىْغجخ‬ ‫اىغشػخ‬ ٍ‫ف‬ ‫اىتغُش‬‫اىذفغ‬Velocity change by Impulse ‫وزاوٌة‬ ‫خطٌة‬ :‫مركبتان‬ ‫وله‬. ‫الخطية‬ ‫المركبة‬ :ً‫التال‬ ‫بالشكل‬ ‫الكتلة‬ ‫بمقلوب‬ ‫تعطى‬ ‫وطوٌلة‬ ،ً‫الخط‬ ‫الدفع‬ ‫شعاع‬ ‫جهة‬ ‫ولها‬ ‫الزاوية‬ ‫المركبة‬ ‫لمركز‬ ‫بالنسبة‬ ‫الصدم‬ ‫نقطة‬ ‫موقع‬ ً‫ه‬ ‫أولها‬ ‫معامالت‬ ‫لعدة‬ ‫فٌها‬ ‫وسنحتاج‬ ،‫الخطٌة‬ ‫من‬ ‫أكثر‬ ‫معقدة‬ ‫بالعالقة‬ )‫الجسم‬ ‫(أصل‬ ‫الجسم‬ ‫إحداثٌات‬ ‫دفع‬ ‫واحدة‬ ‫كل‬ ‫أجل‬ ‫من‬ ً‫العزوم‬ ‫الدفع‬ ‫شعاع‬ ً‫تعطٌن‬ ً‫الت‬ ‫العالقة‬ ‫ونحتاج‬ ̂ :‫حٌث‬ ‫الصدم‬ ‫نقطة‬ ‫على‬ ‫(الناظم‬ ‫الدفع‬ ‫جهة‬Contact Normal)
  48. 48. STYX Physics Engine with Augmented Reality STYX Team Page 47 ‫الزاوٌة‬ ‫السرعة‬ ً‫ف‬ ‫التغٌر‬ ً‫تعط‬ ً‫الت‬ ‫العالقة‬ ‫ونحتاج‬ ̇ ‫الكلٌة‬ ‫السرعة‬ ‫تعطٌنا‬ ً‫الت‬ ‫العالقة‬ ‫ا‬‫ا‬‫وأخٌر‬‫الخطٌة‬‫المدروسة‬ ‫للنقطة‬‫لدورانها‬ ‫فقط‬ ‫ا‬‫ا‬‫تبع‬ ̇ ̇ 1.4.4.‫ىيغشػخ‬ ‫ثبىْغجخ‬ ‫اىذفغ‬ ‫تغُش‬Impulse change by Velocity ‫بالعالقة‬ ‫وٌعطى‬ ‫ثٌّذضغجر‬ ‫ثٌغشػز‬ ‫صغ١ش‬ v ‫ثٌّطٍٛح‬ ‫ثٌذفغ‬ ‫صغ١ش‬ g ‫شؼجع‬ ‫ٌٛثفذر‬ ‫دجٌٕغذز‬ ‫ثٌغشػز‬ ٟ‫ف‬ ٟ‫ثٌخط‬ ‫ثٌضغ١ش‬‫ثٌذفغ‬ d
  49. 49. STYX Physics Engine with Augmented Reality STYX Team Page 48 1.4.5.‫اىَجتغبح‬ ‫اىغشػخ‬ ‫تغُش‬ ‫حغبة‬Calculating the desired velocity change ‫التغٌر‬ ‫لحساب‬ ‫والثانٌة‬ ‫المدروسة‬ ‫النقطة‬ ً‫ف‬ ‫التقاربٌة‬ ‫السرعة‬ ‫لحساب‬ ‫األولى‬ ،‫مرحلتٌن‬ ‫طرٌق‬ ‫عن‬ ‫وتتم‬ ‫عنه‬ ‫نبحث‬ ‫الذي‬ ‫السرعة‬ ً‫ف‬. ‫السرعة‬‫اىتقبسثُخ‬ ‫السرعة‬‫ثٌضمجسد١ز‬ٟ٘‫آخش‬ ُ‫ٌؾغ‬ ‫دجٌٕغذز‬ َ‫ثألؽغج‬ ‫أفذ‬ ‫عشػز‬ٚ:‫ثٌؼاللز‬ ِٓ ً‫ج‬١‫س٠جػ‬ ‫صقغخ‬ ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ٓ١‫ثٌشؼجػ‬ ٓ١‫د‬ ٍّٟ‫ثٌغ‬ ‫ثٌؾذثء‬ . ٓ‫ػ‬ ‫فمؾ‬ ‫ثٌٕمطز‬ ْ‫دٚسث‬ ٍٝ‫ػ‬ ‫دجالػضّجد‬ ً‫ج‬‫عجدم‬ ‫روشٔج‬ ‫وّج‬ ‫ثٌضمجسد١ز‬ ‫ثٌغشػز‬ ‫عٕقغخ‬ ‫ٕ٘ج‬ ‫ٌٚىٕٕج‬ :‫ثٌضّجط‬ ‫ٌٕمطز‬ ‫دجٌٕغذز‬ ُ‫ثٌؾغ‬ ْ‫دٚسث‬ ‫فغجح‬ ‫ؽش٠ك‬ ‫ثٌضّجط‬ ُ‫ٔجظ‬ ٖ‫ثصؾج‬ ٟ‫ف‬ ‫ٌ١غش‬ ٟ‫ثٌض‬ ‫ثٌغشػز‬ ‫ِشوذز‬ ‫صؼذش‬ ‫ف١ظ‬Contact Normalٜ‫ِذ‬ ٓ‫ػ‬ ‫صضفٍك‬ ‫عشػز‬Slidingٓ١‫دؼ‬ ‫ثالفضىجن‬ ‫ٔؤخز‬ ‫ػٕذِج‬ ً‫ث‬‫ؽذ‬ ُِٙ ‫ٚ٘زث‬ ،‫ٌذؼؼّٙج‬ ‫دجٌٕغذز‬ ٓ١ّ‫ثٌؾغ‬ ‫ثالػضذجس‬. :ً‫ج‬‫ِغذم‬ ‫ػٕٙج‬ ‫صىٍّٕج‬ ٟ‫ثٌض‬ ‫ثٌشة١غز‬ ‫ثٌّظفٛفز‬ ‫ؽش٠ك‬ ٓ‫ػ‬ ‫ثٌضّجط‬ ‫ٔمطز‬ ‫عشػز‬ ٝ‫صؼط‬ ‫اىغشػخ‬ ٍ‫ف‬ ‫اىتغُش‬‫اىَطيىثخ‬ Vector3 velocity = body->getRotation() % relativeContactPosition; velocity += body->getVelocity;)( contactVelocity = contactToWorld.transformTranspose(velocity);
  50. 50. STYX Physics Engine with Augmented Reality STYX Team Page 49 ‫ؽش٠ك‬ ٓ‫ػ‬ ُ‫ٚ٠ض‬:ْٛٔ‫ثٌمج‬ ، ‫ثٌذفغ‬ ‫شؼجع‬ ‫ٌقغجح‬ ‫ثٌالصِز‬ ‫ثٌؼاللجس‬ ً‫و‬ ‫ٌذ٠ٕج‬ ‫أطذقش‬ ٌٟ‫دجٌضج‬ ْٚٚٛ‫ٔى‬ ٗ١‫ِشوذض‬ ٌٝ‫إ‬ ٍٗ‫فظ‬ ‫ػٕذ‬ ‫ثٌخط١ز‬ ‫ثٌغشػز‬ ‫صغ١ش‬ ٍٝ‫ػ‬ ‫دجٌقظٛي‬ ‫غج٠ضٕج‬ ٍٝ‫ػ‬ ‫فظٍٕج‬ ‫لذ‬ٚ‫ثٌذٚسثٔ١ز‬. 1.4.6.‫اىذفغ‬ ‫تطجُق‬Applying Impulse ‫تطبٌقه‬ ‫فقط‬ ً‫بق‬ ‫سبق‬ ‫فٌما‬ ‫بالدفع‬ ‫الخاصة‬ ‫المعامالت‬ ‫كافة‬ ‫حساب‬ ‫بعد‬‫المتصادمة‬ ‫األجسام‬ ‫على‬: ‫الجسم‬ ‫على‬ ‫الدفع‬ ‫تطبٌق‬ ‫علٌنا‬ ‫ٌجب‬ ً‫وبالتال‬ ،‫كلٌهما‬ ‫على‬ ‫ولٌس‬ ‫الجسمٌن‬ ‫أحد‬ ‫على‬ ‫الدفع‬ ‫بتطبٌق‬ ‫قمنا‬ ‫هنا‬ ‫والذي‬ ‫ا‬‫ا‬‫أٌض‬ ‫اآلخر‬–‫قلنا‬ ‫كما‬‫ا‬‫ا‬‫سابق‬-‫لجمٌع‬ ‫معاكسة‬ ‫بإشارة‬ ‫ولكن‬ ‫علٌه‬ ‫ا‬‫ا‬‫مطبق‬ ً‫الخط‬ ‫الدفع‬ ‫حجم‬ ‫نفس‬ ‫لدٌه‬ :‫المركبات‬ Vector3 impulsiveTorque = impulse % relativeContactPosition; Vector3 rotationChange =inverseInertiaTensor.transform(impulsiveTorque); // Calculate velocity and rotation change for object one. // ... impulse *= -1; // Calculate velocity and rotation change for object two. // ...
  51. 51. STYX Physics Engine with Augmented Reality STYX Team Page 50 ‫الرابع‬ ‫الفصل‬ ‫الفيزيائي‬ ‫المحرك‬ ‫وتحسين‬ ‫االتزانية‬ ‫تحقيق‬ Stabilization and Optimizing the Engine
  52. 52. STYX Physics Engine with Augmented Reality STYX Team Page 51 2.ٍ‫اىفُضَبئ‬ ‫اىَحشك‬ ُِ‫وتحغ‬ ‫االتضاُّخ‬ ‫تحقُق‬ 2.1.‫اىتذاخو‬ ‫ٍؼبىجخ‬Resolving Interpenetration ً‫ثٌضذثخ‬ ‫ِؼجٌؾز‬ ٌٝ‫إ‬ ‫ٔضطشق‬ ‫عٛف‬ ْ٢‫ٚث‬ ،َ‫ثٌظذ‬ ‫دؼذ‬ ٓ١ّ‫ثٌؾغ‬ ‫ٌىال‬ ‫ثٌغشػز‬ ً٠‫صؼذ‬ ‫أِىٕٕج‬ ‫و١ف‬ ً‫ج‬‫عجدم‬ ‫سأ٠ٕج‬ ٓ١ٍ‫ِضذثخ‬ ‫غ١ش‬ ٓ١ّ‫ثٌؾغ‬ ‫وال‬ ‫٠ظذـ‬ ‫دق١ظ‬ َ‫ثٌظذ‬ ‫أعٕجء‬ ‫فذط‬ ٞ‫ثٌز‬. َ‫ثٌظذ‬ ‫وشف‬ ٍٝ‫ػ‬ ‫ثٌمذسر‬ ‫ٍّٔه‬ ْ‫أ‬ ً‫لذ‬ ‫ثٌذؼغ‬ ‫دؼؼٙج‬ ‫صضؾجٚص‬ ْ‫أ‬ ٓ‫٠ّى‬ َ‫ثألؽغج‬ ْ‫فئ‬ ‫ثٌقع‬ ‫ٌغٛء‬.ٍُ‫ٔؼ‬ ‫وّج‬ ‫صِٕ١ز‬ ‫دخطٛر‬ ‫ثٌّقجوجر‬ ‫ؽش٠ك‬ ٓ‫ػ‬ ُ‫٠ض‬ َ‫ثٌظذ‬ ً١‫صّغ‬ ْ‫فئ‬TimeStepّٓ‫ػ‬ َ‫ٌٍظذ‬ ‫وشف‬ ‫٠ٛؽذ‬ ‫ال‬ ٌٟ‫ٚدجٌضج‬ ‫رثصٙج‬ ‫دقذ‬ ‫ثٌضِٕ١ز‬ ‫ثٌخطٛر‬ ٓ‫ػ‬ ‫ثٌّؼذشر‬ ‫ثٌضِٕ١ز‬ ‫ثٌفضشر‬. ‫ػذر‬ ٌٝ‫إ‬ ‫أدس‬ ً‫ج‬‫أ٠ؼ‬ ٟ‫ٚثٌض‬ ،‫رثصٙج‬ ‫دقذ‬ ‫ثٌّقجوجر‬ ‫ؽذ١ؼز‬ ٓ‫ػ‬ ‫ثٌٕجصؾز‬ ً‫ثٌضذثخ‬ ‫ظج٘شر‬ ‫ؽجءس‬ ‫ٕ٘ج‬ ِٓ ‫ٌّؼجٌؾض‬ ‫خٛثسصِ١جس‬‫ِضغ١شر‬ ‫صِٕ١ز‬ ‫خطٛر‬ َ‫وجعضخذث‬ ‫ٙج‬Adaptive time stepٚ‫أ‬‫دؼذ‬ ‫ِؼجٌؾضٙج‬ ٝ‫فض‬ ‫ثٌقجٌ١ز‬ ‫ثٌضِٕ١ز‬ ‫ثٌخطٛر‬ ‫آخش‬ ٟ‫ف‬ ً‫ث‬‫فٛس‬ ‫ٚإطالفٙج‬ ‫ٚلٛػٙج‬. 2.1.1.‫اىتذاخو‬ ‫ٍؼبىجخ‬ ‫غشَقخ‬ ‫اختُبس‬Choosing a resolution method :ٌٟ‫ثٌضج‬ ً‫دجٌشى‬ ‫وجٌّٛػقز‬ ً‫ثٌضذثخ‬ ‫ٌّؼجٌؾز‬ ‫ؽشق‬ ‫ػذر‬ ‫٠ٛؽذ‬ ‫ثٌظٍخ‬ ُ‫ثٌؾغ‬ ‫فجٌز‬ ٟ‫ف‬ًِ‫وج‬ ً‫دشى‬َ‫ثٌضظجد‬ ‫دؼذ‬ ‫ثٌقشوز‬ ٖ‫ثصؾج‬ ‫ٚفك‬ ٓ١ّ‫ثٌؾغ‬ ‫إصثفز‬ ‫فمؾ‬ ٟ‫٠ىف‬ ‫ال‬ٟ‫ف‬ ‫(وّج‬ ٟ‫ثٌخط‬ ‫ثإلعمجؽ‬ ‫ؽش٠مز‬Linear Projectionْٛ‫صى‬ ‫دق١ظ‬ ٟٔ‫ثٌذٚسث‬ ‫ٚػؼ١ّٙج‬ ‫صغ١١ش‬ ‫٠ؾخ‬ ‫ٚإّٔج‬ ) ٟ‫ثٌالخط‬ ‫ثإلعمجؽ‬ ٝ‫٠ذػ‬ ‫ِج‬ ‫ٌزٌه‬ َ‫ٚعٕغضخذ‬ ‫ٌٍقم١مز‬ ‫ألشح‬ ‫ثٌّؼجٌؾز‬Nonlinear Projection.
  53. 53. STYX Physics Engine with Augmented Reality STYX Team Page 52 2.1.1.ٍ‫خط‬ ‫اىغُش‬ ‫اإلعقبغ‬ ‫تحقُق‬Nonlinear projection implementation ‫ثالخضشثق‬ ‫ػّك‬ ٓ‫ػ‬ ‫ػذجسر‬ ٛ٘ ٓ١ِ‫ِضظجد‬ ٓ١ّ‫ؽغ‬ ٓ١‫د‬ ٗ‫ِؼجٌؾض‬ ‫ثٌٛثؽخ‬ ‫ثٌّٛػغ‬ ٟ‫ف‬ ً٠‫ثٌضؼذ‬ ‫ل١ّز‬ ْ‫إ‬ (Interpenetration Depthَ‫ثٌضظجد‬ ٓ‫ػ‬ ‫ثٌىشف‬ ‫أعٕجء‬ ٗ١ٍ‫ػ‬ ‫فظٍٕج‬ ٞ‫ثٌز‬ )ٟٚ‫ثٌالخط‬ ‫ثإلعمجؽ‬ ‫ؽش٠مز‬ ‫فغجح‬ ٍٝ‫ػ‬ ‫صؼضّذ‬ٍ‫و‬‫ض‬ٌّ‫ث‬ ‫ج‬ٓ١‫شوذض‬‫ثٌخط١ز‬ٚٚ‫ثٌذ‬ٚ ٓ١ِ‫ثٌّضظجد‬ ٓ١ّ‫ثٌؾغ‬ ‫ٌىال‬ ‫سثٔ١ز‬‫ثٌّشوذض‬ ٓ١‫٘جص‬ ْٛ‫صى‬ٓ١ ٚ ٓ١ّ‫ثٌؾغ‬ ٟ‫وضٍض‬ ٌٝ‫إ‬ ْ‫ِٕغٛدضج‬‫ػطجٌضّٙج‬ ِٟ‫ػض‬ٟٚ‫ثٌض‬ ‫ثٌذفغ‬ ‫فغجدجس‬ ‫ٔفظ‬ ٍٝ‫ػ‬ ‫ثالػضّجد‬ ‫دئِىجٕٔج‬ ‫ٕ٘ج‬ ‫ثٌغشػز‬ ‫ِؼجٌؾز‬ ‫فجٌز‬ ٟ‫ف‬ ‫أؽش٠ٕج٘ج‬. ‫فجٌز‬ ٟ‫ف‬ ‫وّج‬ ْ‫ٚثٌّقغٛدضج‬ ،ً‫ثٌضذثخ‬ ً٠‫صؼذ‬ ٓ‫ػ‬ ‫ثٌٕجصؾز‬ ‫ٌٍقشوز‬ ْ‫ثٌّغذذضج‬ ‫ثٌؼطجٌز‬ ٟ‫ِشوذض‬ ‫ٌذ٠ٕج‬ ‫صٕضؼ‬ ‫ٚ٘ىزث‬ ‫أِج‬ ٓ١ّ‫ثٌؾغ‬ ٟ‫وضٍض‬ ٟ‫ِمٍٛد‬ ‫ِؾّٛع‬ ٓ‫ػ‬ ‫ػذجسر‬ ‫فمؾ‬ ْٛ‫صى‬ ٟ‫ثٌض‬ ‫ثالٔغقجد١ز‬ ‫ثٌّشوذز‬ :ٞ‫أ‬ ‫ثٌغشػز‬ ‫ِؼجٌؾز‬ ُ‫ٔجظ‬ ‫ٚفك‬ ٟٔ‫ثٌذٚسث‬ ‫ثٌذفغ‬ ‫صطذ١ك‬ ِٓ ‫صقغخ‬ ٟٙ‫ف‬ ‫ثٌذٚسثٔ١ز‬ ‫ثٌّشوذز‬‫ثٌضّج‬‫ط‬. ‫فمؾ‬ ُ‫ٌٍؾغ‬ ‫ثٌىضٍز‬ ‫ِمٍٛح‬ ‫ٌذ‬ ٟ‫دم‬ٚ ‫ثالٔغقجد١ز‬ ‫ثٌقشوز‬ ‫ٔقغخ‬ ْ‫أ‬ ‫٠ٕج‬‫ثٌؼطجٌض‬ ‫ٚفك‬ ‫ثٌذٚسثٔ١ز‬ٚ ‫ثٌّطٍٛدز‬ ‫ثٌؾٙز‬ ‫ٚفك‬ ‫دؾؼٍّٙج‬ ٓ١ٓ‫ٌى‬ ‫ثالخضشثق‬ ‫ػّك‬ ‫دّمذثس‬.
  54. 54. STYX Physics Engine with Augmented Reality STYX Team Page 53 ‫ف١ظ‬linearMove[0]،angularMove[0]‫ثألٚي‬ ُ‫ٌٍؾغ‬، linearMove[1]،angularMove[1]ٟٔ‫ثٌغج‬ ُ‫ٌٍؾغ‬. ُ‫ثٌؾغ‬ ‫ِٛػغ‬ ٍٝ‫ػ‬ ٓ١‫ثٌم١ّض‬ ٓ١‫٘جص‬ ‫ٔطذك‬ ْ‫أ‬ ٟ‫دم‬ُٚ‫ٔجظ‬ ‫ٚفك‬ ٗٔ‫دٚسث‬‫ثٌضّجط‬)‫ثٌذفغ‬ ًِ‫فج‬ ‫ٔفظ‬ ٌٗ ٞ‫(ثٌز‬. ‫صىٍّٕج‬ ‫ػٕذِج‬ ً‫ج‬‫ِغذم‬ ‫ثٌّزوٛس‬ ‫ثٌغذخ‬ ‫ٌٕفظ‬ ‫ثألٚي‬ ُ‫ٌٍؾغ‬ ‫دجٌٕغذز‬ ً‫ٌٍضذثخ‬ ‫ِؼجوغز‬ ‫ل١ّز‬ ‫ث٢خش‬ ُ‫ٌٍؾغ‬ ْٛ‫٠ى‬ ٓ١ِ‫ثٌّضظجد‬ ٓ١ّ‫ٌٍؾغ‬ ‫ثٌذفغ‬ ‫أشؼز‬ ٓ‫ػ‬. 2.1.1.‫اىحشمخ‬ ‫تطجُق‬Applying the movement ٌ‫والدوران‬ ‫الخطٌة‬ ‫الحركة‬ ‫تطبٌق‬ ‫طرٌق‬ ‫عن‬ ‫وتتم‬‫ة‬ ‫الخطية‬ ‫الحركة‬ ‫تطبيق‬Linear motion :‫التماس‬ ‫ناظم‬ ‫على‬ ‫باالعتماد‬ ‫تعطى‬ ‫بسٌطة‬ ‫عملٌة‬ ‫الزاوية‬ ‫الحركة‬ ‫تطبيق‬Angular motion ‫الحركة‬ٌ‫الزاو‬‫ة‬‫ه‬ً‫صعوبة‬ ‫أكثر‬.‫نعرف‬ ‫نحن‬‫كمٌة‬‫التحرك‬‫الخطٌة‬ً‫الت‬‫عن‬ ‫نبحث‬‫و‬ً‫بالتال‬‫نحن‬‫بحاجة‬ ‫لحساب‬ً‫ف‬ ‫التغٌر‬‫اتجاه‬‫المتعدد‬ ‫المركب‬Quaternion.‫الخطٌة‬ ‫التحرك‬ ‫كمٌة‬ ‫لنا‬ ‫سٌؤمن‬ ‫الذي‬ ‫سن‬‫ذلك‬ ‫فعل‬‫مرا‬ ‫ثالث‬ ‫على‬:ً‫كالتال‬ ‫حل‬ linearMove[0] = penetration * linearInertia[0] * inverseInertia linearMove[1] = -penetration * linearInertia[1] * inverseInertia angularMove[0] = penetration * angularInertia[0] * inverseInertia angularMove[1] = -penetration * angularInertia[1] * inverseInertia body[i]->position += contactNormal * linearMove[i];
  55. 55. STYX Physics Engine with Augmented Reality STYX Team Page 54 1.‫بحساب‬ ‫نقوم‬‫واحدة‬ ‫بواحدة‬ ‫التماس‬ ‫نقطة‬ ‫المراد‬ ‫الدوران‬unit. 1.‫المراد‬ ‫الوحدات‬ ‫بعدد‬ ‫بضربها‬ ‫نقوم‬‫الزاوي‬ ‫التحرك‬ ‫قٌمة‬ ‫(أي‬angular move.) 1.‫المتعدد‬ ‫مركب‬ ‫اتجاه‬ ‫على‬ ‫المناسب‬ ‫الدوران‬ ‫نطبق‬orientation quaternion. 2.1.2.‫اىضائذ‬ ُ‫اىذوسا‬ ‫تجْت‬Avoiding excessive rotation ‫الساب‬ ‫خوارزمٌتنا‬ ً‫ف‬‫ولكن‬ ‫التداخل‬ ‫وضع‬ ‫من‬ ‫الجسم‬ ‫إلخراج‬ ‫وذلك‬ )‫(دوران‬ ‫زاوي‬ ‫تحرٌك‬ ‫نطبق‬ ‫فإننا‬ ‫قة‬ .‫التالٌة‬ ‫كاألمثلة‬ ‫حلها‬ ‫السابقة‬ ‫الخوارزمٌة‬ ‫تستطٌع‬ ‫ال‬ ً‫الت‬ ‫الحدٌة‬ ‫الحاالت‬ ‫بعض‬ ‫ٌوجد‬ ‫طرٌق‬ ‫عن‬ ‫ه‬ّ‫ل‬‫ح‬ ‫ٌمكن‬ ‫ال‬ ‫تداخل‬ ‫مشكلة‬ ً‫التال‬ ‫الشكل‬ ‫ٌبٌن‬ .‫الدوران‬ ‫بشكل‬ ‫تداخل‬ ‫مشكلة‬ ً‫التال‬ ‫الشكل‬ ‫ٌبٌن‬ً‫ف‬ ً‫وبالتال‬ ‫كبٌر‬ ‫والذي‬ ‫دوران‬ ‫تطبٌق‬ ‫إلى‬ ‫بحاجة‬ ‫فنحن‬ ‫التداخل‬ ‫معالجة‬ ‫حال‬ ‫منطقة‬ ‫ضمن‬ ‫جدٌدة‬ ‫نقاط‬ ‫ُدخل‬ٌ‫س‬ ً‫ف‬ ‫ألنه‬ ‫تطبٌقع‬ ‫ٌمكن‬ ‫ال‬ .‫التداخل‬ Vector3 rotationPerMove = impulsePerMove * 1/angularInertia; Vector3 rotation = rotationPerMove * angularMove;
  56. 56. STYX Physics Engine with Augmented Reality STYX Team Page 55 ‫ضمن‬ ‫وٌحفظ‬ ‫ٌحسب‬ ‫والزاوي‬ ً‫الخط‬ ‫التحرٌك‬ ‫فإن‬ ‫ا‬‫ا‬‫سابق‬ ‫رأٌنا‬ ‫كما‬:ً‫ه‬ ‫متحوالت‬ ‫أربعة‬ ‫قٌمة‬ ‫نفحص‬ ‫أن‬ ‫ببساطة‬ ‫ٌمكننا‬ ‫الحاالت‬ ‫هذه‬ ‫لمعالجة‬ ً‫وبالتال‬angularMove‫قٌمتها‬ ‫حسب‬ ‫وعلى‬ .ً‫الخط‬ ‫التحرٌك‬ ‫لمركبة‬ ‫منها‬ ‫الزائد‬ ‫نضٌف‬ ‫أن‬ ‫كبٌرة‬ ‫كانت‬ ‫حالت‬ ً‫ف‬ ‫ٌمكننا‬ ‫لألجسام‬ ً‫وبالتال‬ ،‫الجسم‬ ‫وحجم‬ ‫أبعاد‬ ‫على‬ ‫الزاوٌة‬ ‫المركبة‬ ‫ّس‬ٌ‫نق‬ ‫بأن‬ ‫آخر‬ ‫حل‬ ‫تطبٌق‬ ‫ٌمكن‬‫األبعاد‬ ‫ذات‬ .‫أكبر‬ ‫زاوٌة‬ ‫مركبات‬ ‫لها‬ ‫األكبر‬ 2.1.3.‫اىتغيغو‬ ‫ٍؼبىجخ‬Resolving penetration ‫ثم‬ ‫ا‬‫ال‬‫أو‬ ‫موقعها‬ ‫معالجة‬ ‫خالل‬ ‫من‬ ‫الترتٌب‬ ‫على‬ ‫بمعالجتها‬ ‫سنقوم‬ ‫فإننا‬ ،‫التماس‬ ‫نقاط‬ ‫بتحدٌد‬ ‫قمنا‬ ‫أن‬ ‫بعد‬ ‫من‬ ‫قلنا‬ ‫كما‬ َ‫ا‬ٌ‫ثان‬ ‫النقاط‬ ‫سرعات‬ ‫معالجة‬ .‫قبل‬ ً‫ف‬ ‫التداخل‬ ‫مشكلة‬ ً‫التال‬ ‫الشكل‬ ‫ٌبٌن‬‫كل‬ ‫ومن‬ ‫جدٌدة‬ ‫تداخل‬ ‫ٌنتج‬ ‫حتى‬ ‫ومعالجتها‬ ‫مرة‬ ‫ومعالجة‬ ‫العملٌة‬ ‫إعادة‬ ‫إلى‬ ‫ا‬‫ا‬ٌ‫مؤد‬ ‫معالجته‬ ‫ثم‬ ‫تطبٌق‬ ‫عن‬ ‫وذلك‬ ‫وهكذا‬ ‫األول‬ ‫التداخل‬ .‫الخوارزمٌة‬ ً‫ف‬ ‫التماس‬ ‫مواقع‬ ‫معالجة‬ linearMove[0] linearMove[1] angularMove[0] angularMove[1]

×