fixed the pysicsDebugNode
This commit is contained in:
parent
ccbde75d9b
commit
69b84faf58
@ -121,6 +121,7 @@ void Engine::update()
|
||||
{
|
||||
m_physicsDebugNode->clearBuffers();
|
||||
m_world->debugDrawWorld();
|
||||
getScene()->registerMeshType(m_physicsDebugNode->getFlags());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,11 @@ PhysicsDebugNode::PhysicsDebugNode() :
|
||||
m_geometry.mesh->updateFlags();
|
||||
}
|
||||
|
||||
PhysicsDebugNode::~PhysicsDebugNode()
|
||||
{
|
||||
delete m_geometry.mesh;
|
||||
}
|
||||
|
||||
void PhysicsDebugNode::drawLine(const btVector3& from, const btVector3& to, const btVector3& color)
|
||||
{
|
||||
glm::vec3 glColor(color.x(), color.y(), color.z());
|
||||
|
@ -2,15 +2,16 @@
|
||||
#define PHYSICSDEBUGNODE_H
|
||||
|
||||
#include "meshnode.h"
|
||||
#include <SparrowRenderer/mesh.h>
|
||||
#include <LinearMath/btIDebugDraw.h>
|
||||
|
||||
class PhysicsDebugNode : public MeshNode, public btIDebugDraw
|
||||
{
|
||||
Mesh* m_debugMesh;
|
||||
int m_debugMode;
|
||||
|
||||
public:
|
||||
PhysicsDebugNode();
|
||||
~PhysicsDebugNode();
|
||||
|
||||
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
|
||||
|
||||
@ -26,6 +27,8 @@ public:
|
||||
virtual void setDebugMode(int debugMode) { m_debugMode = debugMode; }
|
||||
virtual int getDebugMode() const { return m_debugMode; }
|
||||
|
||||
unsigned int getFlags() { m_geometry.mesh->getFlags(); }
|
||||
|
||||
void clearBuffers();
|
||||
};
|
||||
|
||||
|
@ -209,7 +209,7 @@ public:
|
||||
DeferredPipeline* pipeline = dynamic_cast<DeferredPipeline*>(scene->getPipeline());
|
||||
pipeline->setSkybox(RESOURCE_GET(Texture, "skybox"));
|
||||
|
||||
DirectionnalLight* sun = new DirectionnalLight(glm::vec3(5, 8, -2), glm::vec3(0.9f));
|
||||
DirectionnalLight* sun = new DirectionnalLight(glm::vec3(5, 8, -2), glm::vec3(4.f));
|
||||
LightNode *sunLight = new LightNode(sun);
|
||||
|
||||
scene->getRootObject()->addChild(ambientLight);
|
||||
|
Loading…
x
Reference in New Issue
Block a user