Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#else
|
||||
#include <Python.h>
|
||||
#endif
|
||||
#endif //EGL_ADD_PYTHON_INIT
|
||||
#endif //EGL_ADD_PYTHON_INIT
|
||||
|
||||
//eglRenderer plugin
|
||||
|
||||
@@ -18,11 +18,8 @@
|
||||
#include "../b3PluginContext.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
struct EGLRendererPluginClass
|
||||
{
|
||||
|
||||
EGLRendererVisualShapeConverter m_renderer;
|
||||
EGLRendererPluginClass()
|
||||
{
|
||||
@@ -39,16 +36,14 @@ B3_SHARED_API int initPlugin_eglRendererPlugin(struct b3PluginContext* context)
|
||||
return SHARED_MEMORY_MAGIC_NUMBER;
|
||||
}
|
||||
|
||||
|
||||
B3_SHARED_API int executePluginCommand_eglRendererPlugin(struct b3PluginContext* context, const struct b3PluginArguments* arguments)
|
||||
{
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
B3_SHARED_API void exitPlugin_eglRendererPlugin(struct b3PluginContext* context)
|
||||
{
|
||||
EGLRendererPluginClass* obj = (EGLRendererPluginClass*) context->m_userPointer;
|
||||
EGLRendererPluginClass* obj = (EGLRendererPluginClass*)context->m_userPointer;
|
||||
delete obj;
|
||||
context->m_userPointer = 0;
|
||||
}
|
||||
@@ -56,34 +51,29 @@ B3_SHARED_API void exitPlugin_eglRendererPlugin(struct b3PluginContext* context)
|
||||
//all the APIs below are optional
|
||||
B3_SHARED_API struct UrdfRenderingInterface* getRenderInterface_eglRendererPlugin(struct b3PluginContext* context)
|
||||
{
|
||||
EGLRendererPluginClass* obj = (EGLRendererPluginClass*) context->m_userPointer;
|
||||
EGLRendererPluginClass* obj = (EGLRendererPluginClass*)context->m_userPointer;
|
||||
return &obj->m_renderer;
|
||||
}
|
||||
|
||||
|
||||
#ifdef EGL_ADD_PYTHON_INIT
|
||||
|
||||
static PyMethodDef eglMethods[] = {
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
static struct PyModuleDef moduledef = {
|
||||
PyModuleDef_HEAD_INIT, "eglRenderer", /* m_name */
|
||||
"eglRenderer for PyBullet "
|
||||
, /* m_doc */
|
||||
-1, /* m_size */
|
||||
eglMethods, /* m_methods */
|
||||
NULL, /* m_reload */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
PyModuleDef_HEAD_INIT, "eglRenderer", /* m_name */
|
||||
"eglRenderer for PyBullet ", /* m_doc */
|
||||
-1, /* m_size */
|
||||
eglMethods, /* m_methods */
|
||||
NULL, /* m_reload */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
PyMODINIT_FUNC
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
PyInit_eglRenderer(void)
|
||||
@@ -91,20 +81,17 @@ PyInit_eglRenderer(void)
|
||||
initeglRenderer(void)
|
||||
#endif
|
||||
{
|
||||
|
||||
PyObject* m;
|
||||
PyObject* m;
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
m = PyModule_Create(&moduledef);
|
||||
m = PyModule_Create(&moduledef);
|
||||
#else
|
||||
m = Py_InitModule3("eglRenderer", eglMethods, "eglRenderer for PyBullet");
|
||||
m = Py_InitModule3("eglRenderer", eglMethods, "eglRenderer for PyBullet");
|
||||
#endif
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
if (m == NULL) return m;
|
||||
if (m == NULL) return m;
|
||||
#else
|
||||
if (m == NULL) return;
|
||||
if (m == NULL) return;
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
#endif //EGL_ADD_PYTHON_INIT
|
||||
#endif //EGL_ADD_PYTHON_INIT
|
||||
|
||||
@@ -4,22 +4,20 @@
|
||||
#include "../b3PluginAPI.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//initPlugin, exitPlugin and executePluginCommand are required, otherwise plugin won't load
|
||||
B3_SHARED_API int initPlugin_eglRendererPlugin(struct b3PluginContext* context);
|
||||
B3_SHARED_API void exitPlugin_eglRendererPlugin(struct b3PluginContext* context);
|
||||
B3_SHARED_API int executePluginCommand_eglRendererPlugin(struct b3PluginContext* context, const struct b3PluginArguments* arguments);
|
||||
|
||||
//all the APIs below are optional
|
||||
B3_SHARED_API struct UrdfRenderingInterface* getRenderInterface_eglRendererPlugin(struct b3PluginContext* context);
|
||||
|
||||
//initPlugin, exitPlugin and executePluginCommand are required, otherwise plugin won't load
|
||||
B3_SHARED_API int initPlugin_eglRendererPlugin(struct b3PluginContext* context);
|
||||
B3_SHARED_API void exitPlugin_eglRendererPlugin(struct b3PluginContext* context);
|
||||
B3_SHARED_API int executePluginCommand_eglRendererPlugin(struct b3PluginContext* context, const struct b3PluginArguments* arguments);
|
||||
|
||||
//all the APIs below are optional
|
||||
B3_SHARED_API struct UrdfRenderingInterface* getRenderInterface_eglRendererPlugin(struct b3PluginContext* context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif//#define EGL_RENDERER_PLUGIN_H
|
||||
#endif //#define EGL_RENDERER_PLUGIN_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,19 +5,18 @@
|
||||
|
||||
struct EGLRendererVisualShapeConverter : public UrdfRenderingInterface
|
||||
{
|
||||
|
||||
struct EGLRendererVisualShapeConverterInternalData* m_data;
|
||||
|
||||
|
||||
EGLRendererVisualShapeConverter();
|
||||
|
||||
|
||||
virtual ~EGLRendererVisualShapeConverter();
|
||||
|
||||
|
||||
virtual void convertVisualShapes(int linkIndex, const char* pathPrefix, const btTransform& localInertiaFrame, const UrdfLink* linkPtr, const UrdfModel* model, int shapeUid, int objectIndex);
|
||||
|
||||
|
||||
virtual int getNumVisualShapes(int bodyUniqueId);
|
||||
|
||||
virtual int getVisualShapesData(int bodyUniqueId, int shapeIndex, struct b3VisualShapeData* shapeData);
|
||||
|
||||
|
||||
virtual void changeRGBAColor(int bodyUniqueId, int linkIndex, int shapeIndex, const double rgbaColor[4]);
|
||||
|
||||
virtual void changeShapeTexture(int objectUniqueId, int linkIndex, int shapeIndex, int textureUniqueId);
|
||||
@@ -25,9 +24,9 @@ struct EGLRendererVisualShapeConverter : public UrdfRenderingInterface
|
||||
virtual void removeVisualShape(int shapeUid);
|
||||
|
||||
virtual void setUpAxis(int axis);
|
||||
|
||||
virtual void resetCamera(float camDist, float yaw, float pitch, float camPosX,float camPosY, float camPosZ);
|
||||
|
||||
|
||||
virtual void resetCamera(float camDist, float yaw, float pitch, float camPosX, float camPosY, float camPosZ);
|
||||
|
||||
virtual void clearBuffers(struct TGAColor& clearColor);
|
||||
|
||||
virtual void resetAll();
|
||||
@@ -43,22 +42,16 @@ struct EGLRendererVisualShapeConverter : public UrdfRenderingInterface
|
||||
virtual void setShadow(bool hasShadow);
|
||||
virtual void setFlags(int flags);
|
||||
|
||||
virtual void copyCameraImageData(unsigned char* pixelsRGBA, int rgbaBufferSizeInPixels, float* depthBuffer, int depthBufferSizeInPixels,int* segmentationMaskBuffer, int segmentationMaskSizeInPixels, int startPixelIndex, int* widthPtr, int* heightPtr, int* numPixelsCopied);
|
||||
void copyCameraImageDataGL(unsigned char* pixelsRGBA, int rgbaBufferSizeInPixels, float* depthBuffer, int depthBufferSizeInPixels,int* segmentationMaskBuffer, int segmentationMaskSizeInPixels, int startPixelIndex, int* widthPtr, int* heightPtr, int* numPixelsCopied);
|
||||
virtual void copyCameraImageData(unsigned char* pixelsRGBA, int rgbaBufferSizeInPixels, float* depthBuffer, int depthBufferSizeInPixels, int* segmentationMaskBuffer, int segmentationMaskSizeInPixels, int startPixelIndex, int* widthPtr, int* heightPtr, int* numPixelsCopied);
|
||||
void copyCameraImageDataGL(unsigned char* pixelsRGBA, int rgbaBufferSizeInPixels, float* depthBuffer, int depthBufferSizeInPixels, int* segmentationMaskBuffer, int segmentationMaskSizeInPixels, int startPixelIndex, int* widthPtr, int* heightPtr, int* numPixelsCopied);
|
||||
|
||||
virtual void render();
|
||||
virtual void render(const float viewMat[16], const float projMat[16]);
|
||||
|
||||
|
||||
virtual int loadTextureFile(const char* filename);
|
||||
virtual int registerTexture(unsigned char* texels, int width, int height);
|
||||
|
||||
|
||||
|
||||
virtual void syncTransform(int shapeUid, const class btTransform& worldTransform, const class btVector3& localScaling);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //EGL_RENDERER_VISUAL_SHAPE_CONVERTER_H
|
||||
#endif //EGL_RENDERER_VISUAL_SHAPE_CONVERTER_H
|
||||
|
||||
Reference in New Issue
Block a user