1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: newton
[Re: ventilator]
#206621
05/14/08 17:40
05/14/08 17:40
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
aah, finally. thanks ventilator for your patience.
do you still intend to create a small car example with Newton?
Last edited by cerberi_croman; 05/14/08 17:50.
Ubi bene, ibi Patria.
|
|
|
Re: newton
[Re: HoopyDerFrood]
#215184
07/09/08 16:48
07/09/08 16:48
|
Joined: Jun 2008
Posts: 8 Turkiye
LaQroix
Newbie
|
Newbie
Joined: Jun 2008
Posts: 8
Turkiye
|
Firstly thanx a lot for this great plug-in ventilator. It really works perfect. Also i wonder if someone succeeded to make a workin car physics. I tried doin somethng but thre is a problem about the tire pin. Also suspensions are like wood blocks. If someone knows how to fix these i will be real glad. Tnx..
action Newton_Car()
{
while(!newton_running){wait(1);}
wait(1);
NewtonBody* car_body=newton_addentity(me, 200, 2, 2, onforceandtorque);
D3DXMATRIX upside;
D3DXMatrixTranslation(&upside, 0.0, 0.0, 1.0);
NewtonJoint* car_joint = NewtonConstraintCreateVehicle(nworld, &upside, car_body);
//NewtonVehicleSetTireCallback(car_joint, tireUpdate);
int tireMass;
float wheelradius;
tireMass = 20;
wheelradius = 0.5;
D3DXMATRIX tire_offset;
const float tirePin[3];
tirePin[0]=0.0;
tirePin[1]=0.0;
tirePin[2]=1.0;
//front left
D3DXMatrixTranslation(&tire_offset, 40.0 * QUANTTOMETER,
-65.0 * QUANTTOMETER,
-50.0 * QUANTTOMETER);
NewtonVehicleAddTire(car_joint, &tire_offset, tirePin, tireMass, wheelradius, wheelradius, 300,2000,1.5, NULL, 0);
//front right
D3DXMatrixTranslation(&tire_offset, -40.0 * QUANTTOMETER,
-65.0 * QUANTTOMETER,
-50.0 * QUANTTOMETER);
NewtonVehicleAddTire(car_joint, &tire_offset, tirePin, tireMass, wheelradius, wheelradius, 300,2000,1.5, NULL, 1);
//back left
D3DXMatrixTranslation(&tire_offset, 40.0 * QUANTTOMETER,
65.0 * QUANTTOMETER,
-50.0 * QUANTTOMETER);
NewtonVehicleAddTire(car_joint, &tire_offset, tirePin, tireMass, wheelradius, wheelradius, 300,2000,1.5, NULL, 2);
//back right
D3DXMatrixTranslation(&tire_offset, -40.0 * QUANTTOMETER,
65.0 * QUANTTOMETER,
-50.0 * QUANTTOMETER);
NewtonVehicleAddTire(car_joint, &tire_offset, tirePin, tireMass, wheelradius, wheelradius, 3,20000,1.5, NULL, 3);
}
P.S: the 4th parameter at ventilators newton_addentity function defines the newton material for the entity, it aint no mistake
Last edited by LaQroix; 07/09/08 16:51.
|
|
|
Re: newton
[Re: LaQroix]
#217499
07/23/08 13:06
07/23/08 13:06
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
hi, can anyone help me please with this code? i was wondering why this isn't working?
while(1)
{
if(key_e)
{
NewtonBodySetVelocity((NewtonBody*)mouse_ent->skill99,vectorf(-200,200,200));
}
wait(1);
} and this works:
while(1)
{
if(key_e)
{
ent_remove(mouse_ent);
NewtonDestroyBody(nworld,(NewtonBody*)mouse_ent->skill99);
}
wait(1);
} under skill99 i have:
action blockAct()
{
var panBlock;
c_setminmax(me);
set(my, PASSABLE | INVISIBLE);
panBlock = my.pan;
wait(3);
you = ent_create("aim.mdl", vector(my.x, my.y, my.z), NULL);
ent_remove(my);
wait(3);
my = you;
c_setminmax(me);
my.skill99 = handle(my);
my.pan = panBlock;
wait(3);
NewtonBody *body = newton_addentity(my, 10, NEWTON_BOX, onforceandtorque);
}
Ubi bene, ibi Patria.
|
|
|
Re: newton
[Re: croman]
#217507
07/23/08 14:01
07/23/08 14:01
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
i think i found the problem. when newton entity stops moving it kinda disables herself, why? and after it stops moving i cant apply any force to it.
how can i solve that?
Ubi bene, ibi Patria.
|
|
|
Re: newton
[Re: hemahoney]
#217640
07/24/08 08:05
07/24/08 08:05
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
this is definitely the WRONG FORUM for that kind of question.
Ubi bene, ibi Patria.
|
|
|
|