A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by JoshKlint » Sat May 28, 2022 6:40 am
I have built the library with cmake and visual studio. I am including the library and ndNewton.h. Is there still a C API?
-
JoshKlint
-
- Posts: 163
- Joined: Sun Dec 10, 2017 8:03 pm
-
by Julio Jerez » Sat May 28, 2022 6:50 am
No c api.
-
Julio Jerez
- Moderator
![Moderator Moderator](./images/ranks/newtonstrip.png)
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by JoshKlint » Sat May 28, 2022 7:04 am
Okay
![Laughing :lol:](./images/smilies/icon_lol.gif)
-
JoshKlint
-
- Posts: 163
- Joined: Sun Dec 10, 2017 8:03 pm
-
by JoeJ » Sun Jul 24, 2022 2:23 am
I expected some issues from not having the C API, and what i'm currently stuck at is maybe a good example.
I have a small sim running, and now i want to visualize the bodies shapes.
Previously i did this using my own functions like DrawBox or DrawSphere. But they don't cover all shapes Newton has, they lack chamfered variants, etc.
So i'd rather reuse Newtons visualization functionality, which isn't expected to be easy because it probably depends on a lot of demo / sandbox functionality, which i do not want to include. However - this was my experience so far:
Looking at ndDemoEntityManager::DrawDebugShapes(), but from there i can not find the code which actually generates triangles for such primitives.
I try to find code by IDE features like right clicking on some class name, then 'go to definition / declaration'.
But this always brings me to some base class which has almost no functionality, and idk how to get to the derived classes which have the functionality, but remain unknown to me.
Because Newton uses inheritance so heavily, but personally i use it very rarely, my usual practices to navigate code completely fail.
Any advice on code navigation practices is welcome. I feel like i'm missing some basic things i've just never learned or missed.
After failing on this i just remembered there was functionality to iterate faces of collision shapes.
Probably this does not work for primitive shapes like spheres, but regardless - i realize it is now hard to find such functionality, even i know it must be there.
This was no problem with the C API, because i only had to scroll this single file to find all functionality there is.
But what should i do now? Where should i start my search, and how can i avoid the same issue of getting stuck at generalized base classes again?
-
![User avatar](./download/file.php?avatar=6434_1383212788.png)
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
by Dave Gravel » Sun Jul 24, 2022 3:34 pm
I think you only need to implement a ndShapeDebugNotify class.
The debugNotify give you a DrawPolygon function.
You can process the debug shape triangles in this function, In the same way used with old newton version.
-
![User avatar](./download/file.php?avatar=1198_1653803501.png)
Dave Gravel
-
- Posts: 800
- Joined: Sat Apr 01, 2006 9:31 pm
- Location: Quebec in Canada.
-
by JoeJ » Mon Jul 25, 2022 3:42 am
Now, that was easy
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Thanks!
-
![User avatar](./download/file.php?avatar=6434_1383212788.png)
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 42 guests