2016-06-01 05:55:13 +00:00
|
|
|
#ifndef TINY_RENDERER_VISUAL_SHAPE_CONVERTER_H
|
|
|
|
#define TINY_RENDERER_VISUAL_SHAPE_CONVERTER_H
|
|
|
|
|
2018-01-17 20:48:48 +00:00
|
|
|
#include "../../../Importers/ImportURDFDemo/UrdfRenderingInterface.h"
|
2016-06-01 05:55:13 +00:00
|
|
|
|
2018-01-17 20:48:48 +00:00
|
|
|
struct TinyRendererVisualShapeConverter : public UrdfRenderingInterface
|
2016-06-01 05:55:13 +00:00
|
|
|
{
|
|
|
|
struct TinyRendererVisualShapeConverterInternalData* m_data;
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2016-06-01 05:55:13 +00:00
|
|
|
TinyRendererVisualShapeConverter();
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2016-06-01 05:55:13 +00:00
|
|
|
virtual ~TinyRendererVisualShapeConverter();
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2018-10-09 04:27:08 +00:00
|
|
|
virtual void convertVisualShapes(int linkIndex, const char* pathPrefix, const btTransform& localInertiaFrame, const UrdfLink* linkPtr, const UrdfModel* model, int collisionObjectUniqueId, int bodyUniqueId, struct CommonFileIOInterface* fileIO);
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2016-10-19 05:05:28 +00:00
|
|
|
virtual int getNumVisualShapes(int bodyUniqueId);
|
|
|
|
|
|
|
|
virtual int getVisualShapesData(int bodyUniqueId, int shapeIndex, struct b3VisualShapeData* shapeData);
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2018-01-21 19:15:35 +00:00
|
|
|
virtual void changeRGBAColor(int bodyUniqueId, int linkIndex, int shapeIndex, const double rgbaColor[4]);
|
|
|
|
|
|
|
|
virtual void changeShapeTexture(int objectUniqueId, int linkIndex, int shapeIndex, int textureUniqueId);
|
2017-05-13 03:24:10 +00:00
|
|
|
|
2018-01-17 01:58:19 +00:00
|
|
|
virtual void removeVisualShape(int shapeUid);
|
2017-05-13 03:24:10 +00:00
|
|
|
|
2018-01-17 01:58:19 +00:00
|
|
|
virtual void setUpAxis(int axis);
|
2018-09-23 21:17:31 +00:00
|
|
|
|
|
|
|
virtual void resetCamera(float camDist, float yaw, float pitch, float camPosX, float camPosY, float camPosZ);
|
|
|
|
|
2018-01-17 20:48:48 +00:00
|
|
|
virtual void clearBuffers(struct TGAColor& clearColor);
|
2018-01-17 01:58:19 +00:00
|
|
|
|
|
|
|
virtual void resetAll();
|
|
|
|
|
2018-01-17 20:48:48 +00:00
|
|
|
virtual void getWidthAndHeight(int& width, int& height);
|
2018-01-17 01:58:19 +00:00
|
|
|
virtual void setWidthAndHeight(int width, int height);
|
|
|
|
virtual void setLightDirection(float x, float y, float z);
|
2018-01-17 20:48:48 +00:00
|
|
|
virtual void setLightColor(float x, float y, float z);
|
|
|
|
virtual void setLightDistance(float dist);
|
|
|
|
virtual void setLightAmbientCoeff(float ambientCoeff);
|
|
|
|
virtual void setLightDiffuseCoeff(float diffuseCoeff);
|
|
|
|
virtual void setLightSpecularCoeff(float specularCoeff);
|
|
|
|
virtual void setShadow(bool hasShadow);
|
2018-01-17 01:58:19 +00:00
|
|
|
virtual void setFlags(int flags);
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual void copyCameraImageData(unsigned char* pixelsRGBA, int rgbaBufferSizeInPixels, float* depthBuffer, int depthBufferSizeInPixels, int* segmentationMaskBuffer, int segmentationMaskSizeInPixels, int startPixelIndex, int* widthPtr, int* heightPtr, int* numPixelsCopied);
|
|
|
|
|
2018-01-17 01:58:19 +00:00
|
|
|
virtual void render();
|
|
|
|
virtual void render(const float viewMat[16], const float projMat[16]);
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2018-01-17 20:48:48 +00:00
|
|
|
virtual int loadTextureFile(const char* filename);
|
|
|
|
virtual int registerTexture(unsigned char* texels, int width, int height);
|
2018-01-17 01:58:19 +00:00
|
|
|
|
|
|
|
virtual void syncTransform(int shapeUid, const class btTransform& worldTransform, const class btVector3& localScaling);
|
2016-06-01 05:55:13 +00:00
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
#endif //TINY_RENDERER_VISUAL_SHAPE_CONVERTER_H
|