vec_to_mesh (vector, entity, number);
Vec_to_mesh
deforms a model or terrain mesh by setting a given mesh vertex to the
coordinates of the given vector.Parameters:
vector |
new mesh coordinates |
entity |
model or terrain entity pointer |
number |
number of vertex to be modified |
Remarks:
- The current frame of the model or terrain entity will deformed. The mesh is
deformed not only on this entity, but on all models or terrains that share the
same MDL or HMP file.
- Mesh deformations are not saved by game_save instructions or
on exiting the game.
- After deforming a mesh, it may be necessary to adapt the model's
bounding box (entity.min_x...entity.max_z) for the collision detection,
especially in the case of terrain meshes.
- After deforming a mesh, the gouraud shading can be adapted to the new
shape by the ent_fixnormals instruction.
Speed:
FastExample:
function dent(ent,num)
{
vec_for_mesh(temp,ent,num);
vec_scale(temp,0.9);
vec_to_mesh(temp,ent,num);
}
See also:
ent_vertices,
vec_for_vertex, vec_for_normal,
vec_for_mesh, vec_for_min,
vec_for_max, min_x, max_x,
ent_fixnormals.