Terrain is a single one and unchuncked.
But its createt not at nullposition, its 100 quants ahead
ENTITY* e = ent_create("terrain.hmp", vector(100,0,0),NULL);
now this code make the c_trace
if(mouse_right)
{
if(c_trace(from.x,to.x,IGNORE_PASSABLE|SCAN_TEXTURE)>0) // trace from camera into the world
{
if(HIT_TARGET)
{
if((hitx!=hit.x)||(hity!=hit.y)) // hitposition changed since the last frame?
{
// visualize the hitpoint
if(arrow!=NULL){arrow.lifespan=0;}
BMAP* bm = bmap_create("down.bmp");
arrow = ent_decal(you,bm,5,0);
vec_set(arrow.skill_x,normal.x);
// backup the actual hitposition
hitx=hit.x;
hity=hit.y;
// raise the vertex
vec_for_ent(hit.x,you); // change world - entity coords
var vertex_num = ent_nextvertex(you,hit.x);
CONTACT* c = ent_getvertex(you,NULL,vertex_num);
c.v.y += 1; // increase the vertex height
ent_setvertex(you,c,vertex_num); // update the mesh
}
}
}
}
this makes the very first shot hit the terrain at a certain point BUT the raised vertex is an other!
all the following shots raises the correct vertices and works like it should.
if I comment out the line
vec_for_ent(hit.x,you); // change world - entity coords
so I get the complete opposite behaivior.
The very first shot raises the correct vertex but all following traces raises diffrent vertices with an offset distance.