SlideShare une entreprise Scribd logo
1  sur  46
•NICOLAS GUIBERT
•FLORIAN POULET
•CAMILLE SIMON
EQUIPE
•FORMES SIMPLES
•FORMES COMPLEXES
•COLLISION AU PIXEL PRÈS
•PARTITIONNEMENT
•DÉCOR
•SPRITES ENRICHIS
SOMMAIRE
FORMES SIMPLES
Le point
Le rectangle aligné sur les axes
Le cercle
UN POINT DANS UNE AABB
UN POINT P1 NE SE TROUVE PAS DANS UNE AABB B1 SI :
• P1 SE SITUE COMPLÈTEMENT À GAUCHE DE B1
• P1 SE SITUE COMPLÈTEMENT À DROITE DE B1
• P1 SE SITUE COMPLÈTEMENT EN HAUT DE B1
• P1 SE SITUE COMPLÈTEMENT EN BAS DE B1
UN POINT
DANS
UNE AABB
COLLISION ENTRE 2 AABB
UNE AABB B1 ET UNE AABB B2 NE SONT PAS EN COLLISION SI :
• B1 SE SITUE COMPLÈTEMENT À GAUCHE DE B2
• B1 SE SITUE COMPLÈTEMENT À DROITE DE B2
• B1 SE SITUE COMPLÈTEMENT EN HAUT DE B2
• B1 SE SITUE COMPLÈTEMENT EN BAS DE B2
COLLISION
ENTRE 2
AABB
UN POINT DANS UN CERCLE
UN POINT P1 NE SE TROUVE PAS DANS UN CERCLE C1 SI :
• LA DISTANCE ENTRE P1 ET LE CENTRE DE C1 EST SUPÉRIEURE AU RAYON DE C1
UN POINT
DANS
UN CERCLE
COLLISION ENTRE 2 CERCLES
UN CERCLE C1 ET UN CERCLE C2 NE SONT PAS EN COLLISION SI :
• LA DISTANCE ENTRE LES CENTRES DEC1 ET C2 EST SUPÉRIEURE À LA SOMME DES RAYONS DE C1 ET C2
COLLISION
ENTRE 2
CERCLES
FORMES COMPLEXES
COLLISION ENTRE POLYGONE
CONVEXE ET POINT
Le vecteur S : Sx = Bx – Ax Sy = By - Ay
Le vecteur T : Tx = Px – Ax Ty = Py – Ay
Déterminant D : D = Sx*Ty – Sy*Ty
Si D est supérieur à 0, alors P est à gauche de la droite AB
Si D est inférieur à 0, alors P est à droit de droite AB
Si D est égal à 0, alors P est sur la droite AB
COLLISION ENTRE POLYGONE CONCAVE ET POINT
X=A+t∗AB⃗ D⃗ = AB⃗
X=I+u∗IP⃗ E⃗ = IP⃗
Ax+t∗Dx = Ix+u∗Ex
Ay+t∗Dy = Iy+u∗Ey
t = - Ax∗Ex - Ix∗Ey - Ex∗Ay + Ex∗Iy
Dx∗Ey - Dy∗Ex
COLLISION ENTRE POLYGONE CONCAVE ET POINT
Vecteur u ⃗ (AB) Vecteur v ⃗ (AC)
|u.x∗v.y – u.y∗v.x|
√ (u.x² + u.y²)
COLLISION ENTRE POLYGONE CONCAVE ET POINT
AB⃗. AC⃗
BA⃗. BC⃗
AABB ET CERCLE
AABB ET CERCLE
s1=GJ⃗.GH⃗ s2=HJ⃗.GH⃗
s1∗s2 > 0
COLLISION AU PIXEL PRÈS
LES MASQUES
Un Masque une image faite de
2 couleurs
Représentation d’un objet de
façon monochrome
POINT SUR UNE IMAGE
Test de la zone AABB du masque
(point dans AABB)
Test de collision au pixel
MASQUES MULTICOLORES
Jeux point & clic ou
menu de jeu
Deux images
Une original
Une avec des masques
Test de la couleur du masque au clic
PIXEL PERFECT
Detection de collision entre 2
objets au pixel près
Premier test > collision AABB entre les deux masques
Algorithme qui test chaque pixel
Prendre l’image la plus petite
Test sur la zone rectangulaire en collision
VERSUS
PARTITIONNEMENT
UN NIVEAU PEUT CONTENIR PLUSIEURS CENTAINES/MILLIERS D’OBJETS
• COMMENT FAIRE POUR RÉDUIRE LE NOMBRE DE TEST À EFFECTUER ?
LA GRILLE
• DÉCOUPAGE EN BOÎTES IDENTIQUES
• CHAQUE BOÎTE CONTIENT UNE LISTE D’OBJETS
• DÉCOUPAGE EFFECTUÉ AU CHARGEMENT
( OU SAUVEGARDER DANS LE FICHIER DU NIVEAU )
LA GRILLE
INCONVÉNIENTS :
• DÉTERMINER LE NOMBRE DE BOÎTES VOULU
• RÉPARTITION HÉTÉROGÈNE
LE QUADTREE
• DÉFINIR LE NOMBRE MAX D’OBJETS PAR BOÎTE
• DÉCOUPAGE RÉCURSIF DE CHAQUE BOÎTE EN4
• TANT QU’IL Y A TROP D’OBJETS DANS UNE LISTE, ON LA DÉCOUPE
Niveau
1 2 3 4
41 42 43 44
LE QUADTREE
INCONVÉNIENT :
• POTENTIEL DÉSÉQUILIBRE
LE BSP
• DÉCOUPAGE RÉCURSIF DE CHAQUE BOÎTE EN2
• DROITE DE DÉCOUPE « ASTUCIEUSE »
DÉCOR
SOL PLAT
Altitude A
Bounding box (rectangle
englobant, cadre de limite)
Si B BOX > A
Si B BOX < A
A
B BOX
SOL COURBE
Fonction cartésienne f(x)= y
Si f(x) > y on est au-dessus
Si f(x) < y on est en-dessous
Dérivée f’(x) avec une valeur seuil ‘z’
Si f’(x) > z on ne peut pas franchir
Si f’(x) < z on peut franchir
TILES DROITS
Tiles
Carreaux répétitifs réguliers
TILES DROITS
TILES DROITS
TILES ISOMÉTRIQUES
Tiles inclinés pour effet 3D
SPRITES ENRICHIS
Point Chaud
Point d’action
Sous-AABB
POINT CHAUD
POINT D’ACTION
SOUS-AABB
MERCI DE VOTRE ATTENTION

