Page 1 of 1

Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 3:36 am
by nicos1993
Hi all,

I am using the following:

Vec3 normal = Vec3(0,1,0);
double offset = 0;

Plane GroundPlane = Plane(normal, offset);

It compiles and runs but I would like to see the calculations performed, please could someone point me to the source code of the Plane calculation?

Thanks,

Nicos

Re: Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 6:44 am
by tkuchida
Here's how I found it:
1. Go to the Simbody doxygen documentation here: https://simtk.org/api_docs/simbody/3.5/
2. Search for "plane" in the "Search" box at the top and select the first result.
3. Go to the bottom of the "SimTK::Plane Class Reference" page and click the link to the ContactGeometry.h file (below "The documentation for this class was generated from the following file:").
4. Find "plane(" on this page.

Re: Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 8:36 am
by nicos1993
Hello Thomas,

That worked a treat - thanks!

I am looking at the following line which is meant to a return a Real variable:
return ~m_normal*pt - m_offset;

What purpose does the tilde (~) operator serve in this instance? I haven't come across this syntax before in a similar example and I can't seem to find an answer online.

Kind regards,

Nicos Haralabidis

Re: Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 8:44 am
by aymanh
Hello,

~ is the operator for transpose.

-Ayman

Re: Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 8:49 am
by tkuchida
Ayman is correct (of course). You may wish to refer to the Simbody User's Guide here: https://github.com/simbody/simbody/tree ... imbody/doc (SimbodyAndMolmodelUserGuide.pdf, Section 5.3.1: Operators).

Re: Simbody Plane Class - How can I see the source code calculations?

Posted: Fri Oct 26, 2018 12:39 pm
by nicos1993
Thanks for your help Ayman and Thomas! It makes sense now! (dot product)