MADEAPPS / newton-dynamics

Newton Dynamics is an integrated solution for real time simulation of physics environments.
http://www.newtondynamics.com
Other
945 stars 182 forks source link

Am i doing something horribly wrong? Multiple issues, hardcoded assertions, etc #210

Closed george-tsiros closed 4 years ago

george-tsiros commented 4 years ago

compiled in vs2017 community 15.9.21 (latest as of writing) win10 sdk 10.0.17763.0 toolset vs 2017 (v141)

downloaded source from github, master branch, opened applications\demosSandbox\projects\visualStudio_2015\demosSandbox.sln

i let it retarget it and without touching anything started a new debugging instance for demosSandBox

preferences do not work, but as i see a dAssert(0) in there i suspect they were never meant to work, so i am not interested in that.

"using the newton mesh tool" fails an assertion:

demosSandBox_d.exe!dCustomBallAndSocket::SubmitAngularAxis(const dMatrix & matrix0, const dMatrix & matrix1, float timestep) Line 342
 at sdk\dcustomjoints\dcustomballandsocket.cpp(342)
demosSandBox_d.exe!dCustomBallAndSocket::SubmitConstraints(float timestep, int threadIndex) Line 417
 at sdk\dcustomjoints\dcustomballandsocket.cpp(417)
demosSandBox_d.exe!dCustomJoint::SubmitConstraints(const NewtonJoint * const me, float timestep, int threadIndex) Line 216
 at sdk\dcustomjoints\dcustomjoint.cpp(216)
demosSandBox_d.exe!NewtonUserJoint::JacobianDerivative(dgContraintDescritor & params) Line 109
 at sdk\dgnewton\newtonclass.cpp(109)
demosSandBox_d.exe!dgWorldDynamicUpdate::GetJacobianDerivatives(dgContraintDescritor & constraintParam, dgJointInfo * const jointInfo, dgConstraint * const constraint, dgLeftHandSide * const leftHandSide, dgRightHandSide * const rightHandSide, int rowCount) Line 484
 at sdk\dgphysics\dgworlddynamicupdate.cpp(484)
demosSandBox_d.exe!dgWorldDynamicUpdate::BuildJacobianMatrix(dgBodyCluster * const cluster, int threadID, float timestep) Line 240
 at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(240)
demosSandBox_d.exe!dgWorldDynamicUpdate::ResolveClusterForces(dgBodyCluster * const cluster, int threadID, float timestep) Line 665
 at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(665)
demosSandBox_d.exe!dgWorldDynamicUpdate::CalculateClusterReactionForcesKernel(void * const context, void * const worldContext, int threadID) Line 459
 at sdk\dgphysics\dgworlddynamicupdate.cpp(459)
demosSandBox_d.exe!dgThreadHive::QueueJob(void(*)(void * const, void * const, int) callback, void * const context0, void * const context1, const char * const functionName) Line 322
 at sdk\dgcore\dgthreadhive.cpp(322)
demosSandBox_d.exe!dgWorldDynamicUpdate::UpdateDynamics(float timestep) Line 138
 at sdk\dgphysics\dgworlddynamicupdate.cpp(138)
demosSandBox_d.exe!dgWorld::StepDynamics(float timestep) Line 942
 at sdk\dgphysics\dgworld.cpp(942)
demosSandBox_d.exe!dgWorld::RunStep() Line 1001
 at sdk\dgphysics\dgworld.cpp(1001)
demosSandBox_d.exe!dgWorld::TickCallback(int threadID) Line 1037
 at sdk\dgphysics\dgworld.cpp(1037)
demosSandBox_d.exe!dgAsyncThread::Execute(int threadID) Line 120
 at sdk\dgcore\dgmutexthread.cpp(120)
demosSandBox_d.exe!dgThread::dgThreadSystemCallback(void * threadData) Line 201
 at sdk\dgcore\dgthread.cpp(201)
