Now I tryed to do this with newton, but it has the same problem.
Does somebody know how to script with the newton WrapperLitec (newton Wrapper2)?
Here is my try, what am I doing wrong?
///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
//#include <mtlFX.c>
#include <d3d9.h>
///////////////////////////////
float QUANTTOMETER = 0.03125;
float METERTOQUANT = 32;
///////////////////////////////////////////////////////////////
#include "NewtonMain2.18.c"
#include "NewtonAPI2.18.c"
///////////////////////////////////////////////////////////////
NewtonWorld* nworld;
///////////////////////////////////////////////////////////////
#include "matrix.c"
#include "newton_materials.c"
#include "newton_main.c"
#include "newton_debug.c"
///////////////////////////////////////////////////////////////
void quit()
{
newton_stop();
}
///////////////////////////////////////////////////////////////
VECTOR player_force;
///////////////////////////////////////////////////////////////
function main()
{
video_screen = 1;
video_mode = 8;
shadow_stencil = 1;
sound_vol = 100;
level_load("extrem1.wmb");
ent_createlayer("blood_gsmall+6.tga", SKY | CUBE | VISIBLE, 0);
handle = media_loop("1.mp3",NULL,50);
wait(2);
newton_start();
on_exit = quit;
while(1)
{
newton_update();
wait(1);
}
}
action ballplayer()
{
player = me;
wait(3);
newton_addentity(player, 5, NEWTON_SPHERE, onforceandtorque);
while (1)
{
player_force.x = 380 * time_step * (key_d - key_a);
player_force.y = 380 * time_step * (key_w - key_s);
player_force.z = 0;
phent_addtorqueglobal (player, player_force);
camera.x = player.x - 29;
camera.y = player.y;
camera.z = player.z + 15;
camera.tilt = -5;
wait (1);
}
}
action Brige()
{
my.push=100;
set(my,FLAG8);
reset(my,DYNAMIC);
wait(1);
c_setminmax(me);
}
action stone()
{
set(my,SHADOW);
my.material = mat_metal;
newton_addentity(me, 75, NEWTON_SPHERE, onforceandtorque);
}
///////////////////////////////////////////////////////////////