NewtonCollisionSetCollisionMode behavior change

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Mon Jul 21, 2014 12:42 pm

Ok Bird, I added the skeleton of the smart object placement demo.
the demo is named: ..\applications\demosSandbox\sdkDemos\demos\KinematicBodies.cpp
if you sync and play it, right click drag the phantom one the scene, is doe no do anything yet, I just want to see if this is more or less what you
want to have.

If this is what you envision, tonight I will enable that code the you show me, which is commented out and hopefully it will expose the bug.
Then after we result this problem we will add the placemen with rotation, and we can use that demo as bench test for functionality you want.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Tue Jul 22, 2014 8:49 am

Ok bird I now have a fully working demo that does object placement.

if you sync to gitHub and build the demos, it is the default demo.

right click drag the phantom around,
left click while right click is down place a box at the cursor location.

there are firs difference with the for demo, the main one is that when the placement I cast move the phantom cursor immediately to the top of the newly pace box
so I do no see the effect you show, I guess that you place the new box in the object to filter so that is no collected.
second I did no set the phantom to no collidable, that also may be what is different.

Please test this out so that we can calibrate to behave exactly the way you want, and we can fix the bug.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Bird » Tue Jul 22, 2014 4:13 pm

Hi Julio,

Sorry for the delay. I'm traveling and don't have access to my windows machine. I do have a Mac laptop but I can't compile the latest version from Github because of these linker errors in Xcode.