demosSandBox_d.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92
 at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(92)
 [ somewhere here some external code was called but i deleted the message so i don't know if it is here or above or whatever]
demosSandBox_d.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115
 at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(115)

matrix0 is:

-       m_front {...}   dVector

        m_x 1.00000000  float
        m_y 0.000000000 float
        m_z 0.000000000 float
        m_w 0.000000000 float
-       m_up    {...}   dVector

        m_x 0.000000000 float
        m_y 1.00000000  float
        m_z 0.000000000 float
        m_w 0.000000000 float
-       m_right {...}   dVector

        m_x 0.000000000 float
        m_y 0.000000000 float
        m_z 1.00000000  float
        m_w 0.000000000 float
-       m_posit {...}   dVector

        m_x 0.000000000 float
        m_y 2.50000000  float
        m_z 0.000000000 float
        m_w 1.00000000  float

gyroscopic precession fails assertion,

demosSandBox_d.exe!dCustomBallAndSocket::SubmitAngularAxis(const dMatrix & matrix0, const dMatrix & matrix1, float timestep) Line 342
    at sdk\dcustomjoints\dcustomballandsocket.cpp(342)
demosSandBox_d.exe!dCustomBallAndSocket::SubmitConstraints(float timestep, int threadIndex) Line 417
    at sdk\dcustomjoints\dcustomballandsocket.cpp(417)
demosSandBox_d.exe!dCustomJoint::SubmitConstraints(const NewtonJoint * const me, float timestep, int threadIndex) Line 216
    at sdk\dcustomjoints\dcustomjoint.cpp(216)
demosSandBox_d.exe!NewtonUserJoint::JacobianDerivative(dgContraintDescritor & params) Line 109
    at sdk\dgnewton\newtonclass.cpp(109)
demosSandBox_d.exe!dgWorldDynamicUpdate::GetJacobianDerivatives(dgContraintDescritor & constraintParam, dgJointInfo * const jointInfo, dgConstraint * const constraint, dgLeftHandSide * const leftHandSide, dgRightHandSide * const rightHandSide, int rowCount) Line 484
    at sdk\dgphysics\dgworlddynamicupdate.cpp(484)
demosSandBox_d.exe!dgWorldDynamicUpdate::BuildJacobianMatrix(dgBodyCluster * const cluster, int threadID, float timestep) Line 240
    at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(240)
demosSandBox_d.exe!dgWorldDynamicUpdate::ResolveClusterForces(dgBodyCluster * const cluster, int threadID, float timestep) Line 665
    at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(665)
demosSandBox_d.exe!dgWorldDynamicUpdate::CalculateClusterReactionForcesKernel(void * const context, void * const worldContext, int threadID) Line 459
    at sdk\dgphysics\dgworlddynamicupdate.cpp(459)
demosSandBox_d.exe!dgThreadHive::QueueJob(void(*)(void * const, void * const, int) callback, void * const context0, void * const context1, const char * const functionName) Line 322
    at sdk\dgcore\dgthreadhive.cpp(322)
demosSandBox_d.exe!dgWorldDynamicUpdate::UpdateDynamics(float timestep) Line 138
    at sdk\dgphysics\dgworlddynamicupdate.cpp(138)
demosSandBox_d.exe!dgWorld::StepDynamics(float timestep) Line 942
    at sdk\dgphysics\dgworld.cpp(942)
demosSandBox_d.exe!dgWorld::RunStep() Line 1001
    at sdk\dgphysics\dgworld.cpp(1001)
demosSandBox_d.exe!dgWorld::TickCallback(int threadID) Line 1037
    at sdk\dgphysics\dgworld.cpp(1037)
demosSandBox_d.exe!dgAsyncThread::Execute(int threadID) Line 120
    at sdk\dgcore\dgmutexthread.cpp(120)
demosSandBox_d.exe!dgThread::dgThreadSystemCallback(void * threadData) Line 201
    at sdk\dgcore\dgthread.cpp(201)
[External Code]
demosSandBox_d.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(92)
demosSandBox_d.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(115)
[External Code]

matrix0 is this so lateralDir is zero length vector it seems

-       matrix0 {m_front={...} m_up={...} m_right={...} ...}    const dMatrix &
-       m_front {...}   dVector
        m_x 1.00000000  float
        m_y 0.000000000 float
        m_z 0.000000000 float
        m_w 0.000000000 float
-       m_up    {...}   dVector
        m_x 0.000000000 float
        m_y 1.00000000  float
        m_z 0.000000000 float
        m_w 0.000000000 float
-       m_right {...}   dVector
        m_x 0.000000000 float
        m_y 0.000000000 float
        m_z 1.00000000  float
        m_w 0.000000000 float
-       m_posit {...}   dVector
        m_x 0.000000000 float
        m_y 3.00000000  float
        m_z -2.00000000 float
        m_w 1.00000000  float

"primitive collision" (the demo option) doesn't appear to do any collisions. I do not know if it is supposed to.

"simple box stacks" using 1 thread (7700T at 3.6 GHz) starts at 500 ms physics time, drops to 5 ms as it settles down but it bogs down to 500ms again if i smash things around. Maybe because it is the debug version?

"compound collision shape", "non-uniform scaled collision shape" fail assertion at:

demosSandBox_d.exe!dgCollisionInstance::SetGlobalScale(const dgVector & scale) Line 407
    at sdk\dgphysics\dgcollisioninstance.cpp(407)
demosSandBox_d.exe!dgCollisionCompound::ApplyScale(const dgVector & scale) Line 876
    at sdk\dgphysics\dgcollisioncompound.cpp(876)
demosSandBox_d.exe!dgCollisionInstance::SetScale(const dgVector & scale) Line 349
    at sdk\dgphysics\dgcollisioninstance.cpp(349)
demosSandBox_d.exe!NewtonCollisionSetScale(const NewtonCollision * const collision, float scaleX, float scaleY, float scaleZ) Line 4062
    at sdk\dgnewton\newton.cpp(4062)
demosSandBox_d.exe!MakeFunnyCompound(DemoEntityManager * const scene, const dVector & origin) Line 396
    at applications\demossandbox\sdkdemos\demos\compoundcollision.cpp(396)
demosSandBox_d.exe!CompoundCollision(DemoEntityManager * const scene) Line 448
    at applications\demossandbox\sdkdemos\demos\compoundcollision.cpp(448)
demosSandBox_d.exe!DemoEntityManager::LoadDemo(int menu) Line 921
    at applications\demossandbox\sdkdemos\demoentitymanager.cpp(921)
demosSandBox_d.exe!DemoEntityManager::ShowMainMenuBar() Line 910
    at applications\demossandbox\sdkdemos\demoentitymanager.cpp(910)
demosSandBox_d.exe!DemoEntityManager::RenderStats() Line 1086
    at applications\demossandbox\sdkdemos\demoentitymanager.cpp(1086)
demosSandBox_d.exe!DemoEntityManager::Run() Line 1681
    at applications\demossandbox\sdkdemos\demoentitymanager.cpp(1681)
demosSandBox_d.exe!main(int __formal, char * * __formal) Line 62
    at applications\demossandbox\sdkdemos\main.cpp(62)
[External Code]

there's a dAssert(0) in dTractorModel::MakeHydraulic ( dModelNode* const node, const char* const name0, const char* const name1, const char* const effectorName1) Line 456 after some ignoring it works, i guess?

passive ragdoll fails at:

demosSandBox_d.exe!_VCrtDbgReportW(int nRptType, void * returnAddress, const wchar_t * szFile, int nLine, const wchar_t * szModule, const wchar_t * szFormat, char * arglist) Line 502
    at minkernel\crts\ucrt\src\appcrt\misc\dbgrptt.cpp(502)
demosSandBox_d.exe!_CrtDbgReportW(int report_type, const wchar_t * file_name, int line_number, const wchar_t * module_name, const wchar_t * format, ...) Line 278
    at minkernel\crts\ucrt\src\appcrt\misc\dbgrpt.cpp(278)
demosSandBox_d.exe!dCustomBallAndSocket::SubmitAngularAxis(const dMatrix & matrix0, const dMatrix & matrix1, float timestep) Line 342
    at sdk\dcustomjoints\dcustomballandsocket.cpp(342)
demosSandBox_d.exe!dCustomBallAndSocket::SubmitConstraints(float timestep, int threadIndex) Line 417
    at sdk\dcustomjoints\dcustomballandsocket.cpp(417)
demosSandBox_d.exe!dCustomJoint::SubmitConstraints(const NewtonJoint * const me, float timestep, int threadIndex) Line 216
    at sdk\dcustomjoints\dcustomjoint.cpp(216)
demosSandBox_d.exe!NewtonUserJoint::JacobianDerivative(dgContraintDescritor & params) Line 109
    at sdk\dgnewton\newtonclass.cpp(109)
demosSandBox_d.exe!dgWorldDynamicUpdate::GetJacobianDerivatives(dgContraintDescritor & constraintParam, dgJointInfo * const jointInfo, dgConstraint * const constraint, dgLeftHandSide * const leftHandSide, dgRightHandSide * const rightHandSide, int rowCount) Line 484
    at sdk\dgphysics\dgworlddynamicupdate.cpp(484)
demosSandBox_d.exe!dgWorldDynamicUpdate::BuildJacobianMatrix(dgBodyCluster * const cluster, int threadID, float timestep) Line 240
    at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(240)
demosSandBox_d.exe!dgWorldDynamicUpdate::ResolveClusterForces(dgBodyCluster * const cluster, int threadID, float timestep) Line 665
    at sdk\dgphysics\dgworlddynamicssimplesolver.cpp(665)
demosSandBox_d.exe!dgWorldDynamicUpdate::CalculateClusterReactionForcesKernel(void * const context, void * const worldContext, int threadID) Line 459
    at sdk\dgphysics\dgworlddynamicupdate.cpp(459)
demosSandBox_d.exe!dgThreadHive::dgWorkerThread::RunNextJobInQueue(int threadId) Line 224
    at sdk\dgcore\dgthreadhive.cpp(224)
demosSandBox_d.exe!dgThreadHive::dgWorkerThread::ConcurrentWork(int threadId) Line 243
    at sdk\dgcore\dgthreadhive.cpp(243)
demosSandBox_d.exe!dgThreadHive::dgWorkerThread::Execute(int threadId) Line 260
    at sdk\dgcore\dgthreadhive.cpp(260)
demosSandBox_d.exe!dgThread::dgThreadSystemCallback(void * threadData) Line 201
    at sdk\dgcore\dgthread.cpp(201)
[External Code]
demosSandBox_d.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(92)
demosSandBox_d.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(115)
[External Code]

single body car fails assertion three times and then crashes:

demosSandBox_d.exe!dMatrix::RotateVector(const dVector & v) Line 405
    at sdk\dmath\dmatrix.cpp(405)
demosSandBox_d.exe!dMultiBodyVehicleEngine::dGearBoxAndClutchJoint::JacobianDerivative(dComplementaritySolver::dParamInfo * const constraintParams) Line 352
    at sdk\dvehicle\dmultibodyvehicle\dmultibodyvehicleengine.cpp(352)
demosSandBox_d.exe!dVehicleSolver::BuildJacobianMatrix(float timestep, dComplementaritySolver::dBilateralJoint * const joint) Line 615
    at sdk\dvehicle\dvehiclesolver.cpp(615)
demosSandBox_d.exe!dVehicleSolver::BuildJacobianMatrix(float timestep) Line 672
    at sdk\dvehicle\dvehiclesolver.cpp(672)
demosSandBox_d.exe!dVehicleSolver::Update(float timestep) Line 1149
    at sdk\dvehicle\dvehiclesolver.cpp(1149)
demosSandBox_d.exe!dMultiBodyVehicle::PreUpdate(float timestep) Line 611
    at sdk\dvehicle\dmultibodyvehicle\dmultibodyvehicle.cpp(611)
demosSandBox_d.exe!dVehicleManager::PreUpdate(float timestep, int threadID) Line 113
    at sdk\dvehicle\dvehiclemanager.cpp(113)
demosSandBox_d.exe!dCustomParallelListener::ParallerListenPreUpdateCallback(NewtonWorld * const world, void * const context, int threadIndex) Line 95
    at sdk\dcustomjoints\dcustomlistener.cpp(95)
demosSandBox_d.exe!dgThreadHive::QueueJob(void(*)(void * const, void * const, int) callback, void * const context0, void * const context1, const char * const functionName) Line 322
    at sdk\dgcore\dgthreadhive.cpp(322)
demosSandBox_d.exe!dgWorld::ExecuteUserJob(void(*)(void * const, void * const, int) userJobKernel, void * const userJobKernelContext, const char * const functionName) Line 603
    at sdk\dgphysics\dgworld.cpp(603)
demosSandBox_d.exe!NewtonDispachThreadJob(const NewtonWorld * const newtonWorld, void(*)(NewtonWorld * const, void * const, int) task, void * const usedData, const char * const functionName) Line 573
    at sdk\dgnewton\newton.cpp(573)
demosSandBox_d.exe!dCustomParallelListener::PreUpdate(float timestep) Line 124
    at sdk\dcustomjoints\dcustomlistener.cpp(124)
demosSandBox_d.exe!dCustomListener::PreUpdate(const NewtonWorld * const world, void * const listenerUserData, float timestep) Line 57
    at sdk\dcustomjoints\dcustomlistener.cpp(57)
demosSandBox_d.exe!dgBroadPhase::UpdateContacts(float timestep) Line 1711
    at sdk\dgphysics\dgbroadphase.cpp(1711)
demosSandBox_d.exe!dgWorld::UpdateBroadphase(float timestep) Line 1236
    at sdk\dgphysics\dgworld.cpp(1236)
demosSandBox_d.exe!dgWorld::StepDynamics(float timestep) Line 940
    at sdk\dgphysics\dgworld.cpp(940)
demosSandBox_d.exe!dgWorld::RunStep() Line 1001
    at sdk\dgphysics\dgworld.cpp(1001)
demosSandBox_d.exe!dgWorld::TickCallback(int threadID) Line 1037
    at sdk\dgphysics\dgworld.cpp(1037)
demosSandBox_d.exe!dgAsyncThread::Execute(int threadID) Line 120
    at sdk\dgcore\dgmutexthread.cpp(120)
demosSandBox_d.exe!dgThread::dgThreadSystemCallback(void * threadData) Line 201
    at sdk\dgcore\dgthread.cpp(201)
[External Code]
demosSandBox_d.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(92)
demosSandBox_d.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(115)
[External Code]

basic player controller fails an assertion in a virtual method... i suspect some subclass was supposed to override this method but didn't?

demosSandBox_d.exe!dVehicleManager::OnUpdateTransform(dVehicle * const vehicle, float timestep) Line 35
    at sdk\dvehicle\dvehiclemanager.h(35)
demosSandBox_d.exe!dVehicleManager::PostStep(float timestep, int threadID) Line 135
    at sdk\dvehicle\dvehiclemanager.cpp(135)
demosSandBox_d.exe!dCustomParallelListener::ParallerListenPostStepCallback(NewtonWorld * const world, void * const context, int threadIndex) Line 88
    at sdk\dcustomjoints\dcustomlistener.cpp(88)
demosSandBox_d.exe!dgThreadHive::QueueJob(void(*)(void * const, void * const, int) callback, void * const context0, void * const context1, const char * const functionName) Line 322
    at sdk\dgcore\dgthreadhive.cpp(322)
demosSandBox_d.exe!dgWorld::ExecuteUserJob(void(*)(void * const, void * const, int) userJobKernel, void * const userJobKernelContext, const char * const functionName) Line 603
    at sdk\dgphysics\dgworld.cpp(603)
demosSandBox_d.exe!NewtonDispachThreadJob(const NewtonWorld * const newtonWorld, void(*)(NewtonWorld * const, void * const, int) task, void * const usedData, const char * const functionName) Line 573
    at sdk\dgnewton\newton.cpp(573)
demosSandBox_d.exe!dCustomParallelListener::PostStep(float timestep) Line 112
    at sdk\dcustomjoints\dcustomlistener.cpp(112)
demosSandBox_d.exe!dCustomListener::PostStep(const NewtonWorld * const world, void * const listenerUserData, float timestep) Line 50
    at sdk\dcustomjoints\dcustomlistener.cpp(50)
demosSandBox_d.exe!dgWorld::RunStep() Line 1021
    at sdk\dgphysics\dgworld.cpp(1021)
demosSandBox_d.exe!dgWorld::TickCallback(int threadID) Line 1037
    at sdk\dgphysics\dgworld.cpp(1037)
demosSandBox_d.exe!dgAsyncThread::Execute(int threadID) Line 120
    at sdk\dgcore\dgmutexthread.cpp(120)
demosSandBox_d.exe!dgThread::dgThreadSystemCallback(void * threadData) Line 201
    at sdk\dgcore\dgthread.cpp(201)
[External Code]
demosSandBox_d.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(92)
demosSandBox_d.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115
    at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(115)
[External Code]

simple cloth patch and simple soft body both fail at hardcoded assertions and i see commented out code

... in sdk\dVehicle\dMultiBodyVehicle\dMultiBodyVehicleEngine.cpp line 151

static int xxxx;
void dMultiBodyVehicleEngine::UpdateAutomaticGearBox (dFloat timestep) {
    m_metricInfo.m_gearsCount = 4;
    //  m_gearTimer--;
    //  if (m_gearTimer < 0) {

    dFloat omega = dAbs (m_omega);
    xxxx++;
    if (xxxx > 200) {
        SetGear(dEngineInfo::dGearRatioIndex(dEngineInfo::m_firstGear));
        return;
    } else {
        SetGear(dEngineInfo::dGearRatioIndex(dEngineInfo::m_neutralGear));
        return;
    }

is someone trashing the source tree? what is this?

Am I missing something? Did something happen recently?

JulioJerez commented 4 years ago

oh wow, that's a long list of problem, I check it out and you are right. I made a mistake in the ball socket joint last week and I have not look at the engine since. It is fix now.

I verified that these bug are fixed. "using the newton mesh tool" works "gyroscopic precession" works "primitive collision" this is a very old demo, that sow how the engine can be used as collsion only library "simple box stacks" this is not meat to be run in debug, in fact you are getting faster fps than I in debug. in release you should get under 10 ms per frame, but if you run multithreaded and async update the physics update sould be almost free. "compound collision shape", "non-uniform scaled collision shape" fixed "dTractorModel::MakeHydraulic" fixed "passive ragdoll" should work. "dMultiBodyVehicleEngine" this one Is temporarily disabled because I am merging the player controller "single body car" is a contribution by Dave Gravel, should be working. "basic player controller" yes there was a problem, is fixed now

"simple cloth patch" this is on hold until the secudn half of the year when get the GPU solver ready for now I need to get the full body IK an dthe GPU solver.

please you sync, then you can check again.

JulioJerez commented 4 years ago

thanks for the detailed report
when you run the test, see if your machine support the GPU solver. this is the prototype for the actual GPU solver by implemented in CPU using avx it run the current demo much faster.

george-tsiros commented 4 years ago

Neat! That was fast... thank you very much for your work! I will keep testing.

Sadly i am not very good at c++ so i can only help a little.

I would like to use this under .net with c#, i see sdk\dWrappers\csharp\ is that work in progress for a c# wrapper?

again, thank you for your work and your efforts!

JulioJerez commented 4 years ago

That's the wrapper for the unity plugin. It uses swiig for making a manage csharp wrapper.

On Sat, Mar 28, 2020, 12:13 PM george-tsiros notifications@github.com wrote:

Closed #210 https://github.com/MADEAPPS/newton-dynamics/issues/210.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MADEAPPS/newton-dynamics/issues/210#event-3175241980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6EPJAEQIBDZOQ6M3H3Z63RJZD4RANCNFSM4LVRPHWQ .

george-tsiros commented 4 years ago

it looks like gpu acceleration works. Tried 32bit debug, 32bit release and 64bit release. When i switch to gpu solver and restart the demo, I see that after letting the scene settle, it is about twice faster (5ms instead of 10ms, vega 56, stock) and if i move the vehicles blindly forward it is a bit faster.

are you a physicist? When the system is analyzed, does it make any attempt to simplify the degrees of freedom or does it apply all constraints as they were initially described?

I see that in the msvc/visualstudio projects, the compilation options to me look unoptimized. 1) you usually use gcc/other so you haven't tweaked them 2) you let us choose what we want 3) you have checked that it doesn't make a difference 4) something else? 🤔

I have many more questions, but for now I will let you do your work, the fixes you made are enough for me to start reading the source more closely

again, thank you very much for your work and your time

JulioJerez commented 4 years ago

no, I am not a physicist, my degree is in mechanical Engineering. It engien is implement a holonomic reduced coordinate system, therefore each joint is represented by at most 6 degree of freedon, so there is not need simplify any further. I does have to simplify the degree of freedomm for contact joints. and I have tried several methods over the years.
1-desposing joint into Eigen values and selection the rows with the must dominant eigen values. this is very elegant solution, teh code is still in teh engine but disabled, but is has the problem that it may deem important contact as redundant, so it is better to use geometrical methods. I am now using a hybrid method for reduce dof for contacts. Basically a pre reduction using geometric projection over the convex hull formed by the contact points. them the linear system solver clamps contacts that reach max values, making in effect similar to singular value decomposition. It seems to work quite well.

the compiler option are not really that important, it only matter the one for a particual instruction set. Since the engine is open source, any one can chose the compiler options they want to try.

george-tsiros commented 4 years ago

WAIT. you've been a coder since 97!?!