Hi, i am using 3dgs commercial , i saw the code "knights_on_wheels" in the samples of the 3dgs
.................................................................................................................................................................
code:
#include <acknex.h>
#include <level.c> // add splash screen and terrain placement functions
#include <camera.c> // add a third person camera
#include <car.c> // add a car action
#include <car_props.c> // add a car speedometer
#define NUM_PLANTS 300
TEXT* txtHelp =
{
font = "Arial#15bi";
string("Cursor keys to control car");
string("Mouse wheel to zoom");
string("[Space] Brake | [H] Horn | [L] Kick toppled car");
string("[C] Toggle camera | [F1]..[F6] Camera modes");
flags = SHOW;
}
function quit() { sys_exit(NULL); }
action knight_on_wheels()
{
set(my,SHADOW);
// play with those parameters
my.car_maxSpeed = 80;
my.car_maxTorque = 350;
my.car_maxSteer = 30;
my.car_spsSpring = 150;
my.car_spsDamper = 30;
my.car_massOffset = -60;
my.car_frictionLatR = 150;
// wheel positions can be taken from the MED status line:
my.car_wheel_fx = 23.5;
my.car_wheel_rx = -26;
my.car_wheel_fy = 21;
my.car_wheel_ry = 21;
my.car_wheel_fz = -10;
my.car_wheel_rz = -11;
my.car_spsWay = 7; // suspension animation
car_player();
}
action plant()
{
set(my,SHADOW);
vec_scale(my.scale_x,0.4+random(0.4));
ent_terrain_place(my,level_ent,55,70);
my.z -= 10*my.scale_z;
my.pan = random(360);
my.tilt = random(30)-15;
pXent_settype(me,PH_RIGID,PH_CONVEX);
pXent_setsleep(my,1); // only wake up on collision
}
function main()
{
video_window(0,0,0,"PhysX Car Practice Level");
shadow_stencil = 3;
shadow_lod = 2;
d3d_antialias = 4; // Commercial Edition and above only
on_esc = quit;
physX_open();
level_loadsplash("terrain.hmp","logo_800.jpg",0);
terrain_fence(level_ent,150); // build a wall around the terrain
pXent_settype(level_ent,PH_STATIC,PH_POLY|PH_MODIFIED); // update the terrain collision shape
tcamera_height = 75;
sun_angle.tilt = 60;
ent_createlayer("skycube+6.dds",SKY|CUBE|SHOW,0);
ent_create("vehicle_1.mdl",terrain_pos(NULL,300,0,30),knight_on_wheels);
int i;
for (i=0; i < NUM_PLANTS; i++)
ent_create("cactus.mdl",NULL,plant);
}
.................................................................................................................................................................
what i want to ask, does anyone know how to change the code so that when the user press a key (ex. space bar) the car body will be moved from it is place to another place "specific".