try explicit conversion

This commit is contained in:
arthur.jamet
2021-05-21 15:20:21 +02:00
parent 549dc4246b
commit 5d5b63ae33
3 changed files with 18 additions and 3 deletions
+1
View File
@@ -11,6 +11,7 @@
#include <raylib.h>
namespace RAY {
typedef ::Vector2 Vector2;
typedef ::Vector3 Vector3;
typedef ::Vector4 Vector4;
+14
View File
@@ -0,0 +1,14 @@
/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Vector
*/
#include "Vector.hpp"
#include "Models/Vector3.hpp"
RAY::Vector3 toRAY(const WAL::Vector3<float> &wal)
{
return (RAY::Vector3){wal.x, wal.y, wal.y};
}
+3 -3
View File
@@ -25,8 +25,8 @@ int main()
RAY::Vector2 ballPosition = { (float)screenWidth/2, (float)screenHeight/2 };
RAY::Window &window = RAY::Window::getInstance(screenWidth, screenHeight, "Ta mère en slip");
RAY::Camera::Camera3D camera((Vector3){ 30.0f, 20.0f, 30.0f }, (Vector3){ 0.0f, 0.0f, 0.0f },
(Vector3){ 0.0f, 1.0f, 0.0f }, 70.0, CAMERA_PERSPECTIVE);
RAY::Camera::Camera3D camera((RAY::Vector3){ 30.0f, 20.0f, 30.0f }, (RAY::Vector3){ 0.0f, 0.0f, 0.0f },
(RAY::Vector3){ 0.0f, 1.0f, 0.0f }, 70.0, CAMERA_PERSPECTIVE);
RAY::Drawables::Drawables3D::Grid grid(10, 5.0f);
RAY::Drawables::Drawables3D::Cube cube({0}, {0}, {0});
@@ -75,7 +75,7 @@ int main()
float scatter = sinf(blockScale*20.0f + (float)(time*4.0f));
// Calculate the cube position
cube.setPosition({
cube.setPosition((RAY::Vector3){
(float)(x - numBlocks/2)*(scale*3.0f) + scatter,
(float)(y - numBlocks/2)*(scale*2.0f) + scatter,
(float)(z - numBlocks/2)*(scale*3.0f) + scatter