Harry
Member
|
[Solved] Vehicle Wheels
Hello. I can't create and attach wheels to the car body. To start I used code from tutorial. In init game I created an actor and then put this code:
Wheel::Param wp; // wheel parameters
wheel[0].create(car,Matrix().setPos(Vec( 1,-0.5, 1.5)),wp); // left -front
and draw meshes on actors matrixes. But wheel aren't show (with Physics.draw on too).
When I delete this : .setPos(Vec( 1,-0.5, 1.5)) I saw only mesh. Wheel still didn't attach to mesh. What's wrong with this?
(This post was last modified: 02-14-2011 11:28 AM by Harry.)
|
|
11-20-2009 03:08 PM |
|
Esenthel
Administrator
|
RE: Vehicle Wheels
if the tutorial works, then you must have something wrong in your codes, you need to analyze them
|
|
11-20-2009 03:18 PM |
|
Harry
Member
|
RE: Vehicle Wheels
Ok. I repair the problem. And i've got question - is it possible to use actor from .obj file as car base? When I try to do this my code find good actor but wheels are made in another place (again Vec(0)).
Code:
Item.cpp
if(type2==ITEM_VEHICLE)
{
// create car wheels
Wheel::Param wp; // wheel parameters
wheel[0].create(actor,Matrix().setPos(Vec( 1,-0.6, 1.9)),wp); // left -front
(This post was last modified: 11-20-2009 07:35 PM by Harry.)
|
|
11-20-2009 07:35 PM |
|
Esenthel
Administrator
|
RE: Vehicle Wheels
check if Wheel::create () requires matrix in local or world space
|
|
11-20-2009 08:27 PM |
|
Harry
Member
|
RE: Vehicle Wheels
Ok I fixed this. Thanks a lot.
|
|
11-20-2009 09:09 PM |
|