Undefined symbols for architecture x86_64:
"dSymmetricBiconjugateGradientSolve::dSymmetricBiconjugateGradientSolve()", referenced from:
CustomVehicleController::dWeightDistibutionSolver::dWeightDistibutionSolver() in libdCustomJoints.a(CustomVehicleControllerManager.o)
"dSymmetricBiconjugateGradientSolve::~dSymmetricBiconjugateGradientSolve()", referenced from:
CustomVehicleController::dWeightDistibutionSolver::~dWeightDistibutionSolver() in libdCustomJoints.a(CustomVehicleControllerManager.o)
CustomVehicleController::dWeightDistibutionSolver::dWeightDistibutionSolver() in libdCustomJoints.a(CustomVehicleControllerManager.o)
"dSymmetricBiconjugateGradientSolve::Solve(int, double, double*, double const*) const", referenced from:
CustomVehicleController::Finalize() in libdCustomJoints.a(CustomVehicleControllerManager.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Tue Jul 22, 2014 4:44 pm

I have not modified the Mac project yet.
I think It can wait until you can back, it gives me time to add the part that does the orientation.
The code that I added to the linear algebra class is for that.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Fri Jul 25, 2014 1:54 am

Ok Bird now I have a more finish demo, that shows the phantom with better transparency.
It is still a PC project, so maybe you can't test now.
But you have time please tell me if this is what you are looing for.

It has one difference with you demo, and that is that when I place an instance, the phantom immediately cast on top of the instance.
This is what I would expect of an object place functionality, but you video show just the opposite.
in your video bot the phantom and the instance state in the same place and the instance move to the side.
Maybe you have some slightly different set up that expose the bug, I could not see the Bug in this demo
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby manny » Fri Jul 25, 2014 5:22 am

Julio Jerez wrote:I have not modified the Mac project yet.

Julio, I have commited fixes for all OSX projects that makes them build on both 32bit and 64bit also contains fixes for wxWidgets so it runs on OSX 10.10 yosemite.
I have also updated the sandbox project. Projects file have also been cleaned and some other house keeping done on the projects.

Bird wrote:Hi Julio,

Sorry for the delay. I'm traveling and don't have access to my windows machine. I do have a Mac laptop but I can't compile the latest version from Github because of these linker errors in Xcode.

-Bird

sync to the latest git revision and you can build the sandbox on both 64bit and 32bit.

I would also recommend to not include the 3rd party library projects in the build process, rather ship precompiled librarys that are linked into the project. The current setup is a real heavy weight.
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Fri Jul 25, 2014 9:04 am

the third party are only needed for building the demos. The reason I put the code is that some libraries are hard to set up for anyone try to test the engine and build the demos.
the Newton engine only rely on pThread with is no available for windows, and the last released of pthread has some memory leak bug that I fixed

The project that build the libraries do not link any third party library
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Bird » Fri Jul 25, 2014 6:25 pm

It is still a PC project, so maybe you can't test now.
But you have time please tell me if this is what you are looing for.

I'm still on the Mac until Monday ... but I can compile the Mac demos now ( thanks Manny!). But the demo doesn't seem to work because "m_placeInstance.UpdateTriggerJoystick (mainWindow, mainWindow->GetMouseKeyState(0)))" never returns true with the LMB down, even when testForCollision() returns false.
BTW, the Mac demos are running very slowly here. This demo in Release mode runs at 14 fps and the Rag Doll demo runs at 7 fps on a older Mac Book Pro

t has one difference with you demo, and that is that when I place an instance, the phantom immediately cast on top of the instance.
This is what I would expect of an object place functionality, but you video show just the opposite.

In my project, when a new instance is created I set a "Unseen By Rays" flag for it so that it is filtered out in RayPrefilterCallback. So the phantom gets placed on the ground without hitting the new instance. This is where the bug is exposed I think. The new instance shouldn't move when the phantom is placed in it's AABB but it does.

One thing I noticed that's different in your demo is that I don't use NewtonCreateKinematicBody for my phantom, I just set NewtonCollisionSetCollisionMode to 0. Could that make a difference?

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Fri Jul 25, 2014 8:43 pm

Bird wrote:One thing I noticed that's different in your demo is that I don't use NewtonCreateKinematicBody for my phantom, I just set NewtonCollisionSetCollisionMode to 0. Could that make a difference?
-Bird

Bingo that's the difference. NewtonCollisionSetCollisionMode is mainlly to make part of a collision shape non collidable.
you test object has to be a not collidable kinematic body.

There it seems there is not different by there is, a dynamic body is always part of the solver, a kinematic body does no, so if you want a body that generate contact and does no act as a rigib body
that's a kinematic body, a dynamics nody can not generate contacts and be non collidable which is what you nee.

about performance, on Mac, that's warryson, I will test that tomorrow, last time there was no difference between my Mac pro and the PC.
That demo does almost nothing is must be tousand of FPS even in debug, I will check it out.

maybe if you just change your test body to Kinematic it will work.

I will also check if the demo works on the Macs.
on this"
In my project, when a new instance is created I set a "Unseen By Rays" flag for it so that it is filtered out in RayPrefilterCallback

I was also thinking to do that, my idea was to add a Queue that collect spawned bodies as long as the right mouse key is down,
if the mouse Key is released then it clean the queue and then the phantom is now free to cast new objects.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby manny » Sat Jul 26, 2014 5:33 am

Julio Jerez wrote:about performance, on Mac, that's warryson, I will test that tomorrow, last time there was no difference between my Mac pro and the PC.
That demo does almost nothing is must be tousand of FPS even in debug, I will check it out.

maybe if you just change your test body to Kinematic it will work.

it's not newton's performance, it's the GL performance. it has been that way since I first tested newton, if you disable most rendering features performance gets better. If I get the time I can investigate why it's so slow, but I guess you're doing lots of immediate calls.

Julio Jerez wrote:the third party are only needed for building the demos. The reason I put the code is that some libraries are hard to set up for anyone try to test the engine and build the demos.
the Newton engine only rely on pThread with is no available for windows, and the last released of pthread has some memory leak bug that I fixed

The project that build the libraries do not link any third party library

Yes, I understand. That is why I recommend to not include them in the build process but include them only as prebuilt static or dynamic libraries.
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Sat Jul 26, 2014 8:55 am

manny wrote:Yes, I understand. That is why I recommend to not include them in the build process but include them only as prebuilt static or dynamic libraries.


I am confused, if you open
../packages\projects\visualStudio_2010/build.sln

you should see something like this:
projects.png
projects.png (16.67 KiB) Viewed 3736 times


those are the libraries needed to build newton, and they only use tiny xml and pthread.
tiny xml is only used for the scene file format, other wise is no use at all

in the package folder you have
..\packages\projects\visualStudio_2010 (multi configurations)
..\packages\projects\visualStudio_2010_dll (debug and release only)
..\packages\projects\visualStudio_2010_static_md (debug and release only)
..\packages\projects\visualStudio_2010_static_mt (debug and release only)

I now added that last
..\packages\projects\visualStudio_2012 (multi configurations)

so for an user that is not running any of the newton demos, any of the third party libraries with the exception of those two, is part of the build
This is the same for Mac and Linux, and on those tow platform does even use pthread since pthreads is the standards on those plaforms.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Sat Jul 26, 2014 9:30 am

I just update my mac to the lasted OSX and Xcode, and I sync to github but when I try to build the sandbox demos I get this
<Foundation/NSObject.h>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/os/object.h:74:9: 'Foundation/NSObject.h' file not found


how where you able to build it?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Sat Jul 26, 2014 10:43 am

also Bill I added the raycast prefilter and now is think is more of less identical to you implementation.
when I place objects the bodies do are not push outsize the phantom by the phantom.
so I think that is you use a Kinematic body for you phantom instead of a dynamics body you implementation should be fine.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby Julio Jerez » Sat Jul 26, 2014 11:07 am

when I go to find in the max and I look for file <Foundation/NSObject.h>
that file is not in the computer, is there something i need to install?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonCollisionSetCollisionMode behavior change

Postby manny » Sat Jul 26, 2014 11:48 am

so for an user that is not running any of the newton demos, any of the third party libraries with the exception of those two, is part of the build
This is the same for Mac and Linux, and on those tow platform does even use pthread since pthreads is the standards on those plaforms.

Sorry, I was referring only to the sandbox build process!
But still, the regular newton process is kinda fragmented, our local branch merges the following projects into a single output library:
* core
* newton
* physics

IMHO, these should reside in a single project as it's the bare minimum to include newton in an engine/project. We currently do not include/build any other project from the entire newton framework in our engine.

Julio Jerez wrote:when I go to find in the max and I look for file <Foundation/NSObject.h>
that file is not in the computer, is there something i need to install?

What version of OSX and XCode are you running?

Also, I'm at IRC feel free to drop by, makes it easier to talk ;)
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron