use certain methods from std namespace
This commit is contained in:
@@ -109,7 +109,7 @@ int DillCreator::recurseDill(const int level, const int parent, const idScalar d
|
|||||||
m_body_T_parent_ref[body](i, j) = 0.0;
|
m_body_T_parent_ref[body](i, j) = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const idScalar size_5 = pow(size, 5);
|
const idScalar size_5 = std::pow(size, 5);
|
||||||
m_body_I_body[body](0, 0) = size_5 / 0.2e6;
|
m_body_I_body[body](0, 0) = size_5 / 0.2e6;
|
||||||
m_body_I_body[body](1, 1) = size_5 * 403 / 1.2e6;
|
m_body_I_body[body](1, 1) = size_5 * 403 / 1.2e6;
|
||||||
m_body_I_body[body](2, 2) = m_body_I_body[body](1, 1);
|
m_body_I_body[body](2, 2) = m_body_I_body[body](1, 1);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btIDebugDraw.h"
|
#include "LinearMath/btIDebugDraw.h"
|
||||||
|
|
||||||
#include <stdio.h> //printf debugging
|
#include <stdio.h> //printf debugging
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "../CommonInterfaces/CommonRigidBodyBase.h"
|
#include "../CommonInterfaces/CommonRigidBodyBase.h"
|
||||||
|
|
||||||
@@ -114,8 +115,8 @@ void AllConstraintDemo::initPhysics()
|
|||||||
///gear constraint demo
|
///gear constraint demo
|
||||||
|
|
||||||
#define THETA SIMD_PI / 4.f
|
#define THETA SIMD_PI / 4.f
|
||||||
#define L_1 (2 - tan(THETA))
|
#define L_1 (2 - std::tan(THETA))
|
||||||
#define L_2 (1 / cos(THETA))
|
#define L_2 (1 / std::cos(THETA))
|
||||||
#define RATIO L_2 / L_1
|
#define RATIO L_2 / L_1
|
||||||
|
|
||||||
btRigidBody* bodyA = 0;
|
btRigidBody* bodyA = 0;
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Gwen/Anim.h"
|
#include "Gwen/Anim.h"
|
||||||
#include "Gwen/Utility.h"
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <cmath>
|
||||||
|
#include "Gwen/Utility.h"
|
||||||
|
|
||||||
using namespace Gwen;
|
using namespace Gwen;
|
||||||
|
|
||||||
@@ -123,10 +124,9 @@ void Gwen::Anim::TimedAnimation::Think()
|
|||||||
if (fDelta < 0.0f) fDelta = 0.0f;
|
if (fDelta < 0.0f) fDelta = 0.0f;
|
||||||
if (fDelta > 1.0f) fDelta = 1.0f;
|
if (fDelta > 1.0f) fDelta = 1.0f;
|
||||||
|
|
||||||
Run(pow(fDelta, m_fEase));
|
Run(std::pow(fDelta, m_fEase));
|
||||||
|
|
||||||
if (fDelta == 1.0f)
|
if (fDelta == 1.0f) {
|
||||||
{
|
|
||||||
m_bFinished = true;
|
m_bFinished = true;
|
||||||
OnFinish();
|
OnFinish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "Gwen/Platform.h"
|
#include "Gwen/Platform.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using namespace Gwen;
|
using namespace Gwen;
|
||||||
using namespace Gwen::Controls;
|
using namespace Gwen::Controls;
|
||||||
@@ -89,7 +90,8 @@ void TextBox::Render(Skin::Base* skin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw caret
|
// Draw caret
|
||||||
if (fmod(Gwen::Platform::GetTimeInSeconds() - m_fLastInputTime, 1.0f) > 0.5f)
|
if (std::fmod(Gwen::Platform::GetTimeInSeconds() - m_fLastInputTime,
|
||||||
|
1.0f) > 0.5f)
|
||||||
skin->GetRender()->SetDrawColor(Gwen::Color(255, 255, 255, 255));
|
skin->GetRender()->SetDrawColor(Gwen::Color(255, 255, 255, 255));
|
||||||
else
|
else
|
||||||
skin->GetRender()->SetDrawColor(Gwen::Color(0, 0, 0, 255));
|
skin->GetRender()->SetDrawColor(Gwen::Color(0, 0, 0, 255));
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
#include "TinyRenderer.h"
|
#include "TinyRenderer.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <cmath>
|
||||||
#include <limits>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "tgaimage.h"
|
#include <limits>
|
||||||
#include "model.h"
|
#include <vector>
|
||||||
#include "geometry.h"
|
#include "../CommonInterfaces/CommonFileIOInterface.h"
|
||||||
#include "our_gl.h"
|
|
||||||
#include "../Utils/b3ResourcePath.h"
|
|
||||||
#include "Bullet3Common/b3MinMax.h"
|
|
||||||
#include "../OpenGLWindow/ShapeData.h"
|
#include "../OpenGLWindow/ShapeData.h"
|
||||||
|
#include "../Utils/b3BulletDefaultFileIO.h"
|
||||||
|
#include "../Utils/b3ResourcePath.h"
|
||||||
|
#include "Bullet3Common/b3Logging.h"
|
||||||
|
#include "Bullet3Common/b3MinMax.h"
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "LinearMath/btAlignedObjectArray.h"
|
||||||
#include "LinearMath/btVector3.h"
|
#include "LinearMath/btVector3.h"
|
||||||
#include "Bullet3Common/b3Logging.h"
|
#include "geometry.h"
|
||||||
#include "../CommonInterfaces/CommonFileIOInterface.h"
|
#include "model.h"
|
||||||
#include "../Utils/b3BulletDefaultFileIO.h"
|
#include "our_gl.h"
|
||||||
|
#include "tgaimage.h"
|
||||||
|
|
||||||
struct DepthShader : public IShader
|
struct DepthShader : public IShader
|
||||||
{
|
{
|
||||||
@@ -161,7 +162,8 @@ struct Shader : public IShader
|
|||||||
Vec2f uv = varying_uv * bar;
|
Vec2f uv = varying_uv * bar;
|
||||||
|
|
||||||
Vec3f reflection_direction = (bn * (bn * m_light_dir_local * 2.f) - m_light_dir_local).normalize();
|
Vec3f reflection_direction = (bn * (bn * m_light_dir_local * 2.f) - m_light_dir_local).normalize();
|
||||||
float specular = pow(b3Max(reflection_direction.z, 0.f), m_model->specular(uv));
|
float specular = std::pow(b3Max(reflection_direction.z, 0.f),
|
||||||
|
m_model->specular(uv));
|
||||||
float diffuse = b3Max(0.f, bn * m_light_dir_local);
|
float diffuse = b3Max(0.f, bn * m_light_dir_local);
|
||||||
|
|
||||||
color = m_model->diffuse(uv);
|
color = m_model->diffuse(uv);
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <sstream>
|
|
||||||
#include "model.h"
|
#include "model.h"
|
||||||
#include "Bullet3Common/b3Logging.h"
|
|
||||||
#include <string.h> // memcpy
|
#include <string.h> // memcpy
|
||||||
|
#include <cmath>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include "Bullet3Common/b3Logging.h"
|
||||||
Model::Model(const char *filename) : verts_(), faces_(), norms_(), uv_(), diffusemap_(), normalmap_(), specularmap_()
|
Model::Model(const char *filename) : verts_(), faces_(), norms_(), uv_(), diffusemap_(), normalmap_(), specularmap_()
|
||||||
{
|
{
|
||||||
std::ifstream in;
|
std::ifstream in;
|
||||||
@@ -159,8 +160,8 @@ TGAColor Model::diffuse(Vec2f uvf)
|
|||||||
// bool repeat = true;
|
// bool repeat = true;
|
||||||
// if (repeat)
|
// if (repeat)
|
||||||
{
|
{
|
||||||
uvf[0] = modf(uvf[0], &val);
|
uvf[0] = std::modf(uvf[0], &val);
|
||||||
uvf[1] = modf(uvf[1], &val);
|
uvf[1] = std::modf(uvf[1], &val);
|
||||||
}
|
}
|
||||||
Vec2i uv(uvf[0] * diffusemap_.get_width(), uvf[1] * diffusemap_.get_height());
|
Vec2i uv(uvf[0] * diffusemap_.get_width(), uvf[1] * diffusemap_.get_height());
|
||||||
return diffusemap_.get(uv[0], uv[1]);
|
return diffusemap_.get(uv[0], uv[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user