A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Julio Jerez » Mon Jan 18, 2010 3:29 pm
Oh I see, and you want CustomUserJoint to be part of teh joint library?
Ok that is a solution, and it is not intrusive
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by kallaspriit » Mon Jan 18, 2010 5:05 pm
This would indeed be a solution and enables me to restore the existing CustomJoint interface so no existing joints are broken by our changes

If you add it to JointLibrary and update NGD version, I will commit my changes to OgreNewt.
-
kallaspriit
-
- Posts: 216
- Joined: Sun Aug 14, 2005 6:31 pm
by Julio Jerez » Mon Jan 18, 2010 5:28 pm
Alright I do that them. it is listed here?
after I am done with the ogrenewt and teh change ot the demos I will try to set a server on my Mac prop and set up SVN system,
now I am doing to many thing at teh same time.
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by kallaspriit » Mon Jan 18, 2010 5:36 pm
It was listed on previous page, search for topic starting with "I can reply myself".
Here is the code again, check whether this is correct and meets your style
CustomUserJoint.h- Code: Select all
/* Copyright (c) <2009> <Newton Game Dynamics>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely
*/
// CustomUserJoint.h: interface for the CustomUserJoint class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CUSTOMUSERJOINT_H__B631F556_468B_4331_B7D7_F85ECF3E9ADE__INCLUDED_)
#define AFX_CUSTOMUSERJOINT_H__B631F556_468B_4331_B7D7_F85ECF3E9ADE__INCLUDED_
#include "NewtonCustomJoint.h"
class JOINTLIBRARY_API CustomUserJoint: public NewtonCustomJoint
{
public:
CustomUserJoint(unsigned int maxDOF, const NewtonBody* child, const NewtonBody* parent = NULL);
virtual ~CustomUserJoint();
protected:
virtual void SubmitConstraints (dFloat timestep, int threadIndex);
virtual void GetInfo (NewtonJointRecord* info) const;
};
#endif // !defined(AFX_CUSTOMUSERJOINT_H__B631F556_468B_4331_B7D7_F85ECF3E9ADE__INCLUDED_)
And
CustomUserJoint.cpp:
- Code: Select all
/* Copyright (c) <2009> <Newton Game Dynamics>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely
*/
// CustomUserJoint.cpp: implementation of the CustomUserJoint class.
//
//////////////////////////////////////////////////////////////////////
#include "CustomJointLibraryStdAfx.h"
#include "CustomUserJoint.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
#define MIN_JOINT_PIN_LENGTH 50.0f
CustomUserJoint::CustomUserJoint(unsigned int maxDOF, const NewtonBody* child, const NewtonBody* parent)
:NewtonCustomJoint(maxDOF, child, parent)
{
}
CustomUserJoint::~CustomUserJoint()
{
}
void CustomUserJoint::GetInfo (NewtonJointRecord* info) const
{
strcpy (info->m_descriptionType, "customuser");
info->m_attachBody_0 = m_body0;
info->m_attachBody_1 = m_body1;
info->m_minLinearDof[0] = 0.0f;
info->m_maxLinearDof[0] = 0.0f;
info->m_minLinearDof[1] = 0.0f;
info->m_maxLinearDof[1] = 0.0f;;
info->m_minLinearDof[2] = 0.0f;
info->m_maxLinearDof[2] = 0.0f;
info->m_minAngularDof[0] = -FLT_MAX ;
info->m_maxAngularDof[0] = FLT_MAX ;
info->m_minAngularDof[1] = -FLT_MAX ;
info->m_maxAngularDof[1] = FLT_MAX ;
info->m_minAngularDof[2] = -FLT_MAX ;
info->m_maxAngularDof[2] = FLT_MAX ;
}
void CustomUserJoint::SubmitConstraints (dFloat timestep, int threadIndex)
{
}
-
kallaspriit
-
- Posts: 216
- Joined: Sun Aug 14, 2005 6:31 pm
by Julio Jerez » Mon Jan 18, 2010 5:39 pm
I do not really care about style, if it works I will added it teh teh library. I miss undertood your first post not I am clear.
Thank you, you will get it with 2.17 and teh next OgreNewt
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Julio Jerez » Thu Jan 28, 2010 12:38 pm
So you guy know what I am doing, I almost have the Collada import/Export completed.
It is very complete imported and I stressed tested by loading various Model from the Goggle Warehouse.
Now I am fixing the Newton SDK, to use the new Collada files, and soon I will integrate that system with OgreNewt, That will be the prove of pudding like the say.
I am guessing I will be back on the OgreNewt conversion by the end of the week.
Basically After integrated this with OgreNewt, we should be able to just say
OgreNewt->LoadModel (name)
And it will load a model including the Mesh, Material whether the boy is a Physics control body, or not,
That includes Vehicles, Contractions of connected bodies, Ragdolls or just gravity body.
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by kallaspriit » Thu Jan 28, 2010 4:48 pm
Great, hope to see it in action soon

