Fix compilation errors on Visual Studio and warnings
This commit is contained in:
parent
101964a427
commit
4ae8d446be
|
@ -375,8 +375,10 @@ void CollisionDetection::broadPhaseNotifyOverlappingPair(ProxyShape* shape1, Pro
|
||||||
OverlappingPair(shape1, shape2, nbMaxManifolds, mWorld->mMemoryAllocator);
|
OverlappingPair(shape1, shape2, nbMaxManifolds, mWorld->mMemoryAllocator);
|
||||||
assert(newPair != NULL);
|
assert(newPair != NULL);
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
std::pair<map<overlappingpairid, OverlappingPair*>::iterator, bool> check =
|
std::pair<map<overlappingpairid, OverlappingPair*>::iterator, bool> check =
|
||||||
mOverlappingPairs.insert(make_pair(pairID, newPair));
|
#endif
|
||||||
|
mOverlappingPairs.insert(make_pair(pairID, newPair));
|
||||||
assert(check.second);
|
assert(check.second);
|
||||||
|
|
||||||
// Wake up the two bodies
|
// Wake up the two bodies
|
||||||
|
|
|
@ -106,7 +106,10 @@ void HeightFieldShape::testAllTriangles(TriangleCallback& callback, const AABB&
|
||||||
computeMinMaxGridCoordinates(minGridCoords, maxGridCoords, aabb);
|
computeMinMaxGridCoordinates(minGridCoords, maxGridCoords, aabb);
|
||||||
|
|
||||||
// Compute the starting and ending coords of the sub-grid according to the up axis
|
// Compute the starting and ending coords of the sub-grid according to the up axis
|
||||||
int iMin, iMax, jMin, jMax;
|
int iMin = 0;
|
||||||
|
int iMax = 0;
|
||||||
|
int jMin = 0;
|
||||||
|
int jMax = 0;
|
||||||
switch(mUpAxis) {
|
switch(mUpAxis) {
|
||||||
case 0 : iMin = clamp(minGridCoords[1], 0, mNbColumns - 1);
|
case 0 : iMin = clamp(minGridCoords[1], 0, mNbColumns - 1);
|
||||||
iMax = clamp(maxGridCoords[1], 0, mNbColumns - 1);
|
iMax = clamp(maxGridCoords[1], 0, mNbColumns - 1);
|
||||||
|
|
|
@ -47,7 +47,7 @@ ConcaveMesh::ConcaveMesh(const openglframework::Vector3 &position,
|
||||||
mScalingMatrix = openglframework::Matrix4::identity();
|
mScalingMatrix = openglframework::Matrix4::identity();
|
||||||
|
|
||||||
// For each subpart of the mesh
|
// For each subpart of the mesh
|
||||||
for (uint i=0; i<getNbParts(); i++) {
|
for (unsigned int i=0; i<getNbParts(); i++) {
|
||||||
|
|
||||||
// Vertex and Indices array for the triangle mesh (data in shared and not copied)
|
// Vertex and Indices array for the triangle mesh (data in shared and not copied)
|
||||||
rp3d::TriangleVertexArray* vertexArray =
|
rp3d::TriangleVertexArray* vertexArray =
|
||||||
|
@ -104,7 +104,7 @@ ConcaveMesh::ConcaveMesh(const openglframework::Vector3 &position, float mass,
|
||||||
mScalingMatrix = openglframework::Matrix4::identity();
|
mScalingMatrix = openglframework::Matrix4::identity();
|
||||||
|
|
||||||
// For each subpart of the mesh
|
// For each subpart of the mesh
|
||||||
for (uint i=0; i<getNbParts(); i++) {
|
for (unsigned int i=0; i<getNbParts(); i++) {
|
||||||
|
|
||||||
// Vertex and Indices array for the triangle mesh (data in shared and not copied)
|
// Vertex and Indices array for the triangle mesh (data in shared and not copied)
|
||||||
rp3d::TriangleVertexArray* vertexArray =
|
rp3d::TriangleVertexArray* vertexArray =
|
||||||
|
@ -146,7 +146,7 @@ ConcaveMesh::ConcaveMesh(const openglframework::Vector3 &position, float mass,
|
||||||
ConcaveMesh::~ConcaveMesh() {
|
ConcaveMesh::~ConcaveMesh() {
|
||||||
|
|
||||||
// Destroy the triangle mesh data for the physics engine
|
// Destroy the triangle mesh data for the physics engine
|
||||||
for (uint i=0; i<mPhysicsTriangleMesh.getNbSubparts(); i++) {
|
for (unsigned int i=0; i<mPhysicsTriangleMesh.getNbSubparts(); i++) {
|
||||||
delete mPhysicsTriangleMesh.getSubpart(i);
|
delete mPhysicsTriangleMesh.getSubpart(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,15 +30,15 @@
|
||||||
using namespace openglframework;
|
using namespace openglframework;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Light::Light(GLuint id)
|
Light::Light()
|
||||||
: mLightID(id), mDiffuseColor(Color::white()),
|
: mDiffuseColor(Color::white()),
|
||||||
mSpecularColor(Color::white()), mIsActive(false) {
|
mSpecularColor(Color::white()), mIsActive(false) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Light::Light(GLuint id, Color diffuseColor, Color specularColor)
|
Light::Light(Color diffuseColor, Color specularColor)
|
||||||
: mLightID(id), mDiffuseColor(diffuseColor),
|
: mDiffuseColor(diffuseColor),
|
||||||
mSpecularColor(specularColor), mIsActive(false) {
|
mSpecularColor(specularColor), mIsActive(false) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,9 +43,6 @@ class Light : public Object3D {
|
||||||
|
|
||||||
// -------------------- Attributes -------------------- //
|
// -------------------- Attributes -------------------- //
|
||||||
|
|
||||||
// OpenGL light ID
|
|
||||||
GLuint mLightID;
|
|
||||||
|
|
||||||
// Diffuse color of the light
|
// Diffuse color of the light
|
||||||
Color mDiffuseColor;
|
Color mDiffuseColor;
|
||||||
|
|
||||||
|
@ -60,10 +57,10 @@ class Light : public Object3D {
|
||||||
// -------------------- Methods -------------------- //
|
// -------------------- Methods -------------------- //
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Light(GLuint id);
|
Light();
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Light(GLuint id, Color diffuseColor, Color specularColor);
|
Light(Color diffuseColor, Color specularColor);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~Light();
|
virtual ~Light();
|
||||||
|
|
|
@ -92,9 +92,6 @@ class CollisionShapesScene : public SceneDemo {
|
||||||
/// All the dumbbell of the scene
|
/// All the dumbbell of the scene
|
||||||
std::vector<Dumbbell*> mDumbbells;
|
std::vector<Dumbbell*> mDumbbells;
|
||||||
|
|
||||||
/// Concave triangles mesh
|
|
||||||
ConcaveMesh* mConcaveMesh;
|
|
||||||
|
|
||||||
/// Box for the floor
|
/// Box for the floor
|
||||||
Box* mFloor;
|
Box* mFloor;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
namespace trianglemeshscene {
|
namespace trianglemeshscene {
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const float SCENE_RADIUS = 30.0f; // Radius of the scene in meters
|
const float SCENE_RADIUS = 70.0f; // Radius of the scene in meters
|
||||||
const int NB_BOXES_X = 8;
|
const int NB_BOXES_X = 8;
|
||||||
const int NB_BOXES_Z = 8;
|
const int NB_BOXES_Z = 8;
|
||||||
const float BOX_SIZE = 3.0f;
|
const float BOX_SIZE = 3.0f;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
namespace heightfieldscene {
|
namespace heightfieldscene {
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const float SCENE_RADIUS = 30.0f;
|
const float SCENE_RADIUS = 50.0f;
|
||||||
|
|
||||||
// Class HeightFieldScene
|
// Class HeightFieldScene
|
||||||
class HeightFieldScene : public SceneDemo {
|
class HeightFieldScene : public SceneDemo {
|
||||||
|
|
|
@ -97,7 +97,7 @@ void Gui::createSimulationPanel() {
|
||||||
mSimulationPanel->setFixedWidth(220);
|
mSimulationPanel->setFixedWidth(220);
|
||||||
|
|
||||||
// Scenes/Physics/Rendering buttons
|
// Scenes/Physics/Rendering buttons
|
||||||
Label* labelControls = new Label(mSimulationPanel, "Controls","sans-bold");
|
new Label(mSimulationPanel, "Controls","sans-bold");
|
||||||
Widget* panelControls = new Widget(mSimulationPanel);
|
Widget* panelControls = new Widget(mSimulationPanel);
|
||||||
panelControls->setLayout(new BoxLayout(Orientation::Horizontal, Alignment::Middle, 0, 5));
|
panelControls->setLayout(new BoxLayout(Orientation::Horizontal, Alignment::Middle, 0, 5));
|
||||||
ToolButton* buttonPlay = new ToolButton(panelControls, ENTYPO_ICON_PLAY);
|
ToolButton* buttonPlay = new ToolButton(panelControls, ENTYPO_ICON_PLAY);
|
||||||
|
@ -127,7 +127,7 @@ void Gui::createSimulationPanel() {
|
||||||
for (uint i=0; i<scenes.size(); i++) {
|
for (uint i=0; i<scenes.size(); i++) {
|
||||||
scenesNames.push_back(scenes[i]->getName().c_str());
|
scenesNames.push_back(scenes[i]->getName().c_str());
|
||||||
}
|
}
|
||||||
Label* labelScenes = new Label(mSimulationPanel, "Scene","sans-bold");
|
new Label(mSimulationPanel, "Scene","sans-bold");
|
||||||
ComboBox* comboBoxScenes = new ComboBox(mSimulationPanel, scenesNames, [&, scenes](int index) {
|
ComboBox* comboBoxScenes = new ComboBox(mSimulationPanel, scenesNames, [&, scenes](int index) {
|
||||||
mApp->switchScene(scenes[index]);
|
mApp->switchScene(scenes[index]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,8 +42,7 @@ openglframework::Color SceneDemo::mDemoColors[] = {SceneDemo::mYellowColorDemo,
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SceneDemo::SceneDemo(const std::string& name, float sceneRadius, bool isShadowMappingEnabled)
|
SceneDemo::SceneDemo(const std::string& name, float sceneRadius, bool isShadowMappingEnabled)
|
||||||
: Scene(name, isShadowMappingEnabled),
|
: Scene(name, isShadowMappingEnabled), mIsShadowMappingInitialized(false),
|
||||||
mLight0(0), mIsShadowMappingInitialized(false),
|
|
||||||
mDepthShader("shaders/depth.vert", "shaders/depth.frag"),
|
mDepthShader("shaders/depth.vert", "shaders/depth.frag"),
|
||||||
mPhongShader("shaders/phong.vert", "shaders/phong.frag"),
|
mPhongShader("shaders/phong.vert", "shaders/phong.frag"),
|
||||||
mQuadShader("shaders/quad.vert", "shaders/quad.frag"),
|
mQuadShader("shaders/quad.vert", "shaders/quad.frag"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user