Contenu connexe

En vedette

Kinetic molecular theory
Kinetic molecular theoryKinetic molecular theory
Kinetic molecular theory12bergman_s
 
Kinetic molecular theory
Kinetic molecular theoryKinetic molecular theory
Kinetic molecular theoryMerlyn Denesia
 
Collision theory student guide
Collision theory student guideCollision theory student guide
Collision theory student guideMaria Donohue
 
Chapter 10.1 The Kinetic-Molecular Theory
Chapter 10.1 The Kinetic-Molecular TheoryChapter 10.1 The Kinetic-Molecular Theory
Chapter 10.1 The Kinetic-Molecular TheoryChris Foltz
 
Rate of reaction =measure rate and intro and collision theory
Rate of reaction =measure rate and intro and collision theoryRate of reaction =measure rate and intro and collision theory
Rate of reaction =measure rate and intro and collision theoryMRSMPC
 
Transition and collision theory
Transition and collision theoryTransition and collision theory
Transition and collision theorykanthasamy
 
Collision theory and Boltzmann
Collision theory and BoltzmannCollision theory and Boltzmann
Collision theory and Boltzmannbeckydaw
 
Collision theory v2
Collision theory v2Collision theory v2
Collision theory v2Simon Teo
 
Chp5 - Diagramme d'Etat Transition
Chp5 - Diagramme d'Etat TransitionChp5 - Diagramme d'Etat Transition
Chp5 - Diagramme d'Etat TransitionLilia Sfaxi
 
The Kinetic Molecular Theory
The Kinetic Molecular TheoryThe Kinetic Molecular Theory
The Kinetic Molecular Theorywalt sautter
 
Collision theory
Collision theoryCollision theory
Collision theorybeckydaw
 
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)Lumen Learning
 
Convergence84sergegauvinphoto 131118224445-phpapp02
Convergence84sergegauvinphoto 131118224445-phpapp02Convergence84sergegauvinphoto 131118224445-phpapp02
Convergence84sergegauvinphoto 131118224445-phpapp02sgauvin
 
Sistemas operativos estructura
Sistemas operativos estructuraSistemas operativos estructura
Sistemas operativos estructuraAndrés Chávez
 
Taller4 allauca chapalbay
Taller4  allauca chapalbayTaller4  allauca chapalbay
Taller4 allauca chapalbaydorispamela
 

En vedette (20)

