how to change initial location of vehicle in vehicle demo

razer
Posts: 82
Joined: Sun Apr 04, 2010 10:08 pm

how to change initial location of vehicle in vehicle demo

Post by razer »

I wish to change initial position for vehicle in VehicleDemo

I have changed

tr.setOrigin(btVector3(0,0.f,0));
to
tr.setOrigin(btVector3(10000,10000.f,100000));


Vehicle appears at same position on the ground.

Code: Select all

	compound->addChildShape(localTrans,chassisShape);

	tr.setOrigin(btVector3(10000,10000.f,100000)); // must move vehicle out of space

	m_carChassis = localCreateRigidBody(800,tr,compound);//chassisShape);
	//m_carChassis->setDamping(0.2,0.2);

May be btRaycastVehicle overrides it some where but I can't find where.

Thanks.
Nptn
Posts: 2
Joined: Thu Jun 24, 2010 12:04 pm

Re: how to change initial location of vehicle in vehicle dem

Post by Nptn »

+1.

Same to me.
mi076
Posts: 144
Joined: Fri Aug 01, 2008 6:36 am
Location: Bonn, Germany

Re: how to change initial location of vehicle in vehicle dem

Post by mi076 »

void VehicleDemo::clientResetScene()
{
...
m_carChassis->setCenterOfMassTransform(btTransform::getIdentity());
...
}
Nptn
Posts: 2
Joined: Thu Jun 24, 2010 12:04 pm

Re: how to change initial location of vehicle in vehicle dem

Post by Nptn »

Thxs.

btTransform pos;
pos.setIdentity();
pos.setOrigin(btVector3(10.0f, 20.0f, 0.0f));
m_carChassis->setCenterOfMassTransform(pos);
razer
Posts: 82
Joined: Sun Apr 04, 2010 10:08 pm

Re: how to change initial location of vehicle in vehicle dem

Post by razer »

Thanks.