add first draft of contact point query in shared memory API
b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient); void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA); void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB); void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData); Implemented for PhysicsClientSharedMemory, not for PhysicsDirect yet. Add btCollisionObject::setUserIndex2
This commit is contained in:
@@ -29,8 +29,11 @@ enum EnumSharedMemoryClientCommand
|
||||
CMD_APPLY_EXTERNAL_FORCE,
|
||||
CMD_CALCULATE_INVERSE_DYNAMICS,
|
||||
CMD_CALCULATE_INVERSE_KINEMATICS,
|
||||
CMD_CREATE_JOINT,
|
||||
CMD_REQUEST_CONTACT_POINT_INFORMATION,
|
||||
//don't go beyond this command!
|
||||
CMD_MAX_CLIENT_COMMANDS,
|
||||
CMD_CREATE_JOINT
|
||||
|
||||
};
|
||||
|
||||
enum EnumSharedMemoryServerStatus
|
||||
@@ -64,6 +67,8 @@ enum EnumSharedMemoryServerStatus
|
||||
CMD_INVALID_STATUS,
|
||||
CMD_CALCULATED_INVERSE_DYNAMICS_COMPLETED,
|
||||
CMD_CALCULATED_INVERSE_DYNAMICS_FAILED,
|
||||
CMD_CONTACT_POINT_INFORMATION_COMPLETED,
|
||||
CMD_CONTACT_POINT_INFORMATION_FAILED,
|
||||
CMD_MAX_SERVER_COMMANDS
|
||||
};
|
||||
|
||||
@@ -131,6 +136,37 @@ struct b3CameraImageData
|
||||
const int* m_segmentationMaskValues;//m_pixelWidth*m_pixelHeight ints
|
||||
};
|
||||
|
||||
|
||||
struct b3ContactPointData
|
||||
{
|
||||
int m_contactFlags;//flag wether certain fields below are valid
|
||||
int m_bodyUniqueIdA;
|
||||
int m_bodyUniqueIdB;
|
||||
int m_linkIndexA;
|
||||
int m_linkIndexB;
|
||||
double m_positionOnAInWS[3];//contact point location on object A, in world space coordinates
|
||||
double m_positionOnBInWS[3];//contact point location on object A, in world space coordinates
|
||||
double m_contactNormalOnBInWS[3];//the separating contact normal, pointing from object B towards object A
|
||||
double m_contactDistance;//negative number is penetration, positive is distance.
|
||||
int m_contactPointDynamicsIndex;
|
||||
};
|
||||
|
||||
struct b3ContactPointDynamicsData
|
||||
{
|
||||
double m_normalForce;
|
||||
double m_linearFrictionDirection[3];
|
||||
double m_linearFrictionForce;
|
||||
double m_angularFrictionDirection[3];
|
||||
double m_angularFrictionForce;
|
||||
};
|
||||
|
||||
struct b3ContactInformation
|
||||
{
|
||||
int m_numContactPoints;
|
||||
struct b3ContactPointData* m_contactPointData;
|
||||
struct b3ContactPointDynamicsData* m_contactDynamicsData;
|
||||
};
|
||||
|
||||
///b3LinkState provides extra information such as the Cartesian world coordinates
|
||||
///center of mass (COM) of the link, relative to the world reference frame.
|
||||
///Orientation is a quaternion x,y,z,w
|
||||
|
||||
Reference in New Issue
Block a user