About Store Forum Documentation Contact



Post Reply 
[Solved] Vehicle Wheels
Author Message
Harry Offline
Member

Post: #1
[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
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
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
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #3
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
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Vehicle Wheels
check if Wheel::create () requires matrix in local or world space
11-20-2009 08:27 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #5
RE: Vehicle Wheels
Ok I fixed this. Thanks a lot.
11-20-2009 09:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply