Gmnewton 2.0
#341
Posted 10 January 2011 - 08:32 PM
#342
Posted 11 January 2011 - 07:45 PM
model=create_from_obj('./models/alfaromeo159/alfaromeo159.obj',0,0,1);
texture=background_get_texture(tex_car);
shape = GmnCreateConvexHull(global.world,0,0,0,0);
GmnModelBufferLoadMod('models/alfaromeo159/alfaromeo159.d3d',1);
GmnModelBufferClear();
GmnReleaseCollision(global.world,shape);
body = GmnCreateBody(global.world,shape);
GmnBodySetAutoMassMatrix(body,1,true);
GmnBodyLinkObject(body,id,true);
z=0;
xrot=0;
yrot=0;
zrot=0;
When using a different shape, it works.
#343
Posted 19 January 2011 - 03:06 PM
#344
Posted 19 January 2011 - 03:20 PM
Can someone help me with this problem?
Sorry- I'm out of town right now for an undefined amount of time. I'll help you when I can!
#345
Posted 26 January 2011 - 11:31 AM
#346
Posted 28 January 2011 - 02:02 AM
Hm... having some problems with the convex meshes. It gives me an unexpected error when running the game. Heres the code:
model=create_from_obj('./models/alfaromeo159/alfaromeo159.obj',0,0,1); texture=background_get_texture(tex_car); shape = GmnCreateConvexHull(global.world,0,0,0,0); GmnModelBufferLoadMod('models/alfaromeo159/alfaromeo159.d3d',1); GmnModelBufferClear(); GmnReleaseCollision(global.world,shape); body = GmnCreateBody(global.world,shape); GmnBodySetAutoMassMatrix(body,1,true); GmnBodyLinkObject(body,id,true); z=0; xrot=0; yrot=0; zrot=0;
When using a different shape, it works.
Sorry for my delayed response - I'm still out of town, but have now had an opportunity to look at your code. Although I am unable to test it, I believe that the issue lies in this segment:
GmnReleaseCollision(global.world,shape);
body = GmnCreateBody(global.world,shape);
If you just swap those two lines, so that the shape is assigned to the body before it is released, I believe things will start working for you!
If this does not solve the issue, please let me know and I am willing to look at a gmk or whatnot to help you further.
-hanson
#347
Posted 11 April 2011 - 01:54 PM
When doubling the timestep in GmnUpdate(), the physics acts twice as fast, as though it was fast-forwarded. This can be fixed by simply halving the gravity using GmnSetGravity(), right? And if you don't specify the gravity using GmnSetGravity(), what will be the default gravity value?
Thanks!
#348
Posted 15 April 2011 - 03:13 AM
-9.8 * 16
I can't recall at the moment why I *16 - maybe I was developing with the idea that 16 gm units = 1m. I might change that to default correctly to -9.8 next update, which is in process.
#349
Posted 15 April 2011 - 06:20 AM
#350
Posted 25 April 2011 - 12:03 AM
I'm basically copying the code from the example (with an FPS perspective, however), but I can't get anything to move. Here is my setup code:
GmnInit(); globalvar world; world = GmnCreate(); //GmnSetWorldSize(world,-640,-640,-640,640,640,640); GmnSetGravity(0,0,-9.8); instance_create(0,0,obj_player); instance_create(0,0,obj_floor);And my body-creating code is basically the same as in the example.
I'm using GM8.1.
#351
Posted 25 April 2011 - 02:58 AM
x=GmnBodyGetPosition(body,0); y=GmnBodyGetPosition(body,1); z=GmnBodyGetPosition(body,2); xrot=GmnBodyGetRotation(body,0); yrot=GmnBodyGetRotation(body,1); zrot=GmnBodyGetRotation(body,2);
The auto-updating was the fastest, but this should work until the compatibility issue is resolved.
Sorry for the inconvenience!
-hanson
#352
Posted 25 April 2011 - 03:38 AM
Ah, thanks.Because the upgrade to GM 8.1 is incompatible with the version of GMAPI that GMNewton is currently using, the auto-update functions are broken when in use with GM 8.1. You can either use GM 8 or lower, wait until GMNewton is updated, or use the following(or something similar) in the step event of each object you want to update, and disable auto-updating:
<snip code>
The auto-updating was the fastest, but this should work until the compatibility issue is resolved.
Sorry for the inconvenience!
-hanson
#353
Posted 03 May 2011 - 01:20 AM
I'm making an FPS with this, and I have everything except good movement. I'm using GmnBodyAddImpulse() to add in the direction of the camera and 90 degrees off (forward-backward, strafe). I have friction between the player and the other stuff to slow me down as well. The problem is that sometimes the player walks slightly off from the camera direction (and perpendicular to it), like he's lagging in turning.
Will using a CustomPlayerController help? I've not got one to work before...
#354
Posted 11 May 2011 - 02:49 PM
This has to be a legal bump...
I'm making an FPS with this, and I have everything except good movement. I'm using GmnBodyAddImpulse() to add in the direction of the camera and 90 degrees off (forward-backward, strafe). I have friction between the player and the other stuff to slow me down as well. The problem is that sometimes the player walks slightly off from the camera direction (and perpendicular to it), like he's lagging in turning.
Will using a CustomPlayerController help? I've not got one to work before...
The CustomPlayerController might help with that, or using GmnBodySetVelocity instead of the impulses.
#355
Posted 26 May 2011 - 03:47 AM
#356
Posted 26 May 2011 - 03:58 AM
#357
Posted 26 May 2011 - 04:46 AM
#358
Posted 03 July 2011 - 12:22 AM
#359
Posted 24 July 2011 - 11:30 PM
gmi_update_body
gmi_set_script_transform_body
gmi_init
I feel like gmi_init is important, but is this part also important?
nf("set_script_transform_body",1);
gmi_set_script_transform_body(gmi_update_body);
#360
Posted 02 August 2011 - 06:18 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users









