[DEV] update sharedPtr
This commit is contained in:
parent
1a97ed92ac
commit
00045ece2b
@ -229,7 +229,7 @@ namespace ege {
|
|||||||
void addStaticMeshToDraw(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
|
void addStaticMeshToDraw(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
|
||||||
m_listMeshToDrawFirst.push_back(_mesh);
|
m_listMeshToDrawFirst.push_back(_mesh);
|
||||||
}
|
}
|
||||||
const std::vector<ememory::SharedPtr<ege::resource::Mesh>>& getStaticMeshToDraw() {
|
std::vector<ememory::SharedPtr<ege::resource::Mesh>>& getStaticMeshToDraw() {
|
||||||
return m_listMeshToDrawFirst;
|
return m_listMeshToDrawFirst;
|
||||||
}
|
}
|
||||||
virtual void onChangePropertyStatus();
|
virtual void onChangePropertyStatus();
|
||||||
|
@ -25,7 +25,7 @@ ege::Light::~Light() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::Light::link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName) {
|
void ege::Light::link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName) {
|
||||||
if (_prog == nullptr) {
|
if (_prog == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ void ege::Light::link(const ememory::SharedPtr<gale::resource::Program>& _prog,
|
|||||||
m_GL_specularColor = _prog->getUniform(_baseName+".specularColor");
|
m_GL_specularColor = _prog->getUniform(_baseName+".specularColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::Light::draw(const ememory::SharedPtr<gale::resource::Program>& _prog) {
|
void ege::Light::draw(ememory::SharedPtr<gale::resource::Program> _prog) {
|
||||||
_prog->uniform3(m_GL_direction, m_direction);
|
_prog->uniform3(m_GL_direction, m_direction);
|
||||||
_prog->uniform3(m_GL_halfplane, m_halfplane);
|
_prog->uniform3(m_GL_halfplane, m_halfplane);
|
||||||
_prog->uniform4(m_GL_ambientColor, m_ambientColor);
|
_prog->uniform4(m_GL_ambientColor, m_ambientColor);
|
||||||
|
@ -29,8 +29,8 @@ namespace ege {
|
|||||||
public:
|
public:
|
||||||
Light();
|
Light();
|
||||||
~Light();
|
~Light();
|
||||||
void link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName);
|
void link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName);
|
||||||
void draw(const ememory::SharedPtr<gale::resource::Program>& _prog);
|
void draw(ememory::SharedPtr<gale::resource::Program> _prog);
|
||||||
void setDirection(const vec3& val) {
|
void setDirection(const vec3& val) {
|
||||||
m_direction = val;
|
m_direction = val;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ ege::MaterialGlId::MaterialGlId() :
|
|||||||
// nothing to do else ...
|
// nothing to do else ...
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::MaterialGlId::link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName) {
|
void ege::MaterialGlId::link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName) {
|
||||||
if (_prog == nullptr) {
|
if (_prog == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ ege::Material::~Material() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::Material::draw(const ememory::SharedPtr<gale::resource::Program>& _prog, const MaterialGlId& _glID) {
|
void ege::Material::draw(ememory::SharedPtr<gale::resource::Program> _prog, const MaterialGlId& _glID) {
|
||||||
EGE_INFO("draw Material : (start)");
|
EGE_INFO("draw Material : (start)");
|
||||||
_prog->uniform4(_glID.m_GL_ambientFactor, m_ambientFactor);
|
_prog->uniform4(_glID.m_GL_ambientFactor, m_ambientFactor);
|
||||||
_prog->uniform4(_glID.m_GL_diffuseFactor, m_diffuseFactor);
|
_prog->uniform4(_glID.m_GL_diffuseFactor, m_diffuseFactor);
|
||||||
|
@ -24,7 +24,7 @@ namespace ege {
|
|||||||
int32_t m_GL_shininess;
|
int32_t m_GL_shininess;
|
||||||
int32_t m_GL_texture0;
|
int32_t m_GL_texture0;
|
||||||
MaterialGlId();
|
MaterialGlId();
|
||||||
void link(const ememory::SharedPtr<gale::resource::Program>& _prog, const std::string& _baseName);
|
void link(ememory::SharedPtr<gale::resource::Program> _prog, const std::string& _baseName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ namespace ege {
|
|||||||
public:
|
public:
|
||||||
Material();
|
Material();
|
||||||
~Material();
|
~Material();
|
||||||
void draw(const ememory::SharedPtr<gale::resource::Program>& _prog, const ege::MaterialGlId& _glID);
|
void draw(ememory::SharedPtr<gale::resource::Program> _prog, const ege::MaterialGlId& _glID);
|
||||||
void setAmbientFactor(const vec4& _val) {
|
void setAmbientFactor(const vec4& _val) {
|
||||||
m_ambientFactor = _val;
|
m_ambientFactor = _val;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ namespace ege {
|
|||||||
* @brief Debug display of the current element
|
* @brief Debug display of the current element
|
||||||
* @param[in,out] draw Basic system to draw the debug shape and informations
|
* @param[in,out] draw Basic system to draw the debug shape and informations
|
||||||
*/
|
*/
|
||||||
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) { }
|
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) { }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ ege::Ray ege::camera::View::getRayFromScreen(const vec2& _offset) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::camera::View::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
|
void ege::camera::View::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
||||||
mat4 mat;
|
mat4 mat;
|
||||||
if (_camera != sharedFromThis()) {
|
if (_camera != sharedFromThis()) {
|
||||||
mat.identity();
|
mat.identity();
|
||||||
|
@ -73,7 +73,7 @@ namespace ege {
|
|||||||
virtual vec3 getViewVector() const;
|
virtual vec3 getViewVector() const;
|
||||||
public:
|
public:
|
||||||
virtual ege::Ray getRayFromScreen(const vec2& _offset);
|
virtual ege::Ray getRayFromScreen(const vec2& _offset);
|
||||||
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
|
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
||||||
virtual float getTetha();
|
virtual float getTetha();
|
||||||
virtual float getPsy();
|
virtual float getPsy();
|
||||||
};
|
};
|
||||||
|
@ -85,7 +85,7 @@ bool ege::Element::loadMesh(const std::string& _meshFileName) {
|
|||||||
return setMesh(tmpMesh);
|
return setMesh(tmpMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ege::Element::setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
|
bool ege::Element::setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh) {
|
||||||
if (m_mesh != nullptr) {
|
if (m_mesh != nullptr) {
|
||||||
m_mesh.reset();
|
m_mesh.reset();
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ const float lifeHeight = 0.3f;
|
|||||||
const float lifeWidth = 2.0f;
|
const float lifeWidth = 2.0f;
|
||||||
const float lifeYPos = 1.7f;
|
const float lifeYPos = 1.7f;
|
||||||
|
|
||||||
void ege::Element::drawLife(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
|
void ege::Element::drawLife(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
||||||
if (_draw == nullptr) {
|
if (_draw == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ void ege::Element::drawLife(const ememory::SharedPtr<ewol::resource::Colored3DOb
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::Element::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
|
void ege::Element::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
||||||
m_debugText.clear();
|
m_debugText.clear();
|
||||||
m_debugText.setColor(etk::Color<>(0x00, 0xFF, 0x00, 0xFF));
|
m_debugText.setColor(etk::Color<>(0x00, 0xFF, 0x00, 0xFF));
|
||||||
m_debugText.setPos(vec3(-20,32,0));
|
m_debugText.setPos(vec3(-20,32,0));
|
||||||
|
@ -82,12 +82,12 @@ namespace ege {
|
|||||||
* @note : this remove the shape and the mesh properties.
|
* @note : this remove the shape and the mesh properties.
|
||||||
* @return true if no error occured
|
* @return true if no error occured
|
||||||
*/
|
*/
|
||||||
virtual bool setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh);
|
virtual bool setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh);
|
||||||
/**
|
/**
|
||||||
* @brief get a pointer on the Mesh file.
|
* @brief get a pointer on the Mesh file.
|
||||||
* @return the mesh pointer.
|
* @return the mesh pointer.
|
||||||
*/
|
*/
|
||||||
inline const ememory::SharedPtr<ege::resource::Mesh>& getMesh() {
|
inline ememory::SharedPtr<ege::resource::Mesh> getMesh() {
|
||||||
return m_mesh;
|
return m_mesh;
|
||||||
};
|
};
|
||||||
protected:
|
protected:
|
||||||
@ -159,7 +159,7 @@ namespace ege {
|
|||||||
* @brief draw the current life of the element
|
* @brief draw the current life of the element
|
||||||
*/
|
*/
|
||||||
// TODO : Remove this ...
|
// TODO : Remove this ...
|
||||||
virtual void drawLife(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
|
virtual void drawLife(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// For debug only ...
|
// For debug only ...
|
||||||
@ -169,7 +169,7 @@ namespace ege {
|
|||||||
* @brief Debug display of the current element
|
* @brief Debug display of the current element
|
||||||
* @param[in,out] draw Basic system to draw the debug shape and informations
|
* @param[in,out] draw Basic system to draw the debug shape and informations
|
||||||
*/
|
*/
|
||||||
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
|
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get the theoric position. Sometimes, the element has move due to an explosion or something else, then its real position in not the one that woult it be at the end ...
|
* @brief get the theoric position. Sometimes, the element has move due to an explosion or something else, then its real position in not the one that woult it be at the end ...
|
||||||
|
@ -72,9 +72,9 @@ void ege::ElementPhysic::createRigidBody(float _mass) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ege::ElementPhysic::setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh) {
|
bool ege::ElementPhysic::setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh) {
|
||||||
EGE_WARNING("Set Mesh");
|
EGE_WARNING("Set Mesh");
|
||||||
if (nullptr!=m_mesh) {
|
if (m_mesh != nullptr) {
|
||||||
removeShape();
|
removeShape();
|
||||||
}
|
}
|
||||||
ege::Element::setMesh(_mesh);
|
ege::Element::setMesh(_mesh);
|
||||||
@ -170,7 +170,7 @@ const float ege::ElementPhysic::getInvMass() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void ege::ElementPhysic::drawShape(const btCollisionShape* _shape,
|
void ege::ElementPhysic::drawShape(const btCollisionShape* _shape,
|
||||||
const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw,
|
ememory::SharedPtr<ewol::resource::Colored3DObject> _draw,
|
||||||
mat4 _transformationMatrix,
|
mat4 _transformationMatrix,
|
||||||
std::vector<vec3> _tmpVertices) {
|
std::vector<vec3> _tmpVertices) {
|
||||||
if( _draw == nullptr
|
if( _draw == nullptr
|
||||||
@ -316,7 +316,7 @@ void ege::ElementPhysic::drawShape(const btCollisionShape* _shape,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::ElementPhysic::drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera) {
|
void ege::ElementPhysic::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
||||||
ege::Element::drawDebug(_draw, _camera);
|
ege::Element::drawDebug(_draw, _camera);
|
||||||
btScalar mmm[16];
|
btScalar mmm[16];
|
||||||
btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState();
|
btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState();
|
||||||
|
@ -76,7 +76,7 @@ namespace ege {
|
|||||||
*/
|
*/
|
||||||
void removeShape();
|
void removeShape();
|
||||||
public:
|
public:
|
||||||
virtual bool setMesh(const ememory::SharedPtr<ege::resource::Mesh>& _mesh);
|
virtual bool setMesh(ememory::SharedPtr<ege::resource::Mesh> _mesh);
|
||||||
/**
|
/**
|
||||||
* @brief draw the curent element (can have multiple display)
|
* @brief draw the curent element (can have multiple display)
|
||||||
* @param[in] pass Id of the current pass : [0..?]
|
* @param[in] pass Id of the current pass : [0..?]
|
||||||
@ -175,10 +175,10 @@ namespace ege {
|
|||||||
virtual void onDestroy() {};
|
virtual void onDestroy() {};
|
||||||
virtual const vec3& getPosition();
|
virtual const vec3& getPosition();
|
||||||
virtual void setPosition(const vec3& _pos);
|
virtual void setPosition(const vec3& _pos);
|
||||||
virtual void drawDebug(const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw, const ememory::SharedPtr<ege::Camera>& _camera);
|
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
||||||
protected:
|
protected:
|
||||||
void drawShape(const btCollisionShape* _shape,
|
void drawShape(const btCollisionShape* _shape,
|
||||||
const ememory::SharedPtr<ewol::resource::Colored3DObject>& _draw,
|
ememory::SharedPtr<ewol::resource::Colored3DObject> _draw,
|
||||||
mat4 _transformationMatrix,
|
mat4 _transformationMatrix,
|
||||||
std::vector<vec3> _tmpVertices);
|
std::vector<vec3> _tmpVertices);
|
||||||
protected:
|
protected:
|
||||||
|
@ -18,7 +18,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::box;
|
return ege::PhysicsShape::box;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
@ -19,7 +19,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::capsule;
|
return ege::PhysicsShape::capsule;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
@ -17,7 +17,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::cone;
|
return ege::PhysicsShape::cone;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
@ -17,7 +17,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::convexHull;
|
return ege::PhysicsShape::convexHull;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
@ -19,7 +19,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::cylinder;
|
return ege::PhysicsShape::cylinder;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
@ -43,7 +43,7 @@ namespace ege {
|
|||||||
|
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::unknow;
|
return ege::PhysicsShape::unknow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace ege {
|
|||||||
virtual bool parse(const char* _line);
|
virtual bool parse(const char* _line);
|
||||||
virtual void display() {};
|
virtual void display() {};
|
||||||
public:
|
public:
|
||||||
virtual enum ege::PhysicsShape::type getType() {
|
virtual enum ege::PhysicsShape::type getType() const {
|
||||||
return ege::PhysicsShape::sphere;
|
return ege::PhysicsShape::sphere;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user