Jump to content


Photo

Gmnewton 2.0


  • Please log in to reply
385 replies to this topic

#361 NYS

NYS

    GMC Member

  • GMC Member
  • 450 posts
  • Version:GM:Studio

Posted 08 August 2011 - 11:53 PM

Hey Hansen,

I am using GM8.0 and I can't get any object to spawn at the correct x & y axis.
I was assuming this would work:
GmnBodySetPosition(body, x, y, z);
But it doesn't show the object.

I let the object display it's x, y and z axis and it says it's in a position where I should see it but it aint there.

!EDIT!

Ah, sorry! I fixed it finally :)

!EDIT2!

Another problem :/
http://g2f.nl/r45szz <- I'm not allowed to img tag .png files... :/
The big block in the back is moving from and towards the camera. It is supposed to push the coins (as in the game @ the fair) but they're going trough the block.

Create:
collision_shape = GmnCreateBox(global.world, xsize, ysize, zsize, 0, 0, 0);
body = GmnCreateBody(global.world, collision_shape);
GmnReleaseCollision(global.world, collision_shape);
GmnBodySetMassMatrix(body, 0, 0, 0);//It is supposed to have mass, but I don't want it to jump up n down
GmnBodyLinkObject(body, id, false);

GmnBodySetPosition(body,x,y,z);

Then I make it slide back and forth, and update it's position every step by using this:
GmnBodySetPosition(body, -10-xx, 0, z);

I am changing it's x axis and then updating it's position using GmnBodySetPosition.

I've seen createCustomSlider but I'm not really sure how to use it :/

Some help would be great! :)

-NYS

Edited by NYS, 09 August 2011 - 02:12 AM.

  • 0

#362 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 09 August 2011 - 02:28 PM

Hey Hansen,
...

Another problem :/
http://g2f.nl/r45szz <- I'm not allowed to img tag .png files... :/
The big block in the back is moving from and towards the camera. It is supposed to push the coins (as in the game @ the fair) but they're going trough the block.

Create:

collision_shape = GmnCreateBox(global.world, xsize, ysize, zsize, 0, 0, 0);
body = GmnCreateBody(global.world, collision_shape);
GmnReleaseCollision(global.world, collision_shape);
GmnBodySetMassMatrix(body, 0, 0, 0);//It is supposed to have mass, but I don't want it to jump up n down
GmnBodyLinkObject(body, id, false);

GmnBodySetPosition(body,x,y,z);

Then I make it slide back and forth, and update it's position every step by using this:
GmnBodySetPosition(body, -10-xx, 0, z);

I am changing it's x axis and then updating it's position using GmnBodySetPosition.

I've seen createCustomSlider but I'm not really sure how to use it :/

Some help would be great! :)

-NYS


I would recommend jointing the sliding object to a null object and then set the position of the null object in order to control it. A kinematic joint may work well for this. When you just set the position directly, the engine doesn't know what velocity to use to move other objects since, in theory, it has none. It jumped from point A to point B.
  • 0

#363 NYS

NYS

    GMC Member

  • GMC Member
  • 450 posts
  • Version:GM:Studio

Posted 09 August 2011 - 06:11 PM

Ah, that starts making some sense :)

I've tried many things now with the kinematic functions, but I just fail to see how I should do this :/
  • 0

#364 CMelva

CMelva

    GMC Member

  • New Member
  • 1 posts

Posted 21 September 2011 - 07:36 AM

Hey there!

Just wanted to share my opinion on this. I really enjoyed the first post from this thread and I really think the topic starter has made a terrific job! Best wishes and good luck to you!
  • 0

#365 ihato

ihato

    Destroyed

  • Banned Users
  • 739 posts
  • Version:GM8

Posted 03 November 2011 - 05:27 PM

I made an extension for it. Its kinda useless because it doesnt work.
I use it only to see arguments of the scripts.

#366 ean

ean

    GMC Member

  • New Member
  • 190 posts
  • Version:GM8

Posted 06 December 2011 - 10:27 PM

this thing crashes when it starts up

edit: solved on page 18, disable auto-updater and add code. please put this in your topic so people dont have to read 18 pages

i added gravity and nothing happened. edit: all i had to do was this: GmnUpdate(global.world,1/60);

edit: i cant figure out how to rotate anything. edit, everything was in radians.

