Fix merge mess
This commit is contained in:
parent
87b88fc953
commit
494f866357
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -25,3 +25,7 @@ Thumbs.db
|
||||||
# vim swap files
|
# vim swap files
|
||||||
#####################
|
#####################
|
||||||
*.*sw*
|
*.*sw*
|
||||||
|
|
||||||
|
# CMake build directory
|
||||||
|
#######################
|
||||||
|
build/*
|
||||||
|
|
|
@ -400,13 +400,8 @@ void RigidBody::updateBroadPhaseState() const {
|
||||||
|
|
||||||
PROFILE("RigidBody::updateBroadPhaseState()");
|
PROFILE("RigidBody::updateBroadPhaseState()");
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
DynamicsWorld& world = static_cast<DynamicsWorld&>(mWorld);
|
DynamicsWorld& world = static_cast<DynamicsWorld&>(mWorld);
|
||||||
const Vector3 displacement = world.mTimer.getTimeStep() * mLinearVelocity;
|
const Vector3 displacement = world.mTimer.getTimeStep() * mLinearVelocity;
|
||||||
=======
|
|
||||||
DynamicsWorld& world = dynamic_cast<DynamicsWorld&>(mWorld);
|
|
||||||
const Vector3 displacement = world.mTimeStep* mLinearVelocity;
|
|
||||||
>>>>>>> 1bde11f245806de07a12b1cf6c33cdb83046b882
|
|
||||||
|
|
||||||
// For all the proxy collision shapes of the body
|
// For all the proxy collision shapes of the body
|
||||||
for (ProxyShape* shape = mProxyCollisionShapes; shape != NULL; shape = shape->mNext) {
|
for (ProxyShape* shape = mProxyCollisionShapes; shape != NULL; shape = shape->mNext) {
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||||
*********************************************************************************
|
*********************************************************************************
|
||||||
* *
|
* *
|
||||||
* This software is provided 'as-is', without any express or implied warranty. *
|
* This software is provided 'as-is', without any express or implied warranty. *
|
||||||
* In no event will the authors be held liable for any damages arising from the *
|
* In no event will the authors be held liable for any damages arising from the *
|
||||||
* use of this software. *
|
* use of this software. *
|
||||||
* *
|
* *
|
||||||
* Permission is granted to anyone to use this software for any purpose, *
|
* Permission is granted to anyone to use this software for any purpose, *
|
||||||
* including commercial applications, and to alter it and redistribute it *
|
* including commercial applications, and to alter it and redistribute it *
|
||||||
* freely, subject to the following restrictions: *
|
* freely, subject to the following restrictions: *
|
||||||
* *
|
* *
|
||||||
* 1. The origin of this software must not be misrepresented; you must not claim *
|
* 1. The origin of this software must not be misrepresented; you must not claim *
|
||||||
* that you wrote the original software. If you use this software in a *
|
* that you wrote the original software. If you use this software in a *
|
||||||
* product, an acknowledgment in the product documentation would be *
|
* product, an acknowledgment in the product documentation would be *
|
||||||
* appreciated but is not required. *
|
* appreciated but is not required. *
|
||||||
* *
|
* *
|
||||||
* 2. Altered source versions must be plainly marked as such, and must not be *
|
* 2. Altered source versions must be plainly marked as such, and must not be *
|
||||||
* misrepresented as being the original software. *
|
* misrepresented as being the original software. *
|
||||||
* *
|
* *
|
||||||
* 3. This notice may not be removed or altered from any source distribution. *
|
* 3. This notice may not be removed or altered from any source distribution. *
|
||||||
* *
|
* *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#ifndef BOX_H
|
#ifndef BOX_H
|
||||||
#define BOX_H
|
#define BOX_H
|
||||||
|
@ -34,73 +34,67 @@
|
||||||
// Class Box
|
// Class Box
|
||||||
class Box : public openglframework::Object3D, public PhysicsObject {
|
class Box : public openglframework::Object3D, public PhysicsObject {
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
// -------------------- Attributes -------------------- //
|
// -------------------- Attributes -------------------- //
|
||||||
|
|
||||||
/// Size of each side of the box
|
/// Size of each side of the box
|
||||||
float mSize[3];
|
float mSize[3];
|
||||||
|
|
||||||
/// Scaling matrix (applied to a cube to obtain the correct box dimensions)
|
/// Scaling matrix (applied to a cube to obtain the correct box dimensions)
|
||||||
openglframework::Matrix4 mScalingMatrix;
|
openglframework::Matrix4 mScalingMatrix;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the vertices data used to render the box with OpenGL
|
/// Vertex Buffer Object for the vertices data used to render the box with OpenGL
|
||||||
static openglframework::VertexBufferObject mVBOVertices;
|
static openglframework::VertexBufferObject mVBOVertices;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the normales used to render the box with OpenGL
|
/// Vertex Buffer Object for the normales used to render the box with OpenGL
|
||||||
static openglframework::VertexBufferObject mVBONormals;
|
static openglframework::VertexBufferObject mVBONormals;
|
||||||
|
|
||||||
/// Vertex Array Object for the vertex data
|
/// Vertex Array Object for the vertex data
|
||||||
static openglframework::VertexArrayObject mVAO;
|
static openglframework::VertexArrayObject mVAO;
|
||||||
|
|
||||||
/// Vertices coordinates of the triangles of the box
|
/// Vertices coordinates of the triangles of the box
|
||||||
static GLfloat mCubeVertices[108];
|
static GLfloat mCubeVertices[108];
|
||||||
|
|
||||||
/// Vertices normals of the triangles of the box
|
/// Vertices normals of the triangles of the box
|
||||||
static GLfloat mCubeNormals[108];
|
static GLfloat mCubeNormals[108];
|
||||||
|
|
||||||
/// Total number of boxes created
|
/// Total number of boxes created
|
||||||
static int totalNbBoxes;
|
static int totalNbBoxes;
|
||||||
|
|
||||||
// -------------------- Methods -------------------- //
|
// -------------------- Methods -------------------- //
|
||||||
|
|
||||||
/// Create a the VAO and VBOs to render to box with OpenGL
|
/// Create a the VAO and VBOs to render to box with OpenGL
|
||||||
static void createVBOAndVAO();
|
static void createVBOAndVAO();
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
// -------------------- Methods -------------------- //
|
// -------------------- Methods -------------------- //
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
||||||
reactphysics3d::CollisionWorld* world);
|
reactphysics3d::CollisionWorld* world);
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
||||||
float mass, reactphysics3d::DynamicsWorld *world);
|
float mass, reactphysics3d::DynamicsWorld *world);
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~Box();
|
~Box();
|
||||||
|
|
||||||
/// Render the cube at the correct position and with the correct orientation
|
/// Render the cube at the correct position and with the correct orientation
|
||||||
void render(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix);
|
void render(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix);
|
||||||
|
|
||||||
/// Set the position of the box
|
/// Set the position of the box
|
||||||
void resetTransform(const rp3d::Transform& transform);
|
void resetTransform(const rp3d::Transform& transform);
|
||||||
|
|
||||||
/// Update the transform matrix of the object
|
/// Update the transform matrix of the object
|
||||||
virtual void updateTransform(float interpolationFactor);
|
virtual void updateTransform(float interpolationFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
<<<<<<< HEAD:examples/common/Box.h
|
|
||||||
// Return a pointer to the rigid body of the box
|
|
||||||
inline rp3d::RigidBody* Box::getRigidBody() {
|
|
||||||
return static_cast<rp3d::RigidBody*>(mRigidBody);
|
|
||||||
=======
|
|
||||||
// Update the transform matrix of the object
|
// Update the transform matrix of the object
|
||||||
inline void Box::updateTransform(float interpolationFactor) {
|
inline void Box::updateTransform(float interpolationFactor) {
|
||||||
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
||||||
>>>>>>> 1bde11f245806de07a12b1cf6c33cdb83046b882:testbed/common/Box.h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||||
*********************************************************************************
|
*********************************************************************************
|
||||||
* *
|
* *
|
||||||
* This software is provided 'as-is', without any express or implied warranty. *
|
* This software is provided 'as-is', without any express or implied warranty. *
|
||||||
* In no event will the authors be held liable for any damages arising from the *
|
* In no event will the authors be held liable for any damages arising from the *
|
||||||
* use of this software. *
|
* use of this software. *
|
||||||
* *
|
* *
|
||||||
* Permission is granted to anyone to use this software for any purpose, *
|
* Permission is granted to anyone to use this software for any purpose, *
|
||||||
* including commercial applications, and to alter it and redistribute it *
|
* including commercial applications, and to alter it and redistribute it *
|
||||||
* freely, subject to the following restrictions: *
|
* freely, subject to the following restrictions: *
|
||||||
* *
|
* *
|
||||||
* 1. The origin of this software must not be misrepresented; you must not claim *
|
* 1. The origin of this software must not be misrepresented; you must not claim *
|
||||||
* that you wrote the original software. If you use this software in a *
|
* that you wrote the original software. If you use this software in a *
|
||||||
* product, an acknowledgment in the product documentation would be *
|
* product, an acknowledgment in the product documentation would be *
|
||||||
* appreciated but is not required. *
|
* appreciated but is not required. *
|
||||||
* *
|
* *
|
||||||
* 2. Altered source versions must be plainly marked as such, and must not be *
|
* 2. Altered source versions must be plainly marked as such, and must not be *
|
||||||
* misrepresented as being the original software. *
|
* misrepresented as being the original software. *
|
||||||
* *
|
* *
|
||||||
* 3. This notice may not be removed or altered from any source distribution. *
|
* 3. This notice may not be removed or altered from any source distribution. *
|
||||||
* *
|
* *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#ifndef CAPSULE_H
|
#ifndef CAPSULE_H
|
||||||
#define CAPSULE_H
|
#define CAPSULE_H
|
||||||
|
@ -34,81 +34,75 @@
|
||||||
// Class Sphere
|
// Class Sphere
|
||||||
class Capsule : public openglframework::Mesh, public PhysicsObject {
|
class Capsule : public openglframework::Mesh, public PhysicsObject {
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
// -------------------- Attributes -------------------- //
|
// -------------------- Attributes -------------------- //
|
||||||
|
|
||||||
/// Radius of the capsule
|
/// Radius of the capsule
|
||||||
float mRadius;
|
float mRadius;
|
||||||
|
|
||||||
/// Height of the capsule
|
/// Height of the capsule
|
||||||
float mHeight;
|
float mHeight;
|
||||||
|
|
||||||
/// Scaling matrix (applied to a sphere to obtain the correct sphere dimensions)
|
/// Scaling matrix (applied to a sphere to obtain the correct sphere dimensions)
|
||||||
openglframework::Matrix4 mScalingMatrix;
|
openglframework::Matrix4 mScalingMatrix;
|
||||||
|
|
||||||
/// Previous transform (for interpolation)
|
/// Previous transform (for interpolation)
|
||||||
rp3d::Transform mPreviousTransform;
|
rp3d::Transform mPreviousTransform;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the vertices data
|
/// Vertex Buffer Object for the vertices data
|
||||||
static openglframework::VertexBufferObject mVBOVertices;
|
static openglframework::VertexBufferObject mVBOVertices;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the normals data
|
/// Vertex Buffer Object for the normals data
|
||||||
static openglframework::VertexBufferObject mVBONormals;
|
static openglframework::VertexBufferObject mVBONormals;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the texture coords
|
/// Vertex Buffer Object for the texture coords
|
||||||
static openglframework::VertexBufferObject mVBOTextureCoords;
|
static openglframework::VertexBufferObject mVBOTextureCoords;
|
||||||
|
|
||||||
/// Vertex Buffer Object for the indices
|
/// Vertex Buffer Object for the indices
|
||||||
static openglframework::VertexBufferObject mVBOIndices;
|
static openglframework::VertexBufferObject mVBOIndices;
|
||||||
|
|
||||||
/// Vertex Array Object for the vertex data
|
/// Vertex Array Object for the vertex data
|
||||||
static openglframework::VertexArrayObject mVAO;
|
static openglframework::VertexArrayObject mVAO;
|
||||||
|
|
||||||
// Total number of capsules created
|
// Total number of capsules created
|
||||||
static int totalNbCapsules;
|
static int totalNbCapsules;
|
||||||
|
|
||||||
// -------------------- Methods -------------------- //
|
// -------------------- Methods -------------------- //
|
||||||
|
|
||||||
// Create the Vertex Buffer Objects used to render with OpenGL.
|
// Create the Vertex Buffer Objects used to render with OpenGL.
|
||||||
void createVBOAndVAO();
|
void createVBOAndVAO();
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
// -------------------- Methods -------------------- //
|
// -------------------- Methods -------------------- //
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Capsule(float radius, float height, const openglframework::Vector3& position,
|
Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||||
reactphysics3d::CollisionWorld* world, const std::string& meshFolderPath);
|
reactphysics3d::CollisionWorld* world, const std::string& meshFolderPath);
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
Capsule(float radius, float height, const openglframework::Vector3& position,
|
Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||||
const std::string& meshFolderPath);
|
const std::string& meshFolderPath);
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~Capsule();
|
~Capsule();
|
||||||
|
|
||||||
/// Render the sphere at the correct position and with the correct orientation
|
/// Render the sphere at the correct position and with the correct orientation
|
||||||
void render(openglframework::Shader& shader,
|
void render(openglframework::Shader& shader,
|
||||||
const openglframework::Matrix4& worldToCameraMatrix);
|
const openglframework::Matrix4& worldToCameraMatrix);
|
||||||
|
|
||||||
/// Set the position of the box
|
/// Set the position of the box
|
||||||
void resetTransform(const rp3d::Transform& transform);
|
void resetTransform(const rp3d::Transform& transform);
|
||||||
|
|
||||||
/// Update the transform matrix of the object
|
/// Update the transform matrix of the object
|
||||||
virtual void updateTransform(float interpolationFactor);
|
virtual void updateTransform(float interpolationFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
<<<<<<< HEAD:examples/common/Capsule.h
|
|
||||||
// Return a pointer to the rigid body of the box
|
|
||||||
inline rp3d::RigidBody* Capsule::getRigidBody() {
|
|
||||||
return static_cast<rp3d::RigidBody*>(mRigidBody);
|
|
||||||
=======
|
|
||||||
// Update the transform matrix of the object
|
// Update the transform matrix of the object
|
||||||
inline void Capsule::updateTransform(float interpolationFactor) {
|
inline void Capsule::updateTransform(float interpolationFactor) {
|
||||||
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
||||||
>>>>>>> 1bde11f245806de07a12b1cf6c33cdb83046b882:testbed/common/Capsule.h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -99,15 +99,8 @@ class Cone : public openglframework::Mesh, public PhysicsObject {
|
||||||
virtual void updateTransform(float interpolationFactor);
|
virtual void updateTransform(float interpolationFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
<<<<<<< HEAD:examples/common/Cone.h
|
|
||||||
// Return a pointer to the rigid body of the box
|
|
||||||
inline rp3d::RigidBody* Cone::getRigidBody() {
|
|
||||||
return static_cast<rp3d::RigidBody*>(mRigidBody);
|
|
||||||
=======
|
|
||||||
// Update the transform matrix of the object
|
|
||||||
inline void Cone::updateTransform(float interpolationFactor) {
|
inline void Cone::updateTransform(float interpolationFactor) {
|
||||||
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
||||||
>>>>>>> 1bde11f245806de07a12b1cf6c33cdb83046b882:testbed/common/Cone.h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -96,15 +96,9 @@ class Sphere : public openglframework::Mesh, public PhysicsObject {
|
||||||
virtual void updateTransform(float interpolationFactor);
|
virtual void updateTransform(float interpolationFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
<<<<<<< HEAD:examples/common/Sphere.h
|
|
||||||
// Return a pointer to the rigid body of the box
|
|
||||||
inline rp3d::RigidBody* Sphere::getRigidBody() {
|
|
||||||
return static_cast<rp3d::RigidBody*>(mRigidBody);
|
|
||||||
=======
|
|
||||||
// Update the transform matrix of the object
|
// Update the transform matrix of the object
|
||||||
inline void Sphere::updateTransform(float interpolationFactor) {
|
inline void Sphere::updateTransform(float interpolationFactor) {
|
||||||
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
mTransformMatrix = computeTransform(interpolationFactor, mScalingMatrix);
|
||||||
>>>>>>> 1bde11f245806de07a12b1cf6c33cdb83046b882:testbed/common/Sphere.h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user