Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Car problem i go NUTS!! #49915
07/22/05 21:30
07/22/05 21:30
Joined: Jul 2005
Posts: 34
M
Matan_Golan1 Offline OP
Newbie
Matan_Golan1  Offline OP
Newbie
M

Joined: Jul 2005
Posts: 34
Hi,
yesterday i was testing the Phyiscs Engine, i read the help file and practice it and i just want to see how its really work for cars.
so i took the car and tires from Newton Engine because i dont have other models and i was try to make stuff work and this thing drive me crazy!!!

i have two main problems:

1) Wheels problems like in this picture:



2) i have motoraized my wheels and when the wheel is spinning there is no friction and the body dont move....
here is my code:
Code:
 


//Physics demo test
//Non-Public
//Writed by Matan Golan

//Starting Var's:
string level_str = <test.WMB>;
var video_mode = 8;
var video_screen = 2;
var d3d_lightres = on;

//Panel Fonts:
font digit_font = "arial",1,20;

//Information Panel:
panel video_memory
{
pos_x = 0; pos_y = 0;
digits = 0, 0, 5, digit_font, 1,d3d_texskins; //Level models
digits = 0,20, 5, digit_font, 1,d3d_texsurfs; //Surface
digits = 0,40, 5, digit_font, 1,d3d_texsmaps; //shadows
digits = 0,60, 5, digit_font, 1,d3d_texbmaps; //bmaps
flags = VISIBLE;
}

//Vars:
var bodymass = 800;
var tiremass = 30;
var gravity[3] = 0,0,-10;
entity* cbody;
entity* ctire;
entity* floor;
var conID;

function main_quit()
{
exit;
}


function camera_control()
{
var force[3];
while(1)
{
if(!mouse_right)
{
camera.pan-=20*mouse_force.x*time;
camera.tilt+=20*mouse_force.y*time;
}

vec_set(force,nullvector);
if(key_a)
{
force.x-=1;
}
if(key_d)
{
force.x+=1;
}
if(key_w)
{
force.y+=1;
}
if(key_s)
{
force.y-=1;
}

if(key_a & key_shift)
{
force.x-=3;
}
if(key_d & key_shift)
{
force.x+=3;
}
if(key_w & key_shift)
{
force.y+=3;
}
if(key_s & key_shift)
{
force.y-=3;
}

camera.x+=20*cos(camera.pan)*cos(camera.tilt)*force.y*time;
camera.y+=20*sin(camera.pan)*cos(camera.tilt)*force.y*time;
camera.z+=20*sin(camera.tilt)*force.y*time;
camera.x-=20*cos(camera.pan+90)*force.x*time;
camera.y-=20*sin(camera.pan+90)*force.x*time;
wait(1);
}
}

function setcon()
{
conID = phcon_add(ph_wheel,cbody,ctire);
phcon_getposition(conID, temp);
vec_set(cbody.x, temp);
//phcon_setmotor(conID,vector(10, 50,0),nullvector,nullvector);
phcon_setparams1 (conID, ctire.x, vector(0,0,1), vector(1,0,0));
phcon_setparams2 (conID, vector(-45, 90, 0) ,nullvector,vector(90000,100,0));



while(1)
{
if(key_k)
{
phcon_setmotor(conID,nullvector,vector(50, 50,0),nullvector);
}


wait(1);
}
}



Action Body
{
cbody = my;
phent_settype(cbody,ph_rigid,ph_poly);
phent_setmass(cbody,bodymass,ph_box);
phent_setdamping(cbody,20,20);
phent_setfriction(cbody,40);
}

Action Tire
{
ctire = my;
phent_settype(ctire,ph_rigid,PH_CYLINDER);
phent_setmass(ctire,tiremass,ph_sphere);
phent_setdamping(ctire,50,50);
phent_setfriction(ctire,40);
setcon();
}

//Main Starting Function:
function main()
{
level_load(level_str);
wait(3);
clip_size = 1;
d3d_anisotropy = 5;
d3d_mipmapping = 3;
d3d_shadowdepth = 24;

camera_control(); // get camera control by WASD
//All engine pre-setes are defined
//Call further function here:
ph_setgravity(gravity);
}


on_F9 = _sshot;



Re: Car problem i go NUTS!! [Re: Matan_Golan1] #49916
07/22/05 22:39
07/22/05 22:39
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline
Serious User
FoxZero  Offline
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
Dude you're gonna get flamed because there is no [Newton] in your post title. I have various problems like this. Can't help sorry , I wish I could. Just be prepared for Newton haters!!


Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Re: Car problem i go NUTS!! [Re: FoxZero] #49917
07/22/05 23:02
07/22/05 23:02
Joined: Jul 2005
Posts: 34
M
Matan_Golan1 Offline OP
Newbie
Matan_Golan1  Offline OP
Newbie
M

Joined: Jul 2005
Posts: 34
I didnt use Newton Phyiscs i just use thier car model...

tnx any way

Re: Car problem i go NUTS!! [Re: Matan_Golan1] #49918
07/23/05 05:23
07/23/05 05:23
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Easy part first. Raise the position of the car and let it fall to the ground. Otherwise it may be starting in the ground.

If that doesn't work then download the source from the buggy game on the download page and go from there.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!

Moderated by  HeelX, Spirit 

Gamestudio download | 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