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
3 registered members (VoroneTZ, monk12, Quad), 829 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 17 of 41 1 2 15 16 17 18 19 40 41
Re: Newton 2 wrapper [Re: VeT] #250539
02/08/09 15:36
02/08/09 15:36
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
i tried with

car(200) wheels(20)
car(200) wheels(25)
car(200) wheels(50)
car(20) wheels(3)


3333333333
Re: Newton 2 wrapper [Re: Quad] #250551
02/08/09 18:28
02/08/09 18:28
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Hey VeT! Maybe you can make a PhysX wrapper wink

Re: Newton 2 wrapper [Re: Cowabanga] #250716
02/09/09 13:25
02/09/09 13:25
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
2 Quadraxas
i didnt worked with cars yet, but i think you can try to make wheel's mass larger than car body...

2 Cowabanga maybe))) but i like Newton more smile and somedoy worked on PhysX, as i remember smile


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 2 wrapper [Re: VeT] #250720
02/09/09 13:32
02/09/09 13:32
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Originally Posted By: VeT
2 Cowabanga maybe))) but i like Newton more smile and somedoy worked on PhysX, as i remember smile


Really? Who?

Re: Newton 2 wrapper [Re: Cowabanga] #250752
02/09/09 16:07
02/09/09 16:07
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

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 2 wrapper [Re: VeT] #250755
02/09/09 16:24
02/09/09 16:24
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Great! smile

Re: Newton 2 wrapper [Re: VeT] #250880
02/10/09 13:33
02/10/09 13:33
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Originally Posted By: VeT
2 Quadraxas
i didnt worked with cars yet, but i think you can try to make wheel's mass larger than car body...


car starts to fly when it touches the ground.



Last edited by Quadraxas; 02/10/09 13:33.

3333333333
Re: Newton 2 wrapper [Re: Quad] #251397
02/12/09 21:12
02/12/09 21:12
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
what? car is flying with wheel's mass larger than car?
very interesting indeed... can you show your code? i'd try to correct it and add to next version of wrapper(and add a speshial thanks for you:))


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 2 wrapper [Re: VeT] #251402
02/12/09 21:29
02/12/09 21:29
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Code:
ENTITY* car;
var camerapanmodifier = 0;
void tireUpdate(const NewtonJoint* vehicle)
{
	int tireId;
	float m[16];
	ENTITY* tireModel;
	for (tireId = NewtonVehicleGetFirstTireID (vehicle); tireId!=NULL; tireId = NewtonVehicleGetNextTireID (vehicle, tireId)) 
	{
		tireModel = NewtonVehicleGetTireUserData (vehicle, tireId);
		NewtonVehicleGetTireMatrix( vehicle,tireId, m);
		ent_setmatrix_rb(tireModel,m);
	}
}



action Visual_Car(){
	while(car!=NULL){
		vec_set(my.x,car.x);
		vec_set(my.pan,car.pan);
		wait(1);
	}
}

action Newton_Car()
{
	car = me;
	set(my,INVISIBLE);//hide the physical proxy

	while(!newton_running){wait(1);}
	
	NewtonBody* car_body=newton_addentity(me, 100, NEWTON_CONVEXHULL, onforceandtorque);
	NewtonBodySetAutoFreeze( car_body, 0);
	NewtonBodySetLinearDamping(car_body,0.03);
	ent_create("kasa1.mdl",nullvector,Visual_Car);//car model


	float upDirection[] = {0.0, 0.0, 1.0};
	NewtonJoint* car_joint = NewtonConstraintCreateVehicle(nworld, upDirection[0], car_body);
	NewtonVehicleSetTireCallback(car_joint, tireUpdate); 
	
	int tireMass = 10;
	float suspensionLength = 0.1;
	float suspensionSpring =3000.0;
	float suspensionShock = 10.0;
	float wheelradius = 0.5;
	float tirePin[] = {0.0, 1.0, 0.0};
	

	
	D3DXMATRIX tire_offset;
	VECTOR tirepos;
	
	
	vec_for_bone(tirepos,me,"osol");//f left
	vec_sub(tirepos,my.x);
	D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);												
	NewtonVehicleAddTire(car_joint, &tire_offset, tirePin[0], tireMass, wheelradius, wheelradius, suspensionShock,suspensionSpring,suspensionLength, ent_create("teker1.mdl",nullvector,NULL), 0);
	
	
	vec_for_bone(tirepos,me,"osag");//f right
	vec_sub(tirepos,my.x);
	D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);		
	NewtonVehicleAddTire(car_joint, &tire_offset, tirePin[0], tireMass, wheelradius, wheelradius, suspensionShock,suspensionSpring,suspensionLength, ent_create("teker1.mdl",nullvector,NULL), 1);
	
	vec_for_bone(tirepos,me,"asol");//r left
	vec_sub(tirepos,my.x);
	D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);		
	NewtonVehicleAddTire(car_joint, &tire_offset, tirePin[0], tireMass, wheelradius, wheelradius, suspensionShock,suspensionSpring,suspensionLength, ent_create("teker1.mdl",nullvector,NULL), 2);
	
	vec_for_bone(tirepos,me,"asag");//r left
	vec_sub(tirepos,my.x);
	D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);		
	NewtonVehicleAddTire(car_joint, &tire_offset, tirePin[0], tireMass, wheelradius, wheelradius, suspensionShock,suspensionSpring,suspensionLength, ent_create("teker1.mdl",nullvector,NULL), 3);
	
	
	while(1){
		wait(1);
		camera.pan = my.pan + camerapanmodifier;
		camerapanmodifier += mouse_force.x*time_step*10;
		camera.x = my.x - 700*cosv(camera.pan);
		camera.y = my.y - sinv(camera.pan)*700;
		camera.z = my.z + 200;
		camera.tilt =-15;
	}
}


my car setup (both works with your and ventilator's wrapper.both same result)

and this is the ent_create i use

ent_create("kasa1fiz.mdl",vector(100,0,350),Newton_Car);//create car

i use diffrent models for visual and physical models:
car,physics proxy and tire models:
http://rapidshare.com/files/197359812/carmodelparts.zip.html


3333333333
Re: Newton 2 wrapper [Re: Quad] #251994
02/15/09 21:37
02/15/09 21:37
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
okay, car is initiated in wrapper, now i'd look closer at it...


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
Page 17 of 41 1 2 15 16 17 18 19 40 41

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