PyBullet: move TinyRenderer into a plugin, default statically loaded. You can also dynamically load a render plugin, as shown in renderPlugin.py example. premake has a way to compile the tinyRendererPlugin.
This commit is contained in:
@@ -184,7 +184,7 @@ struct MyMJCFDefaults
|
||||
struct BulletMJCFImporterInternalData
|
||||
{
|
||||
GUIHelperInterface* m_guiHelper;
|
||||
struct LinkVisualShapesConverter* m_customVisualShapesConverter;
|
||||
struct UrdfRenderingInterface* m_customVisualShapesConverter;
|
||||
char m_pathPrefix[1024];
|
||||
|
||||
std::string m_sourceFileName; // with path
|
||||
@@ -1419,7 +1419,7 @@ struct BulletMJCFImporterInternalData
|
||||
|
||||
};
|
||||
|
||||
BulletMJCFImporter::BulletMJCFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, int flags)
|
||||
BulletMJCFImporter::BulletMJCFImporter(struct GUIHelperInterface* helper, UrdfRenderingInterface* customConverter, int flags)
|
||||
{
|
||||
m_data = new BulletMJCFImporterInternalData();
|
||||
m_data->m_guiHelper = helper;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define BULLET_MJCF_IMPORTER_H
|
||||
|
||||
#include "../ImportURDFDemo/URDFImporterInterface.h"
|
||||
#include "../ImportURDFDemo/LinkVisualShapesConverter.h"
|
||||
#include "../ImportURDFDemo/UrdfRenderingInterface.h"
|
||||
|
||||
|
||||
struct MJCFErrorLogger
|
||||
@@ -27,7 +27,7 @@ class BulletMJCFImporter : public URDFImporterInterface
|
||||
void convertURDFToVisualShapeInternal(const struct UrdfVisual* visual, const char* urdfPathPrefix, const btTransform& visualTransform, btAlignedObjectArray<struct GLInstanceVertex>& verticesOut, btAlignedObjectArray<int>& indicesOut, btAlignedObjectArray<MJCFURDFTexture>& texturesOut) const;
|
||||
|
||||
public:
|
||||
BulletMJCFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, int flags);
|
||||
BulletMJCFImporter(struct GUIHelperInterface* helper, UrdfRenderingInterface* customConverter, int flags);
|
||||
virtual ~BulletMJCFImporter();
|
||||
|
||||
virtual bool parseMJCFString(const char* xmlString, MJCFErrorLogger* logger);
|
||||
|
||||
@@ -51,7 +51,7 @@ ATTRIBUTE_ALIGNED16(struct) BulletURDFInternalData
|
||||
mutable btAlignedObjectArray<btTriangleMesh*> m_allocatedMeshInterfaces;
|
||||
btHashMap<btHashPtr, UrdfCollision> m_bulletCollisionShape2UrdfCollision;
|
||||
|
||||
LinkVisualShapesConverter* m_customVisualShapesConverter;
|
||||
UrdfRenderingInterface* m_customVisualShapesConverter;
|
||||
bool m_enableTinyRenderer;
|
||||
int m_flags;
|
||||
|
||||
@@ -82,7 +82,7 @@ void BulletURDFImporter::printTree()
|
||||
// btAssert(0);
|
||||
}
|
||||
|
||||
BulletURDFImporter::BulletURDFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, double globalScaling, int flags)
|
||||
BulletURDFImporter::BulletURDFImporter(struct GUIHelperInterface* helper, UrdfRenderingInterface* customConverter, double globalScaling, int flags)
|
||||
{
|
||||
m_data = new BulletURDFInternalData;
|
||||
m_data->setGlobalScaling(globalScaling);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "URDFImporterInterface.h"
|
||||
|
||||
#include "LinkVisualShapesConverter.h"
|
||||
#include "UrdfRenderingInterface.h"
|
||||
|
||||
struct BulletURDFTexture
|
||||
{
|
||||
@@ -23,7 +23,7 @@ class BulletURDFImporter : public URDFImporterInterface
|
||||
|
||||
public:
|
||||
|
||||
BulletURDFImporter(struct GUIHelperInterface* helper, LinkVisualShapesConverter* customConverter, double globalScaling=1, int flags=0);
|
||||
BulletURDFImporter(struct GUIHelperInterface* helper, UrdfRenderingInterface* customConverter, double globalScaling=1, int flags=0);
|
||||
|
||||
virtual ~BulletURDFImporter();
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
///See audio_source element in http://sdformat.org/spec?ver=1.6&elem=link
|
||||
struct SDFAudioSource
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef URDF_JOINT_TYPES_H
|
||||
#define URDF_JOINT_TYPES_H
|
||||
|
||||
#include "LinearMath/btScalar.h"
|
||||
|
||||
enum UrdfJointTypes
|
||||
{
|
||||
@@ -11,7 +12,6 @@ enum UrdfJointTypes
|
||||
URDFPlanarJoint,
|
||||
URDFFixedJoint,
|
||||
};
|
||||
#include "LinearMath/btScalar.h"
|
||||
|
||||
enum URDF_LinkContactFlags
|
||||
{
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "LinearMath/btHashMap.h"
|
||||
#include "URDFJointTypes.h"
|
||||
#include "SDFAudioTypes.h"
|
||||
#include <string>
|
||||
|
||||
#define btArray btAlignedObjectArray
|
||||
#include <string>
|
||||
|
||||
struct ErrorLogger
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef LINK_VISUAL_SHAPES_CONVERTER_H
|
||||
#define LINK_VISUAL_SHAPES_CONVERTER_H
|
||||
#ifndef URDF_RENDERING_INTERFACE_H
|
||||
#define URDF_RENDERING_INTERFACE_H
|
||||
|
||||
struct UrdfLink;
|
||||
struct UrdfModel;
|
||||
class btTransform;
|
||||
class btCollisionObject;
|
||||
|
||||
struct LinkVisualShapesConverter
|
||||
|
||||
struct UrdfRenderingInterface
|
||||
{
|
||||
virtual void convertVisualShapes(int linkIndex, const char* pathPrefix, const btTransform& localInertiaFrame, const UrdfLink* linkPtr, const UrdfModel* model, int shapeUid, int objectIndex) =0;
|
||||
|
||||
Reference in New Issue
Block a user