Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
This commit is contained in:
@@ -17,6 +17,14 @@ enum
|
||||
B3_USE_SHADOWMAP_RENDERMODE,
|
||||
};
|
||||
|
||||
struct CommonGfxVertex3D
|
||||
{
|
||||
float x,y,z,w;
|
||||
float nx,ny,nz;
|
||||
float u,v;
|
||||
};
|
||||
|
||||
|
||||
struct CommonRenderInterface
|
||||
{
|
||||
virtual ~CommonRenderInterface() {}
|
||||
@@ -46,13 +54,17 @@ struct CommonRenderInterface
|
||||
virtual void drawLine(const double from[4], const double to[4], const double color[4], double lineWidth) = 0;
|
||||
virtual void drawPoint(const float* position, const float color[4], float pointDrawSize)=0;
|
||||
virtual void drawPoint(const double* position, const double color[4], double pointDrawSize)=0;
|
||||
virtual void drawTexturedTriangleMesh(float worldPosition[3], float worldOrientation[4], const float* vertices, int numvertices, const unsigned int* indices, int numIndices, float color[4], int textureIndex=-1)=0;
|
||||
|
||||
virtual int registerShape(const float* vertices, int numvertices, const int* indices, int numIndices,int primitiveType=B3_GL_TRIANGLES, int textureIndex=-1)=0;
|
||||
virtual void updateShape(int shapeIndex, const float* vertices)=0;
|
||||
|
||||
virtual int registerTexture(const unsigned char* texels, int width, int height)=0;
|
||||
virtual void updateTexture(int textureIndex, const unsigned char* texels)=0;
|
||||
virtual int registerTexture(const unsigned char* texels, int width, int height, bool flipPixelsY=true)=0;
|
||||
virtual void updateTexture(int textureIndex, const unsigned char* texels, bool flipPixelsY=true)=0;
|
||||
virtual void activateTexture(int textureIndex)=0;
|
||||
|
||||
|
||||
virtual bool readSingleInstanceTransformToCPU(float* position, float* orientation, int srcIndex)=0;
|
||||
|
||||
virtual void writeSingleInstanceTransformToCPU(const float* position, const float* orientation, int srcIndex)=0;
|
||||
virtual void writeSingleInstanceTransformToCPU(const double* position, const double* orientation, int srcIndex)=0;
|
||||
virtual void writeSingleInstanceColorToCPU(const float* color, int srcIndex)=0;
|
||||
|
||||
Reference in New Issue
Block a user