x=GmnBodyGetPosition(body,0);
y=GmnBodyGetPosition(body,1);
z=GmnBodyGetPosition(body,2);

xrot=radtodeg(GmnBodyGetRotation(body,0));
yrot=radtodeg(GmnBodyGetRotation(body,1));
zrot=radtodeg(GmnBodyGetRotation(body,2));

will edit when i run into the next problem

edit: cant figure out the orientation of the cylinders, compatiblity mode doesn't help.

edit: got it to work but I had to import a model.

anyway nice work so far, i will let you know if i run into any more problems.


edit: when im applying torque it seems to use euler rotations, setomegaaxis didn't work either

Ran into another problem, joints don't seem to move their children until I apply torque to their children. edit: found GmnBodySetFreezeState(dBody,state);

also, GmnUpdateFPS doesn't do anything.

edit: okay i made a simple car physics, if your interested in improving it you might want to take a look at it here: http://gmc.yoyogames...l=&fromsearch=1

wheels dont get enough traction, and the hingejoint is too weak and bendable. i tried adjusting friction to simulate rubber (didn't realease the gm6 version) but it doesn't work. Even when I lock the joint car can't go in a straight line.

Edited by ean, 31 December 2011 - 11:43 AM.

  • 0

#367 gmx0

gmx0

    The Messenger

  • GMC Member
  • 1202 posts
  • Version:GM:Studio

Posted 31 December 2011 - 02:52 AM

Gonna redownload, I think my comp is unstable. :sweat:
  • 0

#368 Igyanata

Igyanata

    GMC Member

  • GMC Member
  • 33 posts

Posted 18 February 2012 - 11:12 PM

I have a very strange problem. I tried the example that is provided in the topic and it works fine. But when I tried to make one box on my own it didn't worked. I thought I might have missed something, so I made an exact copy each line from the example to a new project(just with the scripts in it) and it still doesn't work. I keep the dll in the same folder and I checked all the scripts and they are all the same. My version is 7.0. I also tried to save the example file into my version and it is still working, but when I copy all the codes to a separate new project it doesn't, so what I'm asking is if I am forgetting a step to connect the dll with my project or something? I really like the engine and I want to use it for a game but I can't make a clean project to work...If anyone had a problem like mine or especially if you can suggest a solution I'll be greatfull. :rolleyes:

PS: I think it won't be a problem to make my games in the example(because it is obviously working even if I make changes to it) but I won't be able to put the physics inside another project I have already started making, so I want to know what have I done wrong.
  • 0

#369 Boreal

Boreal

    C++ Wackjob

  • GMC Member
  • 417 posts
  • Version:None

Posted 26 February 2012 - 06:19 PM

Does this support script callbacks? That would be incredibly useful.

Edited by Drivinucrazy Games, 26 February 2012 - 06:19 PM.

  • 0

#370 playerwild0

playerwild0

    GMC Member

  • GMC Member
  • 8 posts
  • Version:Unknown

Posted 07 May 2012 - 06:07 AM

ok, i am a newbie, can some1 message me and tell me what each script does?? i would really appreciate it, Im trying to make a mmorg, i promise that once its finished , i will give you lots of credit, please, im probably not gunna remember to go back to this exact post, so message me pleazzzz
  • 0

#371 Himanshu

Himanshu

    GMC Member

  • GMC Member
  • 37 posts
  • Version:GM8.1

Posted 28 March 2013 - 04:17 AM

is ragdoll physics body supported?


  • 0

#372 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 1506 posts
  • Version:GM:Studio

Posted 31 March 2013 - 07:24 AM

Have You ever thought about helping YoYo make gm next? You could help them make the new 3d module and 3d physics engine and 3d level editor and 3d model importer and editor and loader.

Just think Imagine the money and fame and glory and popularity of the world thanking You for the wonderful support and product that You and YoYo would have Provided. You would be so happy to see them happy and adored by thousands of game maker users.


  • 0

#373 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 30 August 2013 - 08:18 AM

is ragdoll physics body supported?

Yes, you should look at hinges and joints.

 

 

Have You ever thought about helping YoYo make gm next? You could help them make the new 3d module and 3d physics engine and 3d level editor and 3d model importer and editor and loader.

Just think Imagine the money and fame and glory and popularity of the world thanking You for the wonderful support and product that You and YoYo would have Provided. You would be so happy to see them happy and adored by thousands of game maker users.

Game-maker is not the tool for that. Might be a nice addition tho, but it would be really hard to keep games cross-platform.

 

 

ok, i am a newbie, can some1 message me and tell me what each script does?? i would really appreciate it, Im trying to make a mmorg, i promise that once its finished , i will give you lots of credit, please, im probably not gunna remember to go back to this exact post, so message me pleazzzz

I wish i could... I've been searching for documentation as well. Very annoying that there is none at the moment.

 

I guess that most functions should be found out yourself.

I'm going to try to contact the creator!


  • 0

#374 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2665 posts
  • Version:GM:Studio

Posted 30 August 2013 - 10:42 AM

Has anybody tried this on GMS? Does it work?


  • 0

#375 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 30 August 2013 - 10:52 AM

Has anybody tried this on GMS? Does it work?

Yes, i'm using it in GMS. It works fine - its just not documented, so implementation is really hard.


  • 2

#376 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2665 posts
  • Version:GM:Studio

Posted 30 August 2013 - 11:09 AM

Oh wow, very interesting. What kind of models does it import? Does it directly support OBJ too?


  • 0

#377 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 30 August 2013 - 04:01 PM

Funny thing to bring up - i'm working on that as we speak. I want to be able to make 1 .obj files, textured and all, that i can use for display and physics. I'll update this topic once i'm done with that!


  • 0

#378 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2665 posts
  • Version:GM:Studio

Posted 31 August 2013 - 05:12 PM

Oh, I already wrote my own OBJ importer. ;)

 

