OgreNewt Maintenance

SFCBias

21-07-2011 22:29:13

Hello everyone, I've been away from OgreNewt for sometime and have recently cam back to work on maintaining this wrapper again.

First things first:
I'm going to get an up to date release on OgreNewt that will work with the latest version of Newton.

Next:
I'm considering doing a rewrite of the code to make it easier to use. Simpler function calls with easier parameters. But still give you full control of the physics. This ofcourse will take some time but , ill start with the basics first and gradually add features as the need for them come. On the first release of this, I'll leave the topic open for feedback on which features people need the most and work my way down a list.

If there are any immediate questions, feel free to post them here.

The latest version of OgreNewt can still be found here. Please note that this version is made for Newton 2.24 ~ 2.25, and i'm working on the newest version

Lax

22-07-2011 09:52:09

Hi,

i'm happy to hear that we have a maintainer for OgreNewt. I've an version build with Newton 2.32 and its working, but there are some strange issues. I had to implement a thread for raycast on Terrain-Heighmap, in order to get the raycast working. Furthermore the debug collision lines aren't working and I'm not that experienced with Newton to see how to solve the problem. If you want I could share my version.

SFCBias

23-07-2011 03:16:32

I've compiled a version that builds with Newton 2.33, you could compare your version against mine and make note of differences and tell me about them. I went through it rather quickly and haven't had a chance to write a program to test it.

As far as the debug lines, if i remember correctly, it's not a newton problem but rather a ogrenewt problem, i fixed it at one point, but never commited the changes. I'm sure it's not much to fix but I'll recommit once its fixed.

Lax

23-07-2011 16:43:47

I have the HeightField collision with raycast included in my version. Shall I copy the code into this topic?

SFCBias

25-07-2011 20:34:30

Yes please do.

Lax

27-07-2011 18:27:54

It was a longer time ago, when I adapted OgreNewt and maybe something is wrong with the heighfieldraycast. You can download the .cpp and .h files here: http://www.lukas-kalinowski.com/Homepag ... tFiles.zip

tod

18-08-2011 20:00:05

Hey, mister maintainer, please also look over my posts, I have some fixes posted myself :D .
Also I made it work with 2.30, it would be great to have a branch for 2.30 as later versions have a very different folder structure and I, for one, have already made some changes that would be a pain in the ass to merge to the newer versions.
Thanks.

SFCBias

21-08-2011 13:55:04

PM'd you. Good work :)

Lax

30-08-2011 09:24:04

Hey,

I've got request from a few people to release my OgreNewt version, which works with newton2.32. You can download It here: http://www.lukas-kalinowski.com/Homepag ... ewt2_0.zip
This version is stable and has heightfieldraycast too. But It only works, if the raycast is done in an own thread. I wrote with the newton maintainer about this issue, but without success. Here the instruction:
  1. create an boost thread inside your class and a extern variable outside the player class, if the player is deleted, to prevent errors when the application closes:[/list:u]

    boost::thread* pRaycastThread;
    extern bool myPlayerDeleted = false;

    1. create a static function inside the class that is started in the thread:[/list:u]
      static void checkObjectsBelow(void* pManager);
      1. In the constructor initialise the thread:[/list:u]
        this->pRaycastThread = new boost::thread(boost::bind(&Flubber::checkObjectsBelow, this));
        1. in the destructor set:[/list:u]
          myFlubberDeleted = true;
          1. Now here the main thread function. The gameloop is adapted to 60 fps:[/list:u]

            void Flubber::checkObjectsBelow(void* pManager)
            {
            Flubber *pFlubber = (Flubber*)pManager;
            //get the Ogre timer
            Ogre::Real nextUpdate = OBA::Core::getSingletonPtr()->pTimer->getMilliseconds();
            //check if the player is present
            while (myFlubberDeleted == false)
            {
            //let windows procede signals
            #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
            Ogre::WindowEventUtilities::messagePump();
            #endif
            //look if it is now time to update
            if (OBA::Core::getSingletonPtr()->pTimer->getMilliseconds() >= nextUpdate)
            {
            Ogre::Vector3 playerPos = Ogre::Vector3::ZERO;
            if (myFlubberDeleted == false)
            {
            playerPos = pFlubber->getNode()->getPosition();
            //startposition
            Ogre::Vector3 charPoint = Ogre::Vector3(playerPos.x, playerPos.y + 0.4f, playerPos.z);
            //shoot the ray 500 meters in -y
            OgreNewt::BasicRaycast ray(pFlubber->pOgreNewt, charPoint, charPoint + Ogre::Vector3::NEGATIVE_UNIT_Y * 500.0f, true);
            //look if there was a contact
            OgreNewt::BasicRaycast::BasicRaycastInfo contact = ray.getFirstHit();
            if (contact.getBody())
            {
            //get the distance from the player to the hit object
            pFlubber->height = contact.mDistance * 500.0f;
            //if the type is the new terrain of Ogre. (When you create the terrain, you need to set the physicstype
            if (contact.mBody->getType() == OBA::Core::getSingletonPtr()->TERRAINTYPE)
            {
            //Y
            //|
            //|___ normal
            //get the angle between the player and the terrain
            Ogre::Vector3 vec = Ogre::Vector3::UNIT_Y;
            Ogre::Vector3 normal = contact.mNormal;
            pFlubber->rise = Ogre::Math::ACos(vec.dotProduct(normal) / (vec.length() * normal.length())).valueDegrees();
            }
            }
            }

            //1000/60 = 16 , this function is called every 16 frames
            nextUpdate += 16.667;
            }
            }
            //if the player was deleted, detach the thread and delete
            pFlubber->pRaycastThread->detach();
            delete pFlubber->pRaycastThread;
            pFlubber->pRaycastThread = NULL;
            }


            Cheers
            Lax

SFCBias

30-08-2011 11:55:46

If you make that into a patch, I'll happily apply it.

Lax

30-08-2011 14:46:13

oh, i'm sorry, I've no clue how the patch thing works...
And the thread code is outside of OgreNewt...

StormChild

19-10-2011 19:53:39

Is there a solution available for the not working debug lines? :)

Lax

26-08-2012 15:59:09

Hey all,

i tried to compile the RadDoll demo, but i see that it is not conform with OgreNewt2.0 (Hinge joint and callbacks has been changed). Has someone got this demo working and could share the code?

Thanks in advance
Lax

juliojerez

17-07-2013 16:34:36

Hi.
I made a new version of Ogre newton with use newton 3.10
I made a post making the announcement, but it need to be approve by a moderator because it include a link to the download site

can a moderator review the post please.
Julio

Lax

14-12-2013 11:30:48

SCFBias is the moderator, but I heard nothing of him for a longer time. I'm still working with ogre newt but the forum seems dead. Maybe a new moderator is required unless SCFBias is coming back...

spacegaier

14-12-2013 19:37:37

can a moderator review the post please.


SCFBias is the moderator, but I heard nothing of him for a longer time. I'm still working with ogre newt but the forum seems dead. Maybe a new moderator is required unless SCFBias is coming back...

Just FYI: Approving posts can also be done by global mods/admins such as myself, so that is still taken care of (and given that I cannot see any open approval requests that seems to have been taken care of). However, we global moderators cannot assist in OgreNewt question from a content perspective since (at least I personally) do not have any knowledge in that area ;) .