Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 10 of 16 1 2 8 9 10 11 12 15 16
Re: newton [Re: VeT] #113131
11/18/07 13:04
11/18/07 13:04
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
i dont know, what it was, but now it's working


NewtonJoint* upVector;
upVector = NewtonConstraintCreateUpVector (nworld, vectorf(0,0,QUANTTOMETER) , MH.NewtonChar);


what about rotating upvector in litec?
how can i get and set point?
NewtonUpVectorGetPin(FF.upVector,temp_vec2); always returns error
any ideas?

Last edited by VeT; 11/18/07 19:18.

1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113132
11/20/07 18:35
11/20/07 18:35
Joined: Oct 2006
Posts: 36
BigM Offline
Newbie
BigM  Offline
Newbie

Joined: Oct 2006
Posts: 36
Hey, look what I found out!
http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Board=AUM&Number=791033

Way to go ventilator!

Cheers!

Re: newton [Re: ventilator] #113133
11/27/07 17:38
11/27/07 17:38
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline
User
sheefo  Offline
User

Joined: Jul 2006
Posts: 783
London, UK
Has anyone used 'NewtonAddBodyImpulse' yet?

Can someone show me how to use it?

Re: newton [Re: sheefo] #113134
11/27/07 22:38
11/27/07 22:38
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113135
12/22/07 15:20
12/22/07 15:20
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Thank you very much for the efforts to get Newton working with Lite-C, ventilator . It is just awsome.

I have some problems with the collision and you wrote that it should help to turn the continious collision on. But I can´t find something like that?
So, how to do that?

Thanks a lot!


Edit: I found out how to do it but it doesn´t help with my problems...
I have a problem with an Object pushing an other through a wall.
Any Ideas on how to solve that?

Last edited by Slin; 12/22/07 16:06.
Re: newton [Re: Slin] #113136
12/29/07 14:45
12/29/07 14:45
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
how does the object get pushed through the wall? maybe you wrongly build up extreme forces (for example by setting the velocity each frame)?

...
did you get NewtonAddBodyImpulse() working now?

...
btw. i think the new newton version isn't that far away anymore. it will be great. it will be much faster (stacking hundreds of bodies won't be a problem anymore) and there will be new stuff like an easier to use vehicle joint and character controller.

Re: newton [Re: ventilator] #113137
12/29/07 15:29
12/29/07 15:29
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:

how does the object get pushed through the wall? maybe you wrongly build up extreme forces (for example by setting the velocity each frame)?




If I throw an object on the book or on the plate, they get pushed through the table.
This is the function for throwing:
Code:

void DebugThrow(char* FileName)
{
NewtonBody *body;
ENTITY* Temp_ent = 0;

while(1)
{
while(!mouse_left){wait(1);}

if(Temp_ent)
{
NewtonDestroyBody(nworld, body);
ent_remove(Temp_ent);
Temp_ent = NULL;
}

Temp_ent = ent_create(FileName,camera.x,NULL);
vec_scale(Temp_ent.scale_x,0.3);
body = newton_addentity(Temp_ent, 3, NEWTON_BOX, onforceandtorque);
VECTOR v;
vec_set(v, vector(20, 0, 0));
vec_rotate(v,camera.pan);
NewtonBodySetVelocity(body, vectorf(v.x,v.y,v.z));

while(mouse_left){wait(1);}
wait(1);
}
}


onforceandtorque is the same function you used in your example.

This is he scene where I use newton:


Quote:


btw. i think the new newton version isn't that far away anymore. it will be great. it will be much faster (stacking hundreds of bodies won't be a problem anymore) and there will be new stuff like an easier to use vehicle joint and character controller.



That sounds awsome! That should be a good reason to visit their webpage a bit more often The clips I remember were great

Thanks for your time and help

Last edited by Slin; 12/29/07 15:30.
Re: newton [Re: Slin] #113138
01/26/08 16:45
01/26/08 16:45
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
no, i still dont get Impulse to work

could you give me exapmle?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: newton [Re: VeT] #113139
01/30/08 21:05
01/30/08 21:05
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hi here..
i just tried to get newton involved, but of course i failed. i tried to adapth the code from the litecnewton demo but the engine crashes as soon as i try to create a physics entity

this is how i start the code
Code:

#include <acknex.h>
#include <default.c>
#include <d3d9.h>

// newton works with meters!
// 1 meter = 32 quants
float QUANTTOMETER = 0.03125;
float METERTOQUANT = 32;

#include "newton.h"
#include "matrix.c"
#include "newton_main.c"
#include "newton_debug.c"

void onforceandtorque(NewtonBody* body)
{
float mass, ixx, iyy, izz;
NewtonBodyGetMassMatrix(body, &mass, &ixx, &iyy, &izz);
NewtonBodySetForce(body, vectorf(0, 0, -9.8 * mass));
}



this is the code for the entity to be created:
Code:

void erdbeere()
{
my.pan = random(360);
my.tilt = random(60)-30;
my.roll = random(60)-30;
c_updatehull(me,0);
set(my,POLYGON|FLAG2);
while(my.z>-50)
{
wait(1);
}
ent_remove(me);
}



this is how i create the entity:
Code:

you = ent_create("erdbeere.mdl",vector(my.x,my.y,900),kugel);
NewtonBody *body = newton_addentity(you, 10, "convex hull", onforceandtorque); // register entity as physics entity
NewtonBodySetVelocity(body, vectorf(0,0,-100));



and in the main function i have this, which creates a grid of floorparts and starts newton.
Code:

var i,j;
for (i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
you = ent_create("ground_box.mdl",vector(128*(i-5)+64,128*(j-5)+64,0),checkField);
you->flags |= FLAG8;
}
}

newton_start();
on_close = quit;



as soon as i call the entity creating function the engine crashes. any ideas whats my fault here?

Re: newton [Re: ello] #113140
01/30/08 21:13
01/30/08 21:13
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
i think it happens because you pass a string as collision type. the function needs an integer (use the NEWTON_CONVEXHULL define).

it's a bit annoying that lite-c doesn't give more useful error messages in such cases.



Quote:

no, i still dont get Impulse to work

could you give me exapmle?




Code:
void create_sphere()
{
you = ent_create("ball.mdl", vector(100, 100, 200), NULL);
NewtonBody *body = newton_addentity(you, 10, NEWTON_SPHERE, 0);
NewtonAddBodyImpulse(body, vectorf(0, 0, 10), vectorf(you.x * QUANTTOMETER, you.y * QUANTTOMETER, you.z * QUANTTOMETER));
}

void create_sphere_startup()
{
on_p = create_sphere;
}

this works for me. maybe you forgot to add the QUANTTOMETER conversion (i first forgot this when i wrote this example)?

the first vector is the wanted change in velocity, the second vector is the point in global space where the impulse should be applied.

Page 10 of 16 1 2 8 9 10 11 12 15 16

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1