I'll use that then.


  • 0

#379 Aragon

Aragon

    GMC Member

  • GMC Member
  • 142 posts

Posted 02 September 2013 - 01:42 PM

Share people, share!!!

 

Things like that could be really usefull!


  • 0

#380 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 02 September 2013 - 05:37 PM

Will share it soon! Have some more testing to do.

For now i really wonder whats up with "GmnCustomKinematicControllerSetTargetRotation"

It does not seem to work. I've tried degrees and radians, but both don't quite work out. The GmnCustomKinematicControllerSetTargetPosition does work however.
  • 0

#381 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 02 September 2013 - 05:41 PM

I don't know how, though I'm sure it is possible. Since I haven't had time to keep up with it, I might release the source if anyone is interested in contributing. Also if someone wanted to port it to GM4Mac, I do know it's possible. One would need to download the code from Newton Game Dynamics and compile it on a Mac I think. Anyone up to the task of porting GMNewton and/or helping to improve it?


YES! Release it PLEASE and i can work on fixing these issues!
  • 0

#382 darkwalker247

darkwalker247

    Fox

  • GMC Member
  • 1893 posts
  • Version:GM:Studio

Posted 07 September 2013 - 06:46 PM

Since Host-A doesn't seem to be working, here's a mirror I made: http://www.mediafire...g4c69a5i9zg6jmu


  • 0

#383 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 15 September 2013 - 06:45 PM

COME ON please come online and share the sourcecode!
  • 0

#384 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 771 posts
  • Version:GM:Studio

Posted 22 October 2013 - 11:28 AM

Allright! I have the sourcecode thanks to hanson.

 

I'll be putting it on github so everybody can help and fix bugs etc.


  • 0

#385 VINTproYKT

VINTproYKT

    GMC Member

  • GMC Member
  • 75 posts
  • Version:GM:Studio

Posted 11 April 2014 - 02:13 PM

Declared functions of that amazing library remind me functionality of games working on Source engine (for example, all known GMod) that has such stuff as rays, torque, buoyancy, player controller's stair height and, most importantly, materials. :woot: :thumbsup: I very like Newton Game Dynamics! @hanson, thank you for GM implementation of this library, it's really needful!

:thanks:

 

[EDIT]

I have question. How to get position of the joint (player controller)?

I've made a player controller that has variable/certain velocity, but body's position doesn't change.


Edited by VINTproYKT, 14 April 2014 - 11:57 AM.

  • 0

#386 Aragon

Aragon

    GMC Member

  • GMC Member
  • 142 posts

Posted 08 May 2014 - 11:13 AM

Here is a stuidio compatible. http://g2f.nl/045o62l
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users