Vehicle Wrapper -- Blender 3D Game Engine



pageok


 
1.  Add CarSetup.py to the Text Editor

Note:
If you downloaded the starting blend, you can find CarSetup248.txt and CarSetup249.txt in the Text Editor.  

Download:

Text Editor menu >> Text >> Open
Rename CarSetup.txt to CarSetup.py

 

2.  CarSetup.py ---  Tire Names  (Line Numbers:  83 - 106)

Note:
The name of your tires.  I named my tires Tire_FD, Tire_FP, Tire_RD and Tire_RP


##########################   Tire names

def Tire_Objects():
   
    # tire names
    frontDriver          = "Tire_FD"  # front driver's tire
    frontPassenger  = "Tire_FP"   # front passenger's tire
    rearDriver           = "Tire_RD"  # rear driver's tire
    rearPassenger   = "Tire_RP"  # rear passenger's tire
   
    # get current scene
    scene = GameLogic.getCurrentScene()
   
    # get list of objects in scene
    objList = scene.objects

    # tire Name
    tire_0 = objList["OB" + frontDriver]           # front driver's tire
    tire_1 = objList["OB" + frontPassenger]   # front passenger's tire
    tire_2 = objList["OB" + rearDriver]           # rear driver's tire
    tire_3 = objList["OB" + rearPassenger]   # rear passenger's tire

    return (tire_0, tire_1, tire_2, tire_3)

 

3.  CarSetup.py ---  Tire Positions  (Line Numbers:  107 - 118)

Note:
The position of your tires.  The distance of each tire from the object center of the car.
Type:  Blender Units
  [ X-axis distance, Y-axis distance, Z-axis distance]


##########################   Tire positions

def Tire_Positions():

    # tire position
    tire_0_Pos = [ -2.0,   3.0,  0.0]  # front driver's tire
    tire_1_Pos = [  2.0,   3.0,  0.0]  # front passenger's tire
    tire_2_Pos = [ -2.0,  -3.0,  0.0]  # rear driver's tire
    tire_3_Pos = [  2.0,  -3.0,  0.0]  # rear passenger's tire
   
    return (tire_0_Pos, tire_1_Pos, tire_2_Pos, tire_3_Pos)

 

  
pageok