-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bullet.cpp
62 lines (48 loc) · 1.45 KB
/
Bullet.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Created by josep on 2/14/2024.
//
#include "raylib.h"
#include "Bullet.h"
void Bullet::UpdatePosition(float x, float y, float z) {
position.x = x;
position.y = y;
position.z = z;
}
Vector3 Bullet::getPosition() {
return position;
}
Vector3 Bullet::getHitbox() {
return hitbox;
}
Vector3 Bullet::getVelocity() {
return velocity;
}
bool Bullet::getAlive() {
return alive;
}
BoundingBox Bullet::getBulletBox() {
return bulletBox;
}
void Bullet::setBulletBox(BoundingBox temp) {
bulletBox = temp;
}
void Bullet::kill() {
this->alive = false;
}
void Bullet::setBulletModel() {
bulletModel = LoadModel("../resources/uploads_files_2888820_9mm+Luger.obj");
Texture2D bulletTexAlbedo = LoadTexture("../resources/9mm Luger Albedo.png");
bulletModel.materials[0].maps[MATERIAL_MAP_ALBEDO].texture = bulletTexAlbedo;
Texture2D bulletTexRough = LoadTexture("../resources/9mm Luger Roughness.png");
bulletModel.materials[0].maps[MATERIAL_MAP_ROUGHNESS].texture = bulletTexRough;
Texture2D bulletTexNormal = LoadTexture("../resources/9mm Luger Normal.png");
bulletModel.materials[0].maps[MATERIAL_MAP_NORMAL].texture = bulletTexNormal;
Texture2D bulletTexSpec = LoadTexture("../resources/9mm Luger Specular.png");
bulletModel.materials[0].maps[MATERIAL_MAP_SPECULAR].texture = bulletTexSpec;
}
Model Bullet::getBulletModel() {
return bulletModel;
}
float Bullet::getSpeed() {
return speed;
}