Switching to Newton Archimedia

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Switching to Newton Archimedia

Postby agi_shi » Wed May 14, 2008 6:39 pm

Alright, I *just* moved to Archimedia. I'm really impressed as to how easy the switch was, just a couple of parameters to fix here and there, some functions to change, and it Just Works. I have a couple of questions, though:

1. I'm pretty sure I read that smaller bodies were now handled a lot better in Archimedia... though my small bodies that behaved rather well in 1.53 tend to fall through the floor and vibrate (a lot!) in Archimedia... Ideas? I've set both the object's material and the object itself to the continuous collision mode. Bigger bodies are fine.

2. I'm really missing the body freeze functions. When I spawn my portal somewhere, I need all of the objects in it's AABB to wake up. I did this using a the NewtonForEachBodyInAABB() function, calling Unfreeze() on each of these bodies. Though, now I can't do that, this function doesn't exist anymore. The old trick of applying a small impulse to wake the body up doesn't work, either. So when I spawn a portal somewhere, many of the objects won't "notice" it because they are sleeping.

3. Right after I switched, I think lots of my crashes Just Disappeared. Haven't crashed once since I switched to Archimedia! :D

4. Like you know, Julio, I * at math :oops:. The custom portal joint you completely helped me out with, it does this line in the constructor:
Code: Select all
CalculateLocalMatrix (pivot, matrix.m_front, m_localMatrix0, m_localMatrix1);

Though, in the new custom joints, the function accepts 3 matrices, not 2 vectors and 2 matrices. So how do I fix it, what do I pass as the first matrix?

Other than this, I'm off to explore :D. Archimedia is awesome! (beta_12 right now)
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Postby Julio Jerez » Thu May 15, 2008 1:25 pm

first off donwload the SDK again .

let us take one problem at a time.
how are you activationg teh bodies?
are you saying that you are teleportiong a group of bodies and because they are sleeping they no move after the teleport?

I think all of the nessesary funtionality is in the SDK.
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby agi_shi » Thu May 15, 2008 7:13 pm

Julio Jerez wrote:first off donwload the SDK again .

let us take one problem at a time.
how are you activationg teh bodies?
are you saying that you are teleportiong a group of bodies and because they are sleeping they no move after the teleport?

I think all of the nessesary funtionality is in the SDK.

Alright, I managed to fix this now :D (NewtonBodySetFreezeState(), I didn't notice this function in the header)

Any ideas on the other problems?

Also, there seems to be a very odd bug where NewtonUpdate() doesn't return (infinite loop?)... It happens only happens if I set up my world with "NewtonSetThreadsCount(world, 4)", when I toggle whether my portals are dynamic or not:
Code: Select all
void Portal::setDynamic(bool dyn) {
        dynamic = dyn;

        if (dynamic)
            setMass(_mass);
        else {
            float oldMass = _mass;
            setMass(0);
            _mass = oldMass;
        }
    }

_mass is always at 25. Basically, all I do to make the portals dynamic (movable) or not is either give them a mass or give them 0 mass. Giving them 0 mass works, but then when I give them some mass again, the next NewtonUpdate() does not return. Any ideas? The time step is fixed at 1.0 / 60.0.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Postby Julio Jerez » Thu May 15, 2008 7:40 pm

All of the problems should have trivial solutions.
Th ejoint is very simple, is just passing teh righ parameters.

as for the small objects, can you send me a working demo to see what is going on?
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby agi_shi » Wed May 21, 2008 6:17 pm

Thanks for the reply :)

About the joint, I'll check out the other custom joints and see how they make the first parameter. I am just confused since not instead of passing the pivot and front vector, I need to pass a full matrix - and I am not exactly sure how the custom joint CalculateLocalMatrix wants this full matrix to be made (it seems to be a combination of the pin and front vector :S).

As for the small objects, I can't really give you a working demo, the major reason being the fact that my working directory is currently all over the place, and getting a working demo that actually works on a machine other than mine would be a lot harder than a simple video: http://rapidshare.com/files/116632016/s ... s.avi.html (mirror: http://www.MegaShare.com/415397) (sorry about the horrible quality, but I wanted to make the download really quick)

Details:
- 60Hz step is used with NewtonUpdate() (constant step)
- swept collision test was on in the video, otherwise the smallest objects don't even notice the floor at all
- in the video, first I spawn the same object at 1x its size, then at 2x its size, then at 3x its size (the bigger the better, but even at 3x its size, it still doesn't behave correctly as a cylinder)
- objects were made as cylinders:
radius = 0.029
height = 0.049
(obviously, when I make the object 2 or 3 times bigger, I also enlarge the radius/height)
This is my code for the cylinder:
Code: Select all
// 90 degree rotation about Z axis so that the cylinder
// does not go along the X axis, but along the Y axis
Ogre::Matrix4 rotZ90(Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_Z));
// transpose since Newton is row-major, Ogre is column-major
rotZ90 = rotZ90.transpose();
col = NewtonCreateCylinder(physMgr->gWorld(), radius, height, &rotZ90[0][0]);

- the floor is merely a tree collision (that works correctly with other objects)
- world units are meters, so 0.029 would be 2.9 centimeters - when scaled up 3x, it'd be 8.7 centimeters.

The reason I'm confused, is that these objects behaved correctly as cylinders in 1.53 (but they had to be scaled up, otherwise they still fell through the floor). Any ideas?
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Switching to Newton Archimedia

Postby brianhammond » Thu Aug 21, 2008 10:34 am

this thread died... what was the conclusion?
User avatar
brianhammond
 
Posts: 14
Joined: Thu Sep 06, 2007 7:59 pm

Re: Switching to Newton Archimedia

Postby Julio Jerez » Thu Aug 21, 2008 10:37 am

the bug was resolve when I said download the SDK again.
and the rest when he senmd me the test.
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Switching to Newton Archimedia

Postby brianhammond » Thu Aug 21, 2008 12:53 pm

so does that mean that small objects (0.029 units was mentioned) won't fall through other objects ("tunneling") with 2.0 beta?
User avatar
brianhammond
 
Posts: 14
Joined: Thu Sep 06, 2007 7:59 pm

Re: Switching to Newton Archimedia

Postby Julio Jerez » Thu Aug 21, 2008 12:56 pm

no if you set continue collision.
Julio Jerez
Moderator
Moderator
 
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron