Add defaults to SDF plugin attributes.
Expose diameter and number of teeth for the gear SDF. PiperOrigin-RevId: 577779297 Change-Id: Iec5890ab7f39080b395cf06a76f9c2216f4f39ed
This commit is contained in:
committed by
Copybara-Service
parent
c921c3956e
commit
50843cad30
+7
-1
@@ -28,6 +28,12 @@ namespace mujoco::plugin::sdf {
|
||||
// this plugin implements a modification of the signed distance function
|
||||
// from https://www.shadertoy.com/view/XtffzX of hexagonal nut
|
||||
|
||||
struct NutAttribute {
|
||||
static constexpr int nattribute = 1;
|
||||
static constexpr char const* names[nattribute] = {"radius"};
|
||||
static constexpr mjtNum defaults[nattribute] = {0.26};
|
||||
};
|
||||
|
||||
class Nut {
|
||||
public:
|
||||
// Creates a new Nut instance (allocated with `new`) or
|
||||
@@ -45,7 +51,7 @@ class Nut {
|
||||
|
||||
static void RegisterPlugin();
|
||||
|
||||
mjtNum radius;
|
||||
mjtNum attribute[NutAttribute::nattribute];
|
||||
|
||||
private:
|
||||
Nut(const mjModel* m, mjData* d, int instance);
|
||||
|
||||
Reference in New Issue
Block a user