Kinetic molecular theory
Kinetic molecular theoryKinetic molecular theory
Kinetic molecular theory
 
2012 topic 6
2012 topic 62012 topic 6
2012 topic 6
 
Kinetic molecular theory
Kinetic molecular theoryKinetic molecular theory
Kinetic molecular theory
 
Collision theory student guide
Collision theory student guideCollision theory student guide
Collision theory student guide
 
Chapter 10.1 The Kinetic-Molecular Theory
Chapter 10.1 The Kinetic-Molecular TheoryChapter 10.1 The Kinetic-Molecular Theory
Chapter 10.1 The Kinetic-Molecular Theory
 
Rate of reaction =measure rate and intro and collision theory
Rate of reaction =measure rate and intro and collision theoryRate of reaction =measure rate and intro and collision theory
Rate of reaction =measure rate and intro and collision theory
 
Collision theory
Collision theoryCollision theory
Collision theory
 
Transition and collision theory
Transition and collision theoryTransition and collision theory
Transition and collision theory
 
Collision theory and Boltzmann
Collision theory and BoltzmannCollision theory and Boltzmann
Collision theory and Boltzmann
 
Collision theory v2
Collision theory v2Collision theory v2
Collision theory v2
 
Les facteurs influant
Les facteurs influantLes facteurs influant
Les facteurs influant
 
Chp5 - Diagramme d'Etat Transition
Chp5 - Diagramme d'Etat TransitionChp5 - Diagramme d'Etat Transition
Chp5 - Diagramme d'Etat Transition
 
The Kinetic Molecular Theory
The Kinetic Molecular TheoryThe Kinetic Molecular Theory
The Kinetic Molecular Theory
 
Collision theory
Collision theoryCollision theory
Collision theory
 
Collision Theory
Collision TheoryCollision Theory
Collision Theory
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)
Chem II - Kinetic Molecular Theory of Gases (Liquids and Solids)
 
Convergence84sergegauvinphoto 131118224445-phpapp02
Convergence84sergegauvinphoto 131118224445-phpapp02Convergence84sergegauvinphoto 131118224445-phpapp02
Convergence84sergegauvinphoto 131118224445-phpapp02
 
Sistemas operativos estructura
Sistemas operativos estructuraSistemas operativos estructura
Sistemas operativos estructura
 
Taller4 allauca chapalbay
Taller4  allauca chapalbayTaller4  allauca chapalbay
Taller4 allauca chapalbay
 

Dernier

Algo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigésAlgo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigésSana REFAI
 
mémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoiremémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoireEzechiasSteel
 
le probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptxle probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptximaneeaouattahee
 
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdfpdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdfMedAbdelhayeSidiAhme
 
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024Ville de Châteauguay
 

Dernier (6)

JTC 2024 Bâtiment et Photovoltaïque.pdf
JTC 2024  Bâtiment et Photovoltaïque.pdfJTC 2024  Bâtiment et Photovoltaïque.pdf
JTC 2024 Bâtiment et Photovoltaïque.pdf
 
Algo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigésAlgo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigés
 
mémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoiremémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoire
 
le probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptxle probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptx
 
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdfpdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
 
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
 

PAF!? le mur

Notes de l'éditeur

  1. Point aux coordonnées x et y (bas milieu de l’AABB) Difficulté c’est pour toute coordonnée x il faut connaitre la coordonnée y du sol
  2. C’est masque monochrome qui va permettre de tester la collision au pixel près Si dans AABB du masque On regarde la couleur du pixel sur lequel la souris se trouve. Si c’est blanc ya collision sion izok
  3. Normalement l’image avec les masques c’est constitué que de masques de couleur.
  4. 2 personnages et leur masques Nous voulons savoir si les deux zones blanche se touche On prend chaque pixel et si on trouve un pixel blanc sur notre masque on vérifie qu’au meme endroit dans le masque 2 il n’y ai pas de pixel blanc, sinon on a une collision;
  5. Ordonnée du point bas de la bounding box
  6. Point aux coordonnées x et y (bas milieu de l’AABB) Difficulté c’est pour toute coordonnée x il faut connaitre la coordonnée y du sol
  7. Chaque élément s’inscrit dans une cellule de la grille. Savoir si un point P touche un mur, il suffit de savoir ou on se situe et si cette case correspond à un mur ou non
  8. Chaque élément s’inscrit dans une cellule de la grille. Savoir si un point P touche un mur, il suffit de savoir ou on se situe et si cette case correspond à un mur ou non Les objets du décor cachent les tiles de derrière