diff --git a/core/CollisionShape.cpp b/core/CollisionShape.cpp index e985733..3195f68 100644 --- a/core/CollisionShape.cpp +++ b/core/CollisionShape.cpp @@ -4,14 +4,14 @@ CollisionShape::CollisionShape() { shape = nullptr; } -SphereCollisionShape::SphereCollisionShape(cfloat radius) { +SphereCollisionShape::SphereCollisionShape(float radius) { shape = new btSphereShape(radius); } -BoxCollisionShape::BoxCollisionShape(cfloat width, cfloat height, cfloat depth) { +BoxCollisionShape::BoxCollisionShape(float width, float height, float depth) { shape = new btBoxShape(btVector3(width / 2.0f, height / 2.0f, depth / 2.0f)); } -CapsuleCollisionShape::CapsuleCollisionShape(cfloat radius, cfloat height) { +CapsuleCollisionShape::CapsuleCollisionShape(float radius, float height) { shape = new btCapsuleShape(radius, height); } diff --git a/core/CollisionShape.h b/core/CollisionShape.h index d487c3a..4089b8d 100644 --- a/core/CollisionShape.h +++ b/core/CollisionShape.h @@ -16,17 +16,17 @@ private: class SphereCollisionShape : public CollisionShape { public: - SphereCollisionShape(cfloat radius); + SphereCollisionShape(float radius); }; class BoxCollisionShape : public CollisionShape { public: - BoxCollisionShape(cfloat width, cfloat height, cfloat depth); + BoxCollisionShape(float width, float height, float depth); }; class CapsuleCollisionShape: public CollisionShape { public: - CapsuleCollisionShape(cfloat radius, cfloat height); + CapsuleCollisionShape(float radius, float height); }; #endif /* COLLISIONSHAPE_H */ diff --git a/core/Light.cpp b/core/Light.cpp index c97e608..71e45a9 100644 --- a/core/Light.cpp +++ b/core/Light.cpp @@ -30,7 +30,7 @@ DirectionalLight::DirectionalLight() { this->specular = 0.0f; } -DirectionalLight::DirectionalLight(Vector3 direction, Vector3 color, cfloat ambient, cfloat diffuse, cfloat specular) { +DirectionalLight::DirectionalLight(Vector3 direction, Vector3 color, float ambient, float diffuse, float specular) { this->direction = direction; this->color = color; this->ambient = ambient; diff --git a/core/Light.h b/core/Light.h index 790199e..d1e5c51 100644 --- a/core/Light.h +++ b/core/Light.h @@ -7,7 +7,7 @@ class Light : public Spatial { public: Vector3 color; - cfloat ambient, diffuse, specular; + float ambient, diffuse, specular; virtual Name GetType() const; virtual Light *Create(); virtual Light *Duplicate(); @@ -18,7 +18,7 @@ class DirectionalLight : public Light { public: Vector3 direction; DirectionalLight(); - DirectionalLight(Vector3 direction, Vector3 color, cfloat ambient, cfloat diffuse, cfloat specular); + DirectionalLight(Vector3 direction, Vector3 color, float ambient, float diffuse, float specular); virtual Name GetType() const; virtual DirectionalLight *Create(); virtual DirectionalLight *Duplicate(); diff --git a/core/Material.h b/core/Material.h index de9e00b..fdc3249 100644 --- a/core/Material.h +++ b/core/Material.h @@ -27,7 +27,7 @@ struct Material { int shininess; - cfloat alphaScissor; + float alphaScissor; bool unshaded; bool cullBack; Material(); diff --git a/core/Rigidbody.cpp b/core/Rigidbody.cpp index b1ad3d0..fe999a4 100644 --- a/core/Rigidbody.cpp +++ b/core/Rigidbody.cpp @@ -68,11 +68,11 @@ void Rigidbody::SetCollisionShape(CollisionShape collisionShape) { this->collisionShape = collisionShape.shape; } -cfloat Rigidbody::GetMass() { +float Rigidbody::GetMass() { return mass; } -void Rigidbody::SetMass(cfloat mass) { +void Rigidbody::SetMass(float mass) { this->mass = mass; if (not IsPrefab()) { btBody->setMassProps(mass, btVector3(0, 0, 0)); diff --git a/core/Rigidbody.h b/core/Rigidbody.h index 99a3ece..39f880c 100644 --- a/core/Rigidbody.h +++ b/core/Rigidbody.h @@ -52,14 +52,14 @@ public: Gets the mass of this rigidbody @return The mass, 0.0 if this is an infinite mass object */ - cfloat GetMass(); + float GetMass(); /** Sets the mass of this rigidbody. Note that setting mass equal to 0.0 will make it an infinite mass object @param mass The desired mass */ - void SetMass(cfloat mass); + void SetMass(float mass); /** Add an instantaneous impulse to the object. @@ -93,7 +93,7 @@ private: bool character = false; btRigidBody *btBody; btCollisionShape *collisionShape; - cfloat mass = 1.0f; + float mass = 1.0f; friend class World; }; diff --git a/core/Shaders/Shader.cpp b/core/Shaders/Shader.cpp index 705b5b7..65a485b 100644 --- a/core/Shaders/Shader.cpp +++ b/core/Shaders/Shader.cpp @@ -63,9 +63,9 @@ void Shader::UpdateMaterial(Material material) { glBindTexture(GL_TEXTURE_2D, material.tex.id); } - glUniform3fv(glGetUniformLocation(id, "material.ambient"), 1, (cfloat*) &material.ambient); - glUniform3fv(glGetUniformLocation(id, "material.diffuse"), 1, (cfloat*) &material.diffuse); - glUniform3fv(glGetUniformLocation(id, "material.specular"), 1, (cfloat*) &material.specular); + glUniform3fv(glGetUniformLocation(id, "material.ambient"), 1, (float*) &material.ambient); + glUniform3fv(glGetUniformLocation(id, "material.diffuse"), 1, (float*) &material.diffuse); + glUniform3fv(glGetUniformLocation(id, "material.specular"), 1, (float*) &material.specular); glUniform1i(glGetUniformLocation(id, "material.shininess"), material.shininess); glUniform1f(glGetUniformLocation(id, "material.alphaScissor"), material.alphaScissor); diff --git a/core/Skybox.cpp b/core/Skybox.cpp index 6a80d74..9ad3621 100644 --- a/core/Skybox.cpp +++ b/core/Skybox.cpp @@ -1,6 +1,6 @@ #include "Skybox.h" -cfloat vertices[] = { +float vertices[] = { // positions -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, @@ -57,7 +57,7 @@ Skybox::Skybox() { // We're just going to use position data // UV data is the same glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * (sizeof(cfloat)), (void*) 0); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * (sizeof(float)), (void*) 0); glBindVertexArray(0); } diff --git a/core/Spatial.cpp b/core/Spatial.cpp index 1b44eef..4ff9142 100644 --- a/core/Spatial.cpp +++ b/core/Spatial.cpp @@ -42,25 +42,25 @@ void Spatial::Translate(Vector3 offset) { this->SetTransform(t); } -void Spatial::RotateX(cfloat phi) { +void Spatial::RotateX(float phi) { Transform t = this->GetTransform(); t.rotation.x += phi; this->SetTransform(t); } -void Spatial::RotateY(cfloat phi) { +void Spatial::RotateY(float phi) { Transform t = this->GetTransform(); t.rotation.y += phi; this->SetTransform(t); } -void Spatial::RotateZ(cfloat phi) { +void Spatial::RotateZ(float phi) { Transform t = this->GetTransform(); t.rotation.z += phi; this->SetTransform(t); } -void Spatial::UniformScale(cfloat scale) { +void Spatial::UniformScale(float scale) { Transform t = this->GetTransform(); t.scale *= scale; this->SetTransform(t); diff --git a/core/Spatial.h b/core/Spatial.h index 30ff9e7..4b8ae00 100644 --- a/core/Spatial.h +++ b/core/Spatial.h @@ -56,22 +56,22 @@ public: Rotates the Camera phi radians about the X axis @param phi The amount to rotate in radians */ - void RotateX(cfloat phi); + void RotateX(float phi); /** Rotates the Camera phi radians about the Y axis @param phi The amount to rotate in radians */ - void RotateY(cfloat phi); + void RotateY(float phi); /** Rotates the Camera phi radians about the Z axis @param phi The amount to rotate in radians */ - void RotateZ(cfloat phi); + void RotateZ(float phi); /** Scales the spatial by scale uniformly @param scale The amount to scale by. */ - void UniformScale(cfloat scale); + void UniformScale(float scale); virtual Spatial *Create(); virtual Spatial *Duplicate(); diff --git a/core/Vertex.cpp b/core/Vertex.cpp index 6c57e3a..f8939eb 100644 --- a/core/Vertex.cpp +++ b/core/Vertex.cpp @@ -11,7 +11,7 @@ Vertex::Vertex() { v = 0.0f; } -Vertex::Vertex(cfloat x, cfloat y, cfloat z) { +Vertex::Vertex(float x, float y, float z) { this->x = x; this->y = y; this->z = z; @@ -22,7 +22,7 @@ Vertex::Vertex(cfloat x, cfloat y, cfloat z) { this->v = 0.0f; } -Vertex::Vertex(cfloat x, cfloat y, cfloat z, cfloat u, cfloat v) { +Vertex::Vertex(float x, float y, float z, float u, float v) { this->x = x; this->y = y; this->z = z; @@ -33,9 +33,9 @@ Vertex::Vertex(cfloat x, cfloat y, cfloat z, cfloat u, cfloat v) { this->v = v; } -Vertex::Vertex(cfloat x, cfloat y, cfloat z, - cfloat nx, float ny, cfloat nz, - cfloat u, cfloat v) { +Vertex::Vertex(float x, float y, float z, + float nx, float ny, float nz, + float u, float v) { this->x = x; this->y = y; this->z = z; diff --git a/core/Vertex.h b/core/Vertex.h index 0cd337f..52b8626 100644 --- a/core/Vertex.h +++ b/core/Vertex.h @@ -7,14 +7,14 @@ struct Vertex { Vertex(); - Vertex(cfloat x, cfloat y, cfloat z); - Vertex(cfloat x, cfloat y, cfloat z, cfloat u, cfloat v); - Vertex(cfloat x, cfloat y, cfloat z, - cfloat nx, float ny, cfloat nz, - cfloat u, cfloat v); - cfloat x, y, z; - cfloat nx, ny, nz; - cfloat u, v; + Vertex(float x, float y, float z); + Vertex(float x, float y, float z, float u, float v); + Vertex(float x, float y, float z, + float nx, float ny, float nz, + float u, float v); + float x, y, z; + float nx, ny, nz; + float u, v; }; typedef std::vector VertexList; diff --git a/core/World.cpp b/core/World.cpp index 4f4921d..4ff2fea 100644 --- a/core/World.cpp +++ b/core/World.cpp @@ -12,7 +12,7 @@ void World::AddRigidbody(Rigidbody *rigidbody) { btWorld->addRigidBody(rigidbody->btBody); } -void World::Step(cfloat delta) { +void World::Step(float delta) { btWorld->stepSimulation(delta); } diff --git a/core/World.h b/core/World.h index b7a2640..772020b 100644 --- a/core/World.h +++ b/core/World.h @@ -9,7 +9,7 @@ class World { public: static World* GetWorld(); void AddRigidbody(Rigidbody *rigidbody); - void Step(cfloat delta); + void Step(float delta); private: static World* world; btDiscreteDynamicsWorld *btWorld; diff --git a/core/types.cpp b/core/types.cpp index 11c1bf8..3be2020 100644 --- a/core/types.cpp +++ b/core/types.cpp @@ -10,7 +10,7 @@ Vector3 operator+(const Vector3 &r, const Vector3 &l) { return val; } -Vector3 operator*(const Vector3 &r, const cfloat &l) { +Vector3 operator*(const Vector3 &r, const float &l) { Vector3 val(0.0f); val.x = r.x * l; val.y = r.y * l; diff --git a/core/types.h b/core/types.h index 1e6a035..f25ee96 100644 --- a/core/types.h +++ b/core/types.h @@ -12,10 +12,9 @@ typedef GLFWwindow Window; typedef glm::vec3 Vector3; typedef glm::mat4 Matrix; typedef std::string Name; -typedef GLfloat cfloat; typedef GLuint Id; -Vector3 operator*(const Vector3 &r, const cfloat &l); +Vector3 operator*(const Vector3 &r, const float &l); Vector3 operator+(const Vector3 &r, const Vector3 &l); #endif /* TYPES_H */ diff --git a/scripting/couch.i b/scripting/couch.i index fde4c98..884142a 100644 --- a/scripting/couch.i +++ b/scripting/couch.i @@ -20,21 +20,18 @@ #include "CollisionShape.h" %} -typedef float cfloat; -%ignore "cfloat"; - class Vector3 { public: Vector3(); - Vector3(cfloat x, cfloat y, cfloat z); - cfloat x, y, z; + Vector3(float x, float y, float z); + float x, y, z; }; %extend Vector3 { Vector3 operator+(const Vector3 &o) const { return *$self + o; } - Vector3 operator*(const cfloat &o) const { + Vector3 operator*(const float &o) const { return *$self * o; } }