A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Slick » Sun Nov 04, 2018 5:04 am
I'm still trying to get this to work. For example is it adequate to create on triangle for testing? Here is some basic code but I am not getting a collision item from it:
- Code: Select all
dNewtonMesh buildMesh(mWorld->GetNewton());
// start build a mesh
buildMesh.BeginBuild();
buildMesh.BeginPolygon();
buildMesh.AddPoint(-300, 0, -300);
buildMesh.AddPoint(300, 0, -300);
buildMesh.AddPoint(-300, 0, 300);
buildMesh.EndPolygon();
buildMesh.EndBuild();
// get the newtonMesh from the dNewtonMesh class and use it to build a render mesh, collision or anything
NewtonMesh* const newtonMesh = buildMesh.GetMesh();
// now we can use this mesh for lot of stuff, we can apply UV, we can decompose into convex,
NewtonCollision* const collision = NewtonCreateConvexHullFromMesh(mWorld->GetNewton(), newtonMesh, 0.001f, 0);
NewtonCollision* const collision is returned a a nullptr.
-
Slick
-
- Posts: 330
- Joined: Sat Feb 07, 2004 7:24 pm
- Location: LA last and France now
by Sweenie » Sun Nov 04, 2018 5:54 am
A triangle should be enough for the tree collider but not for a convex collider. A convex collider requires a volume which a single triangle doesn't have.
-
Sweenie
-
- Posts: 498
- Joined: Mon Jan 24, 2005 7:59 am
- Location: Sweden
by Slick » Sun Nov 04, 2018 6:16 am
Yep made a bit of progress since I posted. I added a second triangle and I got a collision. I think part of the problem is I'm trying to use the dNewton interface and the example in the usingmeshtool is a mixture of C and dNewton. I need to be able to construct a dNewtonCollision.
In theory I should be able to exclusively use the dNewton interface.
More research.
-
Slick
-
- Posts: 330
- Joined: Sat Feb 07, 2004 7:24 pm
- Location: LA last and France now
by Slick » Sun Nov 04, 2018 7:34 am
When I am adding points I am used to x = left/right; y=up; z=forward/back. Is that the coordinate system Newton uses? If it isn't maybe I could be providing bad point data but maybe it should work anyway but just be rotated.
-
Slick
-
- Posts: 330
- Joined: Sat Feb 07, 2004 7:24 pm
- Location: LA last and France now
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 14 guests