Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Collision problem with Newton

Author
Message
o2q
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location:
Posted: 7th Feb 2009 13:49
Hello,

I'm trying to make a really simple collision in C# between two objects, a box and a bigger and flatter box, which represents ground.
However, no matter how hard I try, I just can't make them collide with each other. The box just goes throught the 'ground'.
I've looked at some of the C++ tutorials that come with NewtonSDK, and tried to convert it to C#, but I can't figure out what's wrong with my code.
Now I'm kinda running out of ideas so I'm hoping you could help me out.



I'm quite certain im missing something really small yet really required.
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 9th Feb 2009 18:50


Not sure but this line



seems a little odd to me.

Vertex 1 : 0 , 0 , 0
Vertex 2 : 0 , 0 , 0
Vertex 3 : 0 , 0 , 0
Vertex 4 : 15, 0 , 0

But I've never used Newton before, so don't shoot me if it I'm completely off track.

andiconda
15
Years of Service
User Offline
Joined: 10th Feb 2009
Location:
Posted: 10th Feb 2009 18:39
well honestly i don't use newton (i'm guessing its a physics/collision plugin)
so i don't really know the parameters of the functions
but like they guy before me said that line with all the 0.0f and the -15.0f looks a little weird.
if that is the land and those are collision related variables you probably need values instead of 0.
also i don't see where you are checking for a collision and resolving.
that is a very important part.
o2q
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location:
Posted: 16th Feb 2009 17:07
Quote: "well honestly i don't use newton (i'm guessing its a physics/collision plugin)
so i don't really know the parameters of the functions
but like they guy before me said that line with all the 0.0f and the -15.0f looks a little weird.
if that is the land and those are collision related variables you probably need values instead of 0.
also i don't see where you are checking for a collision and resolving.
that is a very important part. "


Yes it is a physics engine, and i'm using it because it's one of the only free ones for .NET.

I seriously can't figure out the other values. 12, 13 and 14 indicates position, then there's probably one vertex for rotation but that's pretty much it. There's nothing on the Newton forums either.
I tried playing with the values with no success. Also, as far as I know there's no need to check for collisions because the engine itself does it automatically. You just gotta pass the physic world's coordinates (positions and such) to the visual body with the transform callback.

Quote: "Vertex 1 : 0 , 0 , 0
Vertex 2 : 0 , 0 , 0
Vertex 3 : 0 , 0 , 0
Vertex 4 : 15, 0 , 0

But I've never used Newton before, so don't shoot me if it I'm completely off track."


I know. It looks weird to me too. With no values given in the offset array it defaults 0,5,10,15 to 1 and the rest 0. Maybe they're some kind of flags.

I dont knoww. This is driving me nuts!

Login to post a reply

Server time is: 2024-04-20 07:51:17
Your offset time is: 2024-04-20 07:51:17