-
kallaspriit
-
- Posts: 216
- Joined: Sun Aug 14, 2005 6:31 pm
by vectrex » Wed Feb 24, 2010 12:20 pm
Hi, Just reading through this thread (maybe the title could be changed

).
No one seriously uses framelisteners or the example app framework in Ogre. Just do your own main loop updating something like this
http://www.ogre3d.org/wiki/index.php/Pr ... et_Started
-
vectrex
-
- Posts: 21
- Joined: Sat Oct 01, 2005 10:15 am
- Location: Australia
-
by Julio Jerez » Wed Feb 24, 2010 1:02 pm
Really?
It seems to me that frame listeners are a very nice way to encapsulate applications third party plugins, while a Main loop is a non object oriented way to handle management.
It the end it come to the same thing, but looks to me that lot of work was put in a nice architecture just to be wasted.
I can see how it is easy for a beginner to just use a main loop, to get up and running.
Anyway it is good to know Frame Listeners are an out of favor feature of the Ogre engine.
when I resume the next wave of updates of OgreNewt, I will add all new demos using a Main Loop instead a the Frame listener.
Thanks you for the tip Vectrex, I think i will be a big push and improving the appeal of OgreNewt to new users.
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by vectrex » Wed Feb 24, 2010 1:43 pm
Julio Jerez wrote:Really?
It seems to me that frame listeners are a very nice way to encapsulate applications third party plugins, while a Main loop is a non object oriented way to handle management.
It the end it come to the same thing, but looks to me that lot of work was put in a nice architecture just to be wasted.
I can see how it is easy for a beginner to just use a main loop, to get up and running.
Anyway it is good to know Frame Listeners are an out of favor feature of the Ogre engine.
when I resume the next wave of updates of OgreNewt, I will add all new demos using a Main Loop instead a the Frame listener.
Thanks you for the tip Vectrex, I think i will be a big push and improving the appeal of OgreNewt to new users.
I wouldn't say they're out of favour as a concept but as you point out the implementation is too basic to use seriously. Making your own listeners isn't a big deal and really it's probably the applications job, which is usually why any Ogre feature gets neglected. Sinbad is always up for patches, but he has limited time so any non-core aspects he has to leave to the community and no-one has written a suitable replacement. They're even considering making animation a seperate part from the core. If you find any badly designed stuff in ogre it's almost certain it's older code that is marked for execution/rewriting. Ogre v2.0 has some fundamental design changes to the core so any major design changes are headed for that version (eg multiple scenemanagers, more extensive threading/tasking). You'll always find the odd crazy thing in a project this big, but overall we think it's by far the best option we've seen.
About OgreNewt, I'd like to see the Ogre specific stuff as seperate as possible. It makes for a nice c++ wrapper of newton in it's own right and it doesn't necessarily have to do much ogre specific stuff. We run mogrenewt (C# wrapper of a C++ wrapper of a C library

)
-
vectrex
-
- Posts: 21
- Joined: Sat Oct 01, 2005 10:15 am
- Location: Australia
-
by ian-g » Fri Feb 26, 2010 11:23 am
I'm reasonably new to Ogre, and although the FrameListeners via the Example* stuff was useful for learning, the BasicOgreFramework (
http://www.ogre3d.org/wiki/index.php/Basic_Ogre_Framework) is, in my opinion, absolutely fine for having complete control of everything, and is also simple to understand.
Looking forward to the new, improved OgreNewt!
-
ian-g
-
- Posts: 2
- Joined: Fri Feb 26, 2010 11:11 am
by Julio Jerez » Fri Feb 26, 2010 3:11 pm
I am confused now, do you like the frame listener or you do not like them?
Like I said Frame listeners are good for encapsulation thierd party plug in,
but for some reason the ogre Managers decided to put the updates call into a container sorted by the memory location and in no way the end application can have control over that,
That makes them useless for organizing large projects. I do not understand how can someone be so short sighted and refuse to make such simple change.
Of course anyone can change it locally for hsi own use, but then you run into the problem of integration with new releases.
if it was not because of that inexplicable mistake My guess is that most user would be using Frame listeners to implement client side application logic.
-
Julio Jerez
- Moderator

-
- Posts: 12425
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by vectrex » Sat Feb 27, 2010 12:22 am
Julio Jerez wrote:I am confused now, do you like the frame listener or you do not like them?
I like them, but right now my app works fine with just a mainloop. Ogre has started introducing task based threading models and will be getting more and more threaded, so soon it will be much more important to use events and listeners. I think soon they will redesign this type of thing, but yes I agree a simple ordered list would help and I don't think it would break anything using it now.
-
vectrex
-
- Posts: 21
- Joined: Sat Oct 01, 2005 10:15 am
- Location: Australia
-
by ian-g » Sat Feb 27, 2010 9:18 am
I think use whichever method you feel most comfortable with. The demos/examples you provide are there to show people what NGD can do and how to do it for a single frame. Whether that is then called via a FrameListener or inside a loop is irrelevant.
Everyone will have a different style or preference. As long as the logic and sequence of calls is correct that is what counts. It will be up to them (us) to then incorporate NGD/Ogrenewt into their own application.
Of course, a nice design pattern would be good but there is no enforcement of anything like that at the moment.
-
ian-g
-
- Posts: 2
- Joined: Fri Feb 26, 2010 11:11 am
by kallaspriit » Sun May 23, 2010 10:34 am
Julio, have you thought about the Featherstone algorithm or other ways to create stiff joints? I researched the topic a bit and found
this paper called "Practical Physics For Articulated Characters" by Evangelos Kokkevis, that somewhat explains the algorithm in principle and pseudocode, but my math just isn't good enough to make much sense of it myself

-
kallaspriit
-
- Posts: 216
- Joined: Sun Aug 14, 2005 6:31 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests