From 05e83fdcd63089d53295c67c81603e55c6558720 Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 2 Feb 2013 23:19:01 +0000 Subject: [PATCH] [Fix] Correcting vector values. --- bin/Makefile | 2 +- src/physics.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/Makefile b/bin/Makefile index 1416a00..77808b5 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -16,7 +16,7 @@ CTTF = `freetype-config --cflags` CGL = CFLAGS = -Wall $(CLUA) $(CSDL) $(CXML) $(CTTF) $(CGL) $(VERSION) ifdef DEBUG -CFLAGS += -g3 -DDEBUG +CFLAGS += -g3 -DDEBUG -DLUA_USE_APICHECK else CFLAGS += -O2 endif diff --git a/src/physics.h b/src/physics.h index ec0645c..a674dfb 100644 --- a/src/physics.h +++ b/src/physics.h @@ -1,8 +1,8 @@ #pragma once #include "def.h" -#define VX(v) ((v).mod*cos((v).angle)) -#define VY(v) ((v).mod*sin((v).angle)) +#define VX(v) ((v).x) +#define VY(v) ((v).y) #define VMOD(v) ((v).mod) #define VANGLE(v) ((v).angle) @@ -11,7 +11,8 @@ // Base of 2D vectors. typedef struct { - double mod, angle; // Basic 2D vector components. + double x, y; // Cartesian values. + double mod, angle; // Polar values. } Vec2; // Vector manupulation.