8 #ifndef GlobeEngine_DrawableComponent_h
9 #define GlobeEngine_DrawableComponent_h
11 #include "OpenGL_Includes.h"
19 #include <vmmlib/vmmlib.hpp>
37 virtual void draw(std::shared_ptr<ge::Camera> _cam);
40 virtual void setScale(vmml::Vector3d _scale);
42 virtual void setRotation(vmml::Vector3d _rotations);
54 virtual void setColor(vmml::Vector3f _color);
55 const vmml::Vector3f
getColor()
const;
74 virtual void setShader(std::shared_ptr<ge::Shader> _shader);
76 const std::shared_ptr<ge::Shader>
getShader()
const;
85 void setMVPMatrix(
const std::shared_ptr<ge::Camera> _cam);
88 #if defined(GENGINE_GL_ES)
120 void addVertex3fAttribute(
unsigned int _bufferPos,
unsigned int _size,
const vmml::Vector3d _value);
121 void addVertex3fAttribute(
unsigned int _bufferPos,
unsigned int _size,
const vmml::Vector3d* _values);
122 void addCustomVertexAttributef(
unsigned int _bufferPos,
unsigned int _attributeCount,
unsigned int _sizePerAttribute,
float** _values);
140 void drawArrays(GLenum _mode, GLint _first, GLsizei _count);
141 void drawElements(GLenum _mode, GLsizei _count,
const GLvoid * _indices);
142 void drawMultiArrays(GLenum _mode,
const GLsizei* _count, GLsizei _drawcount);
Definition: DrawableComponent.h:25
vmml::Matrix4d depthTextureMatrix
Definition: DrawableComponent.h:184
unsigned int getVertexCount() const
Definition: DrawableComponent.h:149
void addVertex3fAttribute(unsigned int _bufferPos, unsigned int _size, const vmml::Vector3d _value)
Definition: DrawableComponent.cpp:456
GLuint occlusionQueryID
Definition: DrawableComponent.h:211
GLint uniformColorPerVertexLocation
Definition: DrawableComponent.h:221
vmml::Matrix4d mvpMatrix
Definition: DrawableComponent.h:180
void setNumberOfVertexAttributes(unsigned int _in)
bool isNormalMapped()
Definition: DrawableComponent.cpp:677
Definition: BoundingBox.h:15
GLuint getNormalTextureHandle() const
Definition: DrawableComponent.cpp:669
void setBoundingSphere(BoundingSphere _boundingSphere)
void setStandardUniforms()
Definition: DrawableComponent.cpp:169
void createMultiDrawPointerList(GLuint _numberOfDrawObjects, GLsizei *_stripLenghts)
Definition: DrawableComponent.cpp:503
ge::IndexBuffer indexBuffer
Definition: DrawableComponent.h:197
void endOcclusionQuery(RENDERSTATE _state)
Definition: DrawableComponent.cpp:309
GLuint normalTexHandle
Definition: DrawableComponent.h:173
void setDepthMatrix(vmml::Matrix4d _mat)
Definition: DrawableComponent.cpp:613
void setNormalMatrix()
Definition: DrawableComponent.cpp:240
vmml::Matrix4d modelMatrix
Definition: DrawableComponent.h:179
~DrawableComponent()
Definition: DrawableComponent.cpp:18
void setVertexAttributePointerForBuffer(unsigned int _bufferID, unsigned int _size, GLenum _type)
Definition: DrawableComponent.cpp:373
DrawableComponent()
Definition: DrawableComponent.cpp:11
bool isVisible() const
Definition: DrawableComponent.cpp:143
unsigned int getColorPerVertex() const
Definition: DrawableComponent.h:60
const BoundingSphere * getBoundingSphere() const
Definition: DrawableComponent.cpp:123
const vmml::Vector3f getColor() const
Definition: DrawableComponent.cpp:158
GLint * multiDrawArraysList
Definition: DrawableComponent.h:201
void setNormalMapped(bool _in)
Definition: DrawableComponent.cpp:673
void recompileShader()
Definition: DrawableComponent.cpp:183
BoundingBox3d * boundingBox
Definition: DrawableComponent.h:176
bool normalMapped
Definition: DrawableComponent.h:172
GLuint vertexCount
Definition: DrawableComponent.h:193
void setVertexAttributePointer(GLuint _bufferID, GLuint _index, GLint _size, GLenum _type)
Definition: DrawableComponent.cpp:355
GLint uniformModelMatrixLocation
Definition: DrawableComponent.h:217
virtual void setColor(vmml::Vector3f _color)
Definition: DrawableComponent.cpp:153
Definition: DrawableComponent.h:28
void setPrimitiveRestartIndex(GLuint _in)
Definition: DrawableComponent.cpp:579
GLint uniformObjectGroupIDLocation
Definition: DrawableComponent.h:223
vmml::Vector3d position
Definition: DrawableComponent.h:163
virtual void draw(std::shared_ptr< ge::Camera > _cam)
Definition: DrawableComponent.cpp:76
vmml::Vector3d scale
Definition: DrawableComponent.h:164
virtual void clear()
Definition: DrawableComponent.cpp:23
bool textured
Definition: DrawableComponent.h:170
GLuint depthTextureHandle
Definition: DrawableComponent.h:185
void setAttributeBuffer1i(int _bufferID, int _input)
Definition: DrawableComponent.cpp:409
void disableVertexAttributes(int vaaSize=2)
Definition: DrawableComponent.cpp:279
Definition: DrawableComponent.h:28
Definition: DrawableComponent.h:28
GLint uniformViewMatrixLocation
Definition: DrawableComponent.h:215
void setTextured(bool _in)
Definition: DrawableComponent.cpp:654
Definition: DrawableComponent.h:28
RENDERSTATE
Definition: DrawableComponent.h:28
ge::VertexBufferArray attributes
Definition: DrawableComponent.h:189
std::shared_ptr< ge::Shader > shader
Definition: DrawableComponent.h:162
GLuint colorTexHandle
Definition: DrawableComponent.h:171
GLint uniformMVPMatrixLocation
Definition: DrawableComponent.h:218
void setMVPMatrix(const std::shared_ptr< ge::Camera > _cam)
Definition: DrawableComponent.cpp:219
Definition: DrawableComponent.h:28
GLuint getQueryResult()
Definition: DrawableComponent.cpp:314
const GLvoid ** multiDrawPointerList
Definition: DrawableComponent.h:200
void disablePointSprites()
Definition: DrawableComponent.cpp:604
void setVertexAttributePointerNormalized(GLuint _bufferID, GLuint _index, GLint _size, GLenum _type)
Definition: DrawableComponent.cpp:361
void setPickingInformation()
Definition: DrawableComponent.cpp:193
void drawMultiElements(GLenum _mode, const GLsizei *_count, GLsizei _drawcount)
Definition: DrawableComponent.cpp:528
void unbindVertexBuffers()
Definition: DrawableComponent.cpp:345
void drawArrays(GLenum _mode, GLint _first, GLsizei _count)
Definition: DrawableComponent.cpp:550
void disablePrimitiveRestart()
Definition: DrawableComponent.cpp:587
bool isGeometryReady() const
Definition: DrawableComponent.cpp:133
GLuint getTextureHandle() const
Definition: DrawableComponent.cpp:650
void drawMultiArrays(GLenum _mode, const GLsizei *_count, GLsizei _drawcount)
Definition: DrawableComponent.cpp:541
virtual void setScale(vmml::Vector3d _scale)
Definition: DrawableComponent.cpp:94
virtual void setColorPerVertex(unsigned int _in)
Definition: DrawableComponent.h:57
DrawableComponent & operator=(const DrawableComponent &_in)=delete
GLuint queryResultPixelCount
Definition: DrawableComponent.h:212
void setModelMatrices()
Definition: DrawableComponent.cpp:229
vmml::Vector3d getScale() const
Definition: DrawableComponent.cpp:102
Definition: GlobeComponent.h:15
bool isTextured()
Definition: DrawableComponent.cpp:658
virtual void setShader(std::shared_ptr< ge::Shader > _shader)
Definition: DrawableComponent.cpp:163
vmml::Matrix4d getModelMatrix() const
Definition: DrawableComponent.cpp:248
void beginOcclusionQuery(RENDERSTATE _state)
Definition: DrawableComponent.cpp:303
void enablePointSprites()
Definition: DrawableComponent.cpp:594
void setVertexLongAttributePointer(GLuint _bufferID, GLuint _index, GLint _size, GLenum _type)
Definition: DrawableComponent.cpp:367
void enablePrimitiveRestart()
Definition: DrawableComponent.cpp:583
virtual void setPosition(vmml::Vector3d _position)
Definition: DrawableComponent.cpp:81
vmml::Vector3d getRotation() const
Definition: DrawableComponent.cpp:118
unsigned int colorPerVertex
Definition: DrawableComponent.h:167
GLint uniformObjectIDLocation
Definition: DrawableComponent.h:222
Definition: AvalancheTrainingSimulationEngine.h:28
void drawElements(GLenum _mode, GLsizei _count, const GLvoid *_indices)
Definition: DrawableComponent.cpp:561
GLuint getDepthTextureHandle() const
Definition: DrawableComponent.cpp:629
GLint uniformObjectColorLocation
Definition: DrawableComponent.h:220
vmml::Vector3d getPosition() const
Definition: DrawableComponent.cpp:89
virtual void setRotation(vmml::Vector3d _rotations)
Definition: DrawableComponent.cpp:107
vmml::Vector3f color
Definition: DrawableComponent.h:166
vmml::Matrix4d getInverseModelMatrix() const
Definition: DrawableComponent.cpp:252
void setTextureHandle(GLuint _handle)
Definition: DrawableComponent.cpp:643
virtual void enableOcclusionQueries(bool _in)
Definition: DrawableComponent.cpp:291
void generateVertexHandlesFromShader(int _bufferCount=0)
Definition: DrawableComponent.cpp:331
GLuint indexCount
Definition: DrawableComponent.h:196
void setAttributeBuffer1f(int _bufferID, float _value)
Definition: DrawableComponent.cpp:428
const std::shared_ptr< ge::Shader > getShader() const
Definition: DrawableComponent.cpp:188
Definition: VertexArrayObject.h:17
const BoundingBox3d * getBoundingBox() const
Definition: DrawableComponent.cpp:128
void setDepthMatrixUniform()
Definition: DrawableComponent.cpp:617
vmml::Vector3d rotations
Definition: DrawableComponent.h:165
Definition: DrawableComponent.h:28
BoundingSphere * boundingSphere
Definition: DrawableComponent.h:175
GLuint multiDrawPointerListSize
Definition: DrawableComponent.h:199
void setDepthTextureHandle(GLuint _handle)
Definition: DrawableComponent.cpp:625
ge::VertexArrayObject vao
Definition: DrawableComponent.h:188
void addCustomVertexAttributef(unsigned int _bufferPos, unsigned int _attributeCount, unsigned int _sizePerAttribute, float **_values)
Definition: DrawableComponent.cpp:486
GLuint occlusionQueryState
Definition: DrawableComponent.h:210
void setViewProjMatrices(const std::shared_ptr< ge::Camera > _cam)
Definition: DrawableComponent.cpp:205
void setDepthUniforms()
Definition: DrawableComponent.cpp:637
void fillIndexBufferWithLinearValues()
Definition: DrawableComponent.cpp:391
void setBoundingBox(BoundingBox3d _boundingBox)
Definition: DrawableComponent.h:28
vmml::Matrix3d normalMatrix
Definition: DrawableComponent.h:181
void setNormalTextureHandle(GLuint _handle)
Definition: DrawableComponent.cpp:662
GLint uniformProjectionMatrixLocation
Definition: DrawableComponent.h:216
void enableVertexAttributes(int vaaSize=2)
Definition: DrawableComponent.cpp:263
Definition: DrawableComponent.h:28
Definition: BoundingSphere.h:19