Merge branch 'master' of https://git.epicsparrow.com/EpicSparrow/SparrowEngine
This commit is contained in:
commit
93049b41fd
@ -121,6 +121,7 @@ void Engine::update()
|
|||||||
{
|
{
|
||||||
m_physicsDebugNode->clearBuffers();
|
m_physicsDebugNode->clearBuffers();
|
||||||
m_world->debugDrawWorld();
|
m_world->debugDrawWorld();
|
||||||
|
getScene()->registerMeshType(m_physicsDebugNode->getFlags());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ PhysicsDebugNode::PhysicsDebugNode() :
|
|||||||
m_geometry.mesh->updateFlags();
|
m_geometry.mesh->updateFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PhysicsDebugNode::~PhysicsDebugNode()
|
||||||
|
{
|
||||||
|
delete m_geometry.mesh;
|
||||||
|
}
|
||||||
|
|
||||||
void PhysicsDebugNode::drawLine(const btVector3& from, const btVector3& to, const btVector3& color)
|
void PhysicsDebugNode::drawLine(const btVector3& from, const btVector3& to, const btVector3& color)
|
||||||
{
|
{
|
||||||
glm::vec3 glColor(color.x(), color.y(), color.z());
|
glm::vec3 glColor(color.x(), color.y(), color.z());
|
||||||
|
@ -2,15 +2,16 @@
|
|||||||
#define PHYSICSDEBUGNODE_H
|
#define PHYSICSDEBUGNODE_H
|
||||||
|
|
||||||
#include "meshnode.h"
|
#include "meshnode.h"
|
||||||
|
#include <SparrowRenderer/mesh.h>
|
||||||
#include <LinearMath/btIDebugDraw.h>
|
#include <LinearMath/btIDebugDraw.h>
|
||||||
|
|
||||||
class PhysicsDebugNode : public MeshNode, public btIDebugDraw
|
class PhysicsDebugNode : public MeshNode, public btIDebugDraw
|
||||||
{
|
{
|
||||||
Mesh* m_debugMesh;
|
|
||||||
int m_debugMode;
|
int m_debugMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PhysicsDebugNode();
|
PhysicsDebugNode();
|
||||||
|
~PhysicsDebugNode();
|
||||||
|
|
||||||
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color);
|
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 void setDebugMode(int debugMode) { m_debugMode = debugMode; }
|
||||||
virtual int getDebugMode() const { return m_debugMode; }
|
virtual int getDebugMode() const { return m_debugMode; }
|
||||||
|
|
||||||
|
unsigned int getFlags() { m_geometry.mesh->getFlags(); }
|
||||||
|
|
||||||
void clearBuffers();
|
void clearBuffers();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ public:
|
|||||||
DeferredPipeline* pipeline = dynamic_cast<DeferredPipeline*>(scene->getPipeline());
|
DeferredPipeline* pipeline = dynamic_cast<DeferredPipeline*>(scene->getPipeline());
|
||||||
pipeline->setSkybox(RESOURCE_GET(Texture, "skybox"));
|
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);
|
LightNode *sunLight = new LightNode(sun);
|
||||||
|
|
||||||
scene->getRootObject()->addChild(ambientLight);
|
scene->getRootObject()->addChild(ambientLight);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user