Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ISN 2022-ACL project Cyberpac 2077
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RICHARD Florian
ISN 2022-ACL project Cyberpac 2077
Commits
eaacfe7c
Commit
eaacfe7c
authored
2 years ago
by
Azurlors
Browse files
Options
Downloads
Patches
Plain Diff
Raloum
parent
193b4269
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAVENProject/src/main/java/environnement/HitBox.java
+14
-1
14 additions, 1 deletion
MAVENProject/src/main/java/environnement/HitBox.java
with
14 additions
and
1 deletion
MAVENProject/src/main/java/environnement/HitBox.java
+
14
−
1
View file @
eaacfe7c
...
@@ -5,7 +5,7 @@ import java.util.HashMap;
...
@@ -5,7 +5,7 @@ import java.util.HashMap;
public
class
HitBox
{
public
class
HitBox
{
//private final Coordonnees centre;
//private final Coordonnees centre;
private
HashMap
<
String
,
Coordonnees
>
extremites
=
new
HashMap
<
String
,
Coordonnees
>();
private
HashMap
<
String
,
Coordonnees
>
extremites
=
new
HashMap
<>();
private
static
double
defaultUnit
=
10
;
private
static
double
defaultUnit
=
10
;
public
HitBox
(
Coordonnees
c
){
public
HitBox
(
Coordonnees
c
){
...
@@ -36,4 +36,17 @@ public class HitBox {
...
@@ -36,4 +36,17 @@ public class HitBox {
public
HashMap
<
String
,
Coordonnees
>
getExtremites
()
{
public
HashMap
<
String
,
Coordonnees
>
getExtremites
()
{
return
extremites
;
return
extremites
;
}
}
public
static
Boolean
collisionHaute
(
HitBox
A
,
HitBox
B
){
return
!(
A
.
extremites
.
get
(
"HautGauche"
).
getX
()
>=
B
.
extremites
.
get
(
"HautDroite"
).
getX
());
}
public
static
Boolean
collisionDroite
(
HitBox
A
,
HitBox
B
){
return
!(
A
.
extremites
.
get
(
"HautDroite"
).
getX
()
<=
B
.
extremites
.
get
(
"HautGauche"
).
getX
());
}
public
static
Boolean
collisionGauche
(
HitBox
A
,
HitBox
B
){
return
!(
A
.
extremites
.
get
(
"HautGauche"
).
getZ
()
>=
B
.
extremites
.
get
(
"BasGauche"
).
getZ
());
}
public
static
Boolean
collisionBas
(
HitBox
A
,
HitBox
B
){
return
!(
A
.
extremites
.
get
(
"BasGauche"
).
getZ
()
<=
B
.
extremites
.
get
(
"HautGauche"
).
getZ
());
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment