Public Member Functions
IVivace Class Referenceabstract

Public Member Functions

virtual size_t get_version_number ()=0
 
virtual int get_computation_type ()=0
 
virtual size_t pos_render_num ()=0
 
virtual size_t pos_physics_num ()=0
 
virtual size_t pos_render_num (size_t id_object)=0
 
virtual size_t pos_physics_num (size_t id_object)=0
 
virtual size_t face_render_num ()=0
 
virtual size_t face_physics_num ()=0
 
virtual size_t face_render_num (size_t id_object)=0
 
virtual size_t face_physics_num (size_t id_object)=0
 
virtual void set_gravity (Scalar x, Scalar y, Scalar z)=0
 
virtual void get_gravity (Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_wind (Scalar x, Scalar y, Scalar z)=0
 
virtual void get_wind (Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_air_friction (Scalar coef)=0
 
virtual Scalar get_air_friction ()=0
 
virtual void set_velocity_cap (float v_cap)=0
 
virtual Scalar get_velocity_cap ()=0
 
virtual Scalar get_invmass (size_t pi)=0
 
virtual void set_invmass (size_t pi, Scalar value)=0
 
virtual Scalar get_friction_kinetic (size_t pi)=0
 
virtual void set_friction_kinetic (size_t pi, Scalar value)=0
 
virtual Scalar get_friction_static (size_t pi)=0
 
virtual void set_friction_static (size_t pi, Scalar value)=0
 
virtual Scalar get_friction_kinetic_obj (size_t id_object, size_t pi)=0
 
virtual void set_friction_kinetic_obj (size_t id_object, size_t pi, Scalar value)=0
 
virtual Scalar get_friction_static_obj (size_t id_object, size_t pi)=0
 
virtual void set_friction_static_obj (size_t id_object, size_t pi, Scalar value)=0
 
virtual void set_friction_kinetic_obj_all (size_t id, Scalar value)=0
 
virtual void set_friction_static_obj_all (size_t id, Scalar value)=0
 
virtual void get_bounding_box (Scalar &min_x, Scalar &min_y, Scalar &min_z, Scalar &max_x, Scalar &max_y, Scalar &max_z)=0
 
virtual void get_bounding_box_obj (size_t id_object, Scalar &min_x, Scalar &min_y, Scalar &min_z, Scalar &max_x, Scalar &max_y, Scalar &max_z)=0
 
virtual void get_physics_pos (size_t i, Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void get_render_pos (size_t i, Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_physics_pos (size_t i, Scalar x, Scalar y, Scalar z)=0
 
virtual void get_render_nor (size_t i, Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_render_nor (size_t i, Scalar x, Scalar y, Scalar z)=0
 
virtual void get_physics_pos_obj (size_t id_object, size_t pi, Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_physics_pos_obj (size_t id_object, size_t pi, Scalar x, Scalar y, Scalar z)=0
 
virtual void get_render_nor_obj (size_t id_object, size_t id_vert, Scalar &x, Scalar &y, Scalar &z)=0
 
virtual void set_render_nor_obj (size_t id_object, size_t id_vert, Scalar x, Scalar y, Scalar z)=0
 
virtual Scalar * get_render_pos_pointer ()=0
 
virtual Scalar * get_render_col_pointer ()=0
 
virtual Scalar * get_render_nor_pointer ()=0
 
virtual int * get_render_face_pointer ()=0
 
virtual Scalar * get_physics_pos_pointer ()=0
 
virtual void get_neigh_particle_particle (size_t id_o, size_t id_p, int *out_array, size_t out_size)=0
 
virtual void get_neigh_particle_face (size_t id_o, size_t id_p, int *out_array, size_t out_size)=0
 
virtual Scalar get_invmass_obj (size_t id_object, size_t pi)=0
 
virtual void set_invmass_obj (size_t id_object, size_t pi, Scalar value)=0
 
virtual Scalar get_stiffness_obj (size_t id_object, ConstraintType ct)=0
 
virtual void set_stiffness_obj (size_t id_object, ConstraintType ct, Scalar value)=0
 
virtual size_t stiffness_num (ConstraintType ct)=0
 
virtual int * get_physics_face_pointer (size_t id_object)=0
 
virtual int * get_render_face_pointer (size_t id_object)=0
 
virtual size_t get_particle_index_from_face (size_t fi)=0
 
virtual size_t get_particle_index_from_face (size_t id_object, size_t fi)=0
 
virtual size_t num_objs ()=0
 
virtual bool is_enabled (size_t id)=0
 
virtual void set_solver_iterations (int num_iters)=0
 
virtual int get_solver_iterations ()=0
 
virtual void set_physics_iterations (int num_iters)=0
 
virtual int get_physics_iterations ()=0
 
virtual void Reset ()=0
 
virtual void Init ()=0
 
virtual void Update ()=0
 
virtual void Shutdown ()=0
 
virtual void Load (const char *filename)=0
 
virtual void Save (const char *filename)=0
 
virtual void ExportMeshToDisk (const char *mesh_filename)=0
 
virtual void LoadSimulationData (const char *filename)=0
 
virtual void SaveSimulationData (const char *filename)=0
 
virtual void LoadSerialized (const char *filename, Scalar **vert, unsigned int &vert_num, int **tri, unsigned int &idx_num, Scalar **distance_rest_values, unsigned int &distance_num, Scalar **bending_rest_values, unsigned int &bending_num)=0
 
virtual void SaveSerialized (const char *filename, size_t object_id)=0
 
virtual size_t add_obj_tri (Scalar *vert, size_t vert_size, int *tri, size_t tri_size)=0
 
virtual size_t add_obj_tri (Scalar *vert, size_t num_vert, int *tri, size_t num_tri, Scalar *rest_values_distance, size_t num_distance, Scalar *rest_values_bending, size_t num_bending)=0
 
virtual void add_serialized_objects ()=0
 
virtual size_t add_obj_tetra (const char *filename)=0
 
virtual size_t add_obj_mapped (Scalar *vert_r, size_t vert_size_r, int *tri_r, size_t tri_size_r, Scalar *vert_p, size_t vert_size_p, int *tri_p, size_t tri_size_p)=0
 
virtual size_t add_obj_patch (Scalar size_x, Scalar size_y, unsigned int res_x, unsigned int res_y)=0
 
virtual void new_obj_patch (Scalar size_x, Scalar size_y, unsigned int res_x, unsigned int res_y, Scalar **vert, unsigned int &vert_num, int **tri, unsigned int &tri_num)=0
 
virtual void del_obj (size_t id_object)=0
 
virtual void move_obj (size_t id_object, Scalar tra_x, Scalar tra_y, Scalar tra_z)=0
 
virtual void rotate_obj (size_t id_object, Scalar angle, Scalar axis_x, Scalar axis_y, Scalar axis_z)=0
 
virtual void scale_obj (size_t id_object, Scalar scale_x, Scalar scale_y, Scalar scale_z)=0
 
virtual void sew_objs (size_t id0, size_t id1, size_t *sew_array, size_t num, size_t priority=0)=0
 
virtual const char * coll_type (size_t id_coll)=0
 
virtual size_t colliders_num ()=0
 
virtual size_t add_coll_sdf (const char *path_to_sdf, const char *path_to_mesh, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_sdf (size_t id, float **pvert, int **pface, size_t &num_face_idx)=0
 
virtual size_t add_coll_self (Scalar mu_k, Scalar mu_s)=0
 
virtual void remove_overlapping_particles_from_self_coll (size_t id_coll)=0
 
virtual void enable_surface_sampling (size_t id_coll)=0
 
virtual size_t add_coll_sphere (Scalar radius, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_sphere (size_t id, Scalar &radius, Scalar &pos_x, Scalar &pos_y, Scalar &pos_z)=0
 
virtual void update_coll_sphere (size_t id, Scalar radius, Scalar c_x, Scalar c_y, Scalar c_z)=0
 
virtual size_t add_coll_plane (Scalar nor_x, Scalar nor_y, Scalar nor_z, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_plane (size_t id, Scalar &pos_x, Scalar &pos_y, Scalar &pos_z, Scalar &nor_x, Scalar &nor_y, Scalar &nor_z)=0
 
virtual size_t add_coll_capsule (Scalar radius0, Scalar radius1, Scalar p0_x, Scalar p0_y, Scalar p0_z, Scalar p1_x, Scalar p1_y, Scalar p1_z, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_capsule (size_t id, Scalar &radius0, Scalar &radius1, Scalar &p0_x, Scalar &p0_y, Scalar &p0_z, Scalar &p1_x, Scalar &p1_y, Scalar &p1_z)=0
 
virtual void update_coll_capsule (size_t id, Scalar radius0, Scalar radius1, Scalar p0_x, Scalar p0_y, Scalar p0_z, Scalar p1_x, Scalar p1_y, Scalar p1_z)=0
 
virtual size_t add_coll_box (Scalar bb_min_x, Scalar bb_min_y, Scalar bb_min_z, Scalar bb_max_x, Scalar bb_max_y, Scalar bb_max_z, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_box (size_t id, Scalar &bb_min_x, Scalar &bb_min_y, Scalar &bb_min_z, Scalar &bb_max_x, Scalar &bb_max_y, Scalar &bb_max_z)=0
 
virtual size_t add_coll_obbox (Scalar cx, Scalar cy, Scalar cz, Scalar x_x, Scalar x_y, Scalar x_z, Scalar y_x, Scalar y_y, Scalar y_z, Scalar z_x, Scalar z_y, Scalar z_z, Scalar ex, Scalar ey, Scalar ez, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_obbox (size_t id, Scalar &cx, Scalar &cy, Scalar &cz, Scalar &x_x, Scalar &x_y, Scalar &x_z, Scalar &y_x, Scalar &y_y, Scalar &y_z, Scalar &z_x, Scalar &z_y, Scalar &z_z, Scalar &ex, Scalar &ey, Scalar &ez)=0
 
virtual size_t add_coll_mesh (Scalar *vert_pos, Scalar *vert_norm, size_t vert_size, int *tri, size_t tri_size, Scalar bias, Scalar mu_k, Scalar mu_s)=0
 
virtual size_t add_coll_mesh_remeshed (const Scalar *vert_pos, const Scalar *vert_norm, const size_t vert_size, const int *tri, const size_t tri_size, size_t num_remeshed_vertices, Scalar bias, Scalar mu_k, Scalar mu_s)=0
 
virtual void get_coll_mesh (size_t id, Scalar **vert, unsigned int &vert_num, int **tri, unsigned int &tri_num)=0
 
virtual void update_coll_mesh (size_t id, Scalar *vert, Scalar *norm)=0
 
virtual void move_coll (size_t id, Scalar x, Scalar y, Scalar z)=0
 
virtual void rotate_coll (size_t id, Scalar angle, Scalar axis_x, Scalar axis_y, Scalar axis_z, Scalar c_rot_x, Scalar c_rot_y, Scalar c_rot_z)=0
 
virtual void anchor_to_coll (size_t id_object, size_t id_coll)=0
 
virtual void set_coll_enabled (size_t id_coll, bool b)=0
 
virtual void set_coll_sticky (size_t id_coll, bool b)=0
 
virtual void get_surface_particles (size_t id, std::vector< Vector3x > &particle_positions, float &radius)=0
 
virtual void set_log_reporting_lever (unsigned int level)=0
 
virtual void init_VBO (unsigned int *vbo, unsigned int *vbo_col)=0
 
virtual void copy_to_cpu ()=0
 

Member Function Documentation

◆ add_coll_box()

virtual size_t IVivace::add_coll_box ( Scalar  bb_min_x,
Scalar  bb_min_y,
Scalar  bb_min_z,
Scalar  bb_max_x,
Scalar  bb_max_y,
Scalar  bb_max_z,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a box collider to the simulation. This box is axis aligned.

Parameters
bb_min_xx-position of the minimal point in the box (< bb_max_x)
bb_min_yy-position of the minimal point in the box (< bb_max_y)
bb_min_zz-position of the minimal point in the box (< bb_max_z)
bb_max_xx-position of the maximal point in the box (> bb_min_x)
bb_max_yy-position of the maximal point in the box (> bb_min_y)
bb_max_zz-position of the maximal point in the box (> bb_min_z)
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_capsule()

virtual size_t IVivace::add_coll_capsule ( Scalar  radius0,
Scalar  radius1,
Scalar  p0_x,
Scalar  p0_y,
Scalar  p0_z,
Scalar  p1_x,
Scalar  p1_y,
Scalar  p1_z,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a capsule collider to the simulation.

Parameters
radius0radius of p0 (> 0)
radius1radius of p1 (> 0)
p0_xx-position of p0
p0_yy-position of p0
p0_zz-position of p0
p1_xx-position of p1
p1_yy-position of p1
p1_zz-position of p1
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_mesh()

virtual size_t IVivace::add_coll_mesh ( Scalar *  vert_pos,
Scalar *  vert_norm,
size_t  vert_size,
int *  tri,
size_t  tri_size,
Scalar  bias,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a mesh collider to the simulation, using the vertices and triangles provided.

Parameters
vertlist of collision vertices
vert_sizenumber of elements in the collision vertex list
trilist of collision triangle indices
tri_sizenumber of elements in the collision triangle list
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_mesh_remeshed()

virtual size_t IVivace::add_coll_mesh_remeshed ( const Scalar *  vert_pos,
const Scalar *  vert_norm,
const size_t  vert_size,
const int *  tri,
const size_t  tri_size,
size_t  num_remeshed_vertices,
Scalar  bias,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a mesh collider to the simulation that remeshes the surface provided by the input vertices and triangles.

Parameters
vertlist of collision vertices
vert_sizenumber of elements in the vertex list
trilist of collision triangle indices
tri_sizenumber of elements in the triangle list
num_remeshed_verticesnumber of vertices in the remeshed surface
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_obbox()

virtual size_t IVivace::add_coll_obbox ( Scalar  cx,
Scalar  cy,
Scalar  cz,
Scalar  x_x,
Scalar  x_y,
Scalar  x_z,
Scalar  y_x,
Scalar  y_y,
Scalar  y_z,
Scalar  z_x,
Scalar  z_y,
Scalar  z_z,
Scalar  ex,
Scalar  ey,
Scalar  ez,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a box collider to the simulation. This box is object oriented.

Parameters
cxx-position of the box center
cyy-position of the box center
czz-position of the box center
x_xx-value of the x-axis
x_yy-value of the x-axis
x_zz-value of the x-axis
y_xx-value of the y-axis
y_yy-value of the y-axis
y_zz-value of the y-axis
z_xx-value of the z-axis
z_yy-value of the z-axis
z_zz-value of the z-axis
exhalf-extension along the x-axis (> 0)
eyhalf-extension along the y-axis (> 0)
ezhalf-extension along the z-axis (> 0)
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_plane()

virtual size_t IVivace::add_coll_plane ( Scalar  nor_x,
Scalar  nor_y,
Scalar  nor_z,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a plane collider to the simulation, at the origin.

Parameters
nor_xx-normal
nor_yy-normal
nor_zz-normal
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider id

◆ add_coll_sdf()

virtual size_t IVivace::add_coll_sdf ( const char *  path_to_sdf,
const char *  path_to_mesh,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Development]

◆ add_coll_self()

virtual size_t IVivace::add_coll_self ( Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Enables self-collisions

Parameters
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
collider index

◆ add_coll_sphere()

virtual size_t IVivace::add_coll_sphere ( Scalar  radius,
Scalar  mu_k,
Scalar  mu_s 
)
pure virtual

[Init]

Adds a sphere collider to the simulation.

Parameters
radiussphere-radius (> 0)
mu_kkinetic friction coefficient
mu_sstatic friction coefficient
Returns
the collider index

◆ add_obj_mapped()

virtual size_t IVivace::add_obj_mapped ( Scalar *  vert_r,
size_t  vert_size_r,
int *  tri_r,
size_t  tri_size_r,
Scalar *  vert_p,
size_t  vert_size_p,
int *  tri_p,
size_t  tri_size_p 
)
pure virtual

[Development] [Init]

Adds a deformable object to the simulation. Two meshes have to be provided - a render mesh and a physics mesh. The rendered mesh is then mapped to the physics mesh.

Parameters
vert_rlist of render vertices
vert_size_rnumber of elements in the render vertex list
tri_rlist of render triangle indices
tri_size_rnumber of elements in the render triangle list
vert_plist of physics vertices
vert_size_pnumber of elements in the physics vertex list
tri_plist of physics triangle indices
tri_size_pnumber of elements in the physics triangle list
Returns
the object index

◆ add_obj_patch()

virtual size_t IVivace::add_obj_patch ( Scalar  size_x,
Scalar  size_y,
unsigned int  res_x,
unsigned int  res_y 
)
pure virtual

[Init]

Adds a deformable object to the simulation. The object is created by the provided size and resolution of the patch. The resolution specifies how many particles the cloth should consist of.

The value of size and resolution should be choosen so that the triangles are uniform to achieve the best results.

Example: { size_x: 1, size_y: 2, res_x: 50, res_y: 100 }

Parameters
size_xsize in x
size_ysize in y
res_xresolution in x
res_yresolution in y
Returns
the object index

◆ add_obj_tetra()

virtual size_t IVivace::add_obj_tetra ( const char *  filename)
pure virtual

[Init]

Adds a deformable object to the simulation. The object is created by the tetrahedra mesh provided.

Parameters
filenamea string to the location of the tetramesh file
Returns
the object index

◆ add_obj_tri() [1/2]

virtual size_t IVivace::add_obj_tri ( Scalar *  vert,
size_t  vert_size,
int *  tri,
size_t  tri_size 
)
pure virtual

[Init]

Adds a deformable object to the simulation. The object is created by the vertices and triangles provided.

Parameters
vertlist of vertices
vert_sizenumber of elements in vertex list
trilist of triangle indices
tri_sizenumber of elements in triangle list
Returns
the object index

◆ add_obj_tri() [2/2]

virtual size_t IVivace::add_obj_tri ( Scalar *  vert,
size_t  num_vert,
int *  tri,
size_t  num_tri,
Scalar *  rest_values_distance,
size_t  num_distance,
Scalar *  rest_values_bending,
size_t  num_bending 
)
pure virtual

[Init]

Adds a deformable object to the simulation. The object is created by the vertices, triangles and constraint rest lengths provided.

Parameters
vertlist of vertices
vert_sizenumber of elements in vertex list
trilist of triangle indices
tri_sizenumber of elements in triangle list
rest_values_distancelist of distance rest values
num_distancenumber of elements in distance rest value list
rest_values_bendinglist of bending rest values
num_bendingnumber of elements in bending rest value list
Returns
the object index

◆ add_serialized_objects()

virtual void IVivace::add_serialized_objects ( )
pure virtual

[Init]

Adds a deformable object to the simulation. The object is created from a serialized object defined in the file passed to LoadSimulationData.

Returns
the object index

◆ anchor_to_coll()

virtual void IVivace::anchor_to_coll ( size_t  id_object,
size_t  id_coll 
)
pure virtual

Anchors all particles which are located inside the collider. These particles will follow the motion of the collider.

Parameters
id_objectobject index
id_collcollider index

◆ coll_type()

virtual const char* IVivace::coll_type ( size_t  id_coll)
pure virtual
Parameters
id_collcollider index
Returns
the collider type as a string

◆ colliders_num()

virtual size_t IVivace::colliders_num ( )
pure virtual
Returns
number of colliders

◆ del_obj()

virtual void IVivace::del_obj ( size_t  id_object)
pure virtual

[Runtime]

Deletes an object.

Parameters
object_idindex of the object to delete

◆ enable_surface_sampling()

virtual void IVivace::enable_surface_sampling ( size_t  id_coll)
pure virtual

[Init]

Enables the surface sampling of collision particles. If the surface sampling is enabled the self collision will be handled by the sampled particles instead of the physics particles.

Parameters
id_collcollider index

◆ ExportMeshToDisk()

virtual void IVivace::ExportMeshToDisk ( const char *  mesh_filename)
pure virtual

[Development][Development]

◆ face_physics_num() [1/2]

virtual size_t IVivace::face_physics_num ( )
pure virtual
Returns
number of physics face indices

◆ face_physics_num() [2/2]

virtual size_t IVivace::face_physics_num ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
number of physics face indices

◆ face_render_num() [1/2]

virtual size_t IVivace::face_render_num ( )
pure virtual
Returns
number of render face indices

◆ face_render_num() [2/2]

virtual size_t IVivace::face_render_num ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
number of render face indices

◆ get_air_friction()

virtual Scalar IVivace::get_air_friction ( )
pure virtual
Returns
the air friction coefficient

◆ get_bounding_box()

virtual void IVivace::get_bounding_box ( Scalar &  min_x,
Scalar &  min_y,
Scalar &  min_z,
Scalar &  max_x,
Scalar &  max_y,
Scalar &  max_z 
)
pure virtual

Retrieves the axis-aligned bounding box of the particle system

Parameters
[out]min_xminimum x-value
[out]min_yminimum y-value
[out]min_zminimum z-value
[out]min_xmaximum x-value
[out]max_ymaximum y-value
[out]max_zmaximum z-value

◆ get_bounding_box_obj()

virtual void IVivace::get_bounding_box_obj ( size_t  id_object,
Scalar &  min_x,
Scalar &  min_y,
Scalar &  min_z,
Scalar &  max_x,
Scalar &  max_y,
Scalar &  max_z 
)
pure virtual

Retrieves the axis-aligned bounding box of an object

Parameters
id_objectobject index
[out]min_xminimum x-value
[out]min_yminimum y-value
[out]min_zminimum z-value
[out]min_xmaximum x-value
[out]max_ymaximum y-value
[out]max_zmaximum z-value

◆ get_coll_box()

virtual void IVivace::get_coll_box ( size_t  id,
Scalar &  bb_min_x,
Scalar &  bb_min_y,
Scalar &  bb_min_z,
Scalar &  bb_max_x,
Scalar &  bb_max_y,
Scalar &  bb_max_z 
)
pure virtual

Function to retrieve information about an axis aligned box collider.

Parameters
idcollider index
[out]bb_min_xx-position of the minimal point in the box
[out]bb_min_yy-position of the minimal point in the box
[out]bb_min_zz-position of the minimal point in the box
[out]bb_max_xx-position of the maximal point in the box
[out]bb_max_yy-position of the maximal point in the box
[out]bb_max_zz-position of the maximal point in the box

◆ get_coll_capsule()

virtual void IVivace::get_coll_capsule ( size_t  id,
Scalar &  radius0,
Scalar &  radius1,
Scalar &  p0_x,
Scalar &  p0_y,
Scalar &  p0_z,
Scalar &  p1_x,
Scalar &  p1_y,
Scalar &  p1_z 
)
pure virtual

Function to retrieve information about a capsule collider.

Parameters
idcollider index
[out]radius0radius of p0
[out]radius0radius of p1
[out]p0_xx-position of p0
[out]p0_yy-position of p0
[out]p0_zz-position of p0
[out]p1_xx-position of p1
[out]p1_yy-position of p1
[out]p1_zz-position of p1

◆ get_coll_mesh()

virtual void IVivace::get_coll_mesh ( size_t  id,
Scalar **  vert,
unsigned int &  vert_num,
int **  tri,
unsigned int &  tri_num 
)
pure virtual

Function to retrieve information about a mesh collider.

Parameters
idcollider index
[out]vertthe array of vertices
[out]vert_numnumber of vertices
[out]trithe array of triangles
[out]tri_numnumber of triangles

◆ get_coll_obbox()

virtual void IVivace::get_coll_obbox ( size_t  id,
Scalar &  cx,
Scalar &  cy,
Scalar &  cz,
Scalar &  x_x,
Scalar &  x_y,
Scalar &  x_z,
Scalar &  y_x,
Scalar &  y_y,
Scalar &  y_z,
Scalar &  z_x,
Scalar &  z_y,
Scalar &  z_z,
Scalar &  ex,
Scalar &  ey,
Scalar &  ez 
)
pure virtual

Function to retrieve information about an object oriented box collider.

Parameters
idcollider index
[out]cxx-position of the box center
[out]cyy-position of the box center
[out]czz-position of the box center
[out]x_xx-value of the x-axis
[out]x_yy-value of the x-axis
[out]x_zz-value of the x-axis
[out]y_xx-value of the y-axis
[out]y_yy-value of the y-axis
[out]y_zz-value of the y-axis
[out]z_xx-value of the z-axis
[out]z_yy-value of the z-axis
[out]z_zz-value of the z-axis
[out]exhalf-extension along the x-axis
[out]eyhalf-extension along the y-axis
[out]ezhalf-extension along the z-axis

◆ get_coll_plane()

virtual void IVivace::get_coll_plane ( size_t  id,
Scalar &  pos_x,
Scalar &  pos_y,
Scalar &  pos_z,
Scalar &  nor_x,
Scalar &  nor_y,
Scalar &  nor_z 
)
pure virtual

Function to retrieve information about a plane collider.

Parameters
idcollider index
[out]pos_xthe x-position
[out]pos_ythe y-position
[out]pos_zthe z-position
[out]nor_xthe x-normal
[out]nor_ythe y-normal
[out]nor_zthe z-normal

◆ get_coll_sdf()

virtual void IVivace::get_coll_sdf ( size_t  id,
float **  pvert,
int **  pface,
size_t &  num_face_idx 
)
pure virtual

[Development]

◆ get_coll_sphere()

virtual void IVivace::get_coll_sphere ( size_t  id,
Scalar &  radius,
Scalar &  pos_x,
Scalar &  pos_y,
Scalar &  pos_z 
)
pure virtual

Function to retrieve information about a sphere collider.

Parameters
idthe collider index
[out]radiusradius
[out]pos_xthe x-position
[out]pos_ythe y-position
[out]pos_zthe z-position

◆ get_computation_type()

virtual int IVivace::get_computation_type ( )
pure virtual
Returns
computation type { CPU = 0, GPU_CUDA = 1, CPU_MULTI = 2 }

◆ get_friction_kinetic()

virtual Scalar IVivace::get_friction_kinetic ( size_t  pi)
pure virtual

[Development]

◆ get_friction_kinetic_obj()

virtual Scalar IVivace::get_friction_kinetic_obj ( size_t  id_object,
size_t  pi 
)
pure virtual

[Development]

Parameters
id_objectobject index
piparticle index
Returns
the friction of the particle specified

◆ get_friction_static()

virtual Scalar IVivace::get_friction_static ( size_t  pi)
pure virtual

[Development]

◆ get_friction_static_obj()

virtual Scalar IVivace::get_friction_static_obj ( size_t  id_object,
size_t  pi 
)
pure virtual

[Development]

Parameters
id_objectobject index
piparticle index
Returns
the friction of the particle specified

◆ get_gravity()

virtual void IVivace::get_gravity ( Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual

Gets the global gravity of the simulation

Parameters
[out]xgravity x-value
[out]ygravity y-value
[out]zgravity z-value

◆ get_invmass()

virtual Scalar IVivace::get_invmass ( size_t  pi)
pure virtual
Parameters
piindex of the particle
Returns
inverse mass of particle pi

◆ get_invmass_obj()

virtual Scalar IVivace::get_invmass_obj ( size_t  id_object,
size_t  pi 
)
pure virtual
Parameters
id_objectobject index
piparticle index
Returns
the inverse mass of the particle specified

◆ get_neigh_particle_face()

virtual void IVivace::get_neigh_particle_face ( size_t  id_o,
size_t  id_p,
int *  out_array,
size_t  out_size 
)
pure virtual

[Development]

◆ get_neigh_particle_particle()

virtual void IVivace::get_neigh_particle_particle ( size_t  id_o,
size_t  id_p,
int *  out_array,
size_t  out_size 
)
pure virtual

Given a particle id_p in an object id_p, fills the out_array with the indices of the particles which are neighbours of id_p.

The caller is responsible to allocate and deallocate out_array. The size of the out_array is passed in out_size.

Parameters
id_oobject index
id_pparticle index
[out]out_arrayarray to fill with neighbours
[out]out_sizesize of the array

◆ get_particle_index_from_face() [1/2]

virtual size_t IVivace::get_particle_index_from_face ( size_t  fi)
pure virtual

Given a face index, returns the particle index

Parameters
fiface index
Returns
the particle index

◆ get_particle_index_from_face() [2/2]

virtual size_t IVivace::get_particle_index_from_face ( size_t  id_object,
size_t  fi 
)
pure virtual

Given a face index, returns the particle index

Parameters
id_objectobject index
fiface index
Returns
the particle index

◆ get_physics_face_pointer()

virtual int* IVivace::get_physics_face_pointer ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
a pointer to the physics face array

◆ get_physics_iterations()

virtual int IVivace::get_physics_iterations ( )
pure virtual
Returns
the current number of iterations used

◆ get_physics_pos()

virtual void IVivace::get_physics_pos ( size_t  i,
Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual

Retrieves the position of a simulation particle

Parameters
ithe particle index
[out]xx-coordinate
[out]yy-coordinate
[out]zz-coordinate

◆ get_physics_pos_obj()

virtual void IVivace::get_physics_pos_obj ( size_t  id_object,
size_t  pi,
Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual
Parameters
id_objectobject index
piparticle index
[out]xx-position
[out]yy-position
[out]zz-position

◆ get_physics_pos_pointer()

virtual Scalar* IVivace::get_physics_pos_pointer ( )
pure virtual
Returns
pointer to the array storing the positions of the particles

◆ get_render_col_pointer()

virtual Scalar* IVivace::get_render_col_pointer ( )
pure virtual
Returns
pointer to the array storing the colors of the particles

◆ get_render_face_pointer() [1/2]

virtual int* IVivace::get_render_face_pointer ( )
pure virtual
Returns
pointer to the array storing the face indices

◆ get_render_face_pointer() [2/2]

virtual int* IVivace::get_render_face_pointer ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
a pointer to the render face array

◆ get_render_nor()

virtual void IVivace::get_render_nor ( size_t  i,
Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual

Retrieves the normal of a render vertex

Parameters
ithe vertex index
[out]xx-normal
[out]yy-normal
[out]zz-normal

◆ get_render_nor_obj()

virtual void IVivace::get_render_nor_obj ( size_t  id_object,
size_t  id_vert,
Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual
Parameters
id_objectobject index
id_vertparticle index
[out]xx-normal
[out]yy-normal
[out]zz-normal

◆ get_render_nor_pointer()

virtual Scalar* IVivace::get_render_nor_pointer ( )
pure virtual
Returns
pointer to the array storing the normals of the particles

◆ get_render_pos()

virtual void IVivace::get_render_pos ( size_t  i,
Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual

Retrieves the position of a render vertex

Parameters
ithe vertex index
[out]xx-coordinate
[out]yy-coordinate
[out]zz-coordinate

◆ get_render_pos_pointer()

virtual Scalar* IVivace::get_render_pos_pointer ( )
pure virtual
Returns
pointer to the array storing the positions of the render vertices

◆ get_solver_iterations()

virtual int IVivace::get_solver_iterations ( )
pure virtual
Returns
the current number of iterations used

◆ get_stiffness_obj()

virtual Scalar IVivace::get_stiffness_obj ( size_t  id_object,
ConstraintType  ct 
)
pure virtual
Parameters
id_objectobject index
cttype of constraint { DISTANCE = 0, BENDING = 1, TETRA = 2 }
Returns
the stiffness value

◆ get_surface_particles()

virtual void IVivace::get_surface_particles ( size_t  id,
std::vector< Vector3x > &  particle_positions,
float &  radius 
)
pure virtual

[Development]

◆ get_velocity_cap()

virtual Scalar IVivace::get_velocity_cap ( )
pure virtual
Returns
the maximum allowed velocity for all objects in the simulation

◆ get_wind()

virtual void IVivace::get_wind ( Scalar &  x,
Scalar &  y,
Scalar &  z 
)
pure virtual

Gets the global wind of the simulation

Parameters
[out]xwind x-value
[out]ywind y-value
[out]zwind z-value

◆ Init()

virtual void IVivace::Init ( )
pure virtual

Initializes the simulation

◆ is_enabled()

virtual bool IVivace::is_enabled ( size_t  id)
pure virtual

Checks if a particle is enabled

Parameters
idthe particle index
Returns
if the particle is enabled or not

◆ Load()

virtual void IVivace::Load ( const char *  filename)
pure virtual

Loads the parameters of the xml

Parameters
filenamepath to config file

◆ move_coll()

virtual void IVivace::move_coll ( size_t  id,
Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Moves a collider to the position specified

Parameters
idcollider index
xnew x-position
ynew y-position
znew z-position

◆ move_obj()

virtual void IVivace::move_obj ( size_t  id_object,
Scalar  tra_x,
Scalar  tra_y,
Scalar  tra_z 
)
pure virtual

Moves an object to a position in world space

Parameters
id_objectobject index
tra_xx-position
tra_yy-position
tra_zz-position

◆ new_obj_patch()

virtual void IVivace::new_obj_patch ( Scalar  size_x,
Scalar  size_y,
unsigned int  res_x,
unsigned int  res_y,
Scalar **  vert,
unsigned int &  vert_num,
int **  tri,
unsigned int &  tri_num 
)
pure virtual

Returns a patch which is optimized for simulation.

Parameters
size_xsize in x
size_ysize in y
rex_xresolution in x
res_yresolution in y
[out]vertthe array of vertices
[out]vert_numnumber of vertices
[out]trithe array of triangles
[out]tri_numnumber of triangles

◆ num_objs()

virtual size_t IVivace::num_objs ( )
pure virtual
Returns
The number of objects, including disabled ones

◆ pos_physics_num() [1/2]

virtual size_t IVivace::pos_physics_num ( )
pure virtual
Returns
number of physics particles in the entire simulation

◆ pos_physics_num() [2/2]

virtual size_t IVivace::pos_physics_num ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
number of physics vertices in the object specified

◆ pos_render_num() [1/2]

virtual size_t IVivace::pos_render_num ( )
pure virtual
Returns
number of render vertices in the entire simulation

◆ pos_render_num() [2/2]

virtual size_t IVivace::pos_render_num ( size_t  id_object)
pure virtual
Parameters
id_objectobject index
Returns
number of render vertices of the object specified

◆ remove_overlapping_particles_from_self_coll()

virtual void IVivace::remove_overlapping_particles_from_self_coll ( size_t  id_coll)
pure virtual

[Init]

Removes particles that are overlapping, in the initialization, from the self collisions.

Parameters
id_collcollider index

◆ Reset()

virtual void IVivace::Reset ( )
pure virtual

Sets the parameters of the simulation engine to default values

◆ rotate_coll()

virtual void IVivace::rotate_coll ( size_t  id,
Scalar  angle,
Scalar  axis_x,
Scalar  axis_y,
Scalar  axis_z,
Scalar  c_rot_x,
Scalar  c_rot_y,
Scalar  c_rot_z 
)
pure virtual

Rotate a collider. Does not work for the axis aligned box.

Parameters
idcollider index
anglerotation angle in radians
axis_xx rotation axis
axis_yy rotation axis
axis_zz rotation axis
c_rot_xx-center of rotation
c_rot_yy-center of rotation
c_rot_zz-center of rotation

◆ rotate_obj()

virtual void IVivace::rotate_obj ( size_t  id_object,
Scalar  angle,
Scalar  axis_x,
Scalar  axis_y,
Scalar  axis_z 
)
pure virtual

Rotates a deformable object around the axis specified

Parameters
id_objectobject index
anglerotation angle in radians
axis_xx-axis
axis_yy-axis
axis_zz-axis

◆ Save()

virtual void IVivace::Save ( const char *  filename)
pure virtual

[Development]

◆ scale_obj()

virtual void IVivace::scale_obj ( size_t  id_object,
Scalar  scale_x,
Scalar  scale_y,
Scalar  scale_z 
)
pure virtual

Scales an object from its center

Parameters
id_objectobject index
scale_xx-scale (!= 0)
scale_yy-scale (!= 0)
scale_zz-scale (!= 0)

◆ set_air_friction()

virtual void IVivace::set_air_friction ( Scalar  coef)
pure virtual

Sets the global air friction of the simulation

Parameters
coefthe air friction coefficient [0, 1]

◆ set_coll_enabled()

virtual void IVivace::set_coll_enabled ( size_t  id_coll,
bool  b 
)
pure virtual
Parameters
id_collcollider index
benable/disable

◆ set_coll_sticky()

virtual void IVivace::set_coll_sticky ( size_t  id_coll,
bool  b 
)
pure virtual

All particles that collide with a sticky collider will be anchored. If this function is called with b = false, all particles that have been stuck to the collider will be unstuck.

Parameters
id_collcollider index
bif the collider should be sticky or not

◆ set_friction_kinetic()

virtual void IVivace::set_friction_kinetic ( size_t  pi,
Scalar  value 
)
pure virtual

[Development]

◆ set_friction_kinetic_obj()

virtual void IVivace::set_friction_kinetic_obj ( size_t  id_object,
size_t  pi,
Scalar  value 
)
pure virtual

[Development]

Sets the friction of the particle specified

Parameters
id_objectobject index
piparticle index
valuethe friction coefficient

◆ set_friction_kinetic_obj_all()

virtual void IVivace::set_friction_kinetic_obj_all ( size_t  id,
Scalar  value 
)
pure virtual

[Development]

◆ set_friction_static()

virtual void IVivace::set_friction_static ( size_t  pi,
Scalar  value 
)
pure virtual

[Development]

◆ set_friction_static_obj()

virtual void IVivace::set_friction_static_obj ( size_t  id_object,
size_t  pi,
Scalar  value 
)
pure virtual

[Development]

Sets the friction of the particle specified

Parameters
id_objectobject index
piparticle index
valuethe friction coefficient

◆ set_friction_static_obj_all()

virtual void IVivace::set_friction_static_obj_all ( size_t  id,
Scalar  value 
)
pure virtual

[Development]

◆ set_gravity()

virtual void IVivace::set_gravity ( Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the global gravity of the simulation

Parameters
xgravity x-value
ygravity y-value
zgravity z-value

◆ set_invmass()

virtual void IVivace::set_invmass ( size_t  pi,
Scalar  value 
)
pure virtual

Sets the inverse mass of a particle

Parameters
piindex of the particle
valuethe inverse mass (>= 0)

◆ set_invmass_obj()

virtual void IVivace::set_invmass_obj ( size_t  id_object,
size_t  pi,
Scalar  value 
)
pure virtual

Sets the inverse mass of a particle. If the inverse mass is 0 the particle will not be affected by physical forces or the solver.

Parameters
id_objectobject index
piparticle index
valueinverse mass value (>= 0)

◆ set_physics_iterations()

virtual void IVivace::set_physics_iterations ( int  num_iters)
pure virtual

Sets the number of solver iterations. Increasing the number of iterations will increase the accuracy of the solver at the expense of performance.

Parameters
num_itersthe number of iterations (> 1)

◆ set_physics_pos()

virtual void IVivace::set_physics_pos ( size_t  i,
Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the position of a physics particle. If used for picking, the inverse mass of this particle should be set to 0 before dragging, and back to the previous value when dragging is done.

Parameters
ithe particle index
[out]xx-coordinate
[out]yy-coordinate
[out]zz-coordinate

◆ set_physics_pos_obj()

virtual void IVivace::set_physics_pos_obj ( size_t  id_object,
size_t  pi,
Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the position of a physics particle, given the object and particle indices. If used for picking, the inverse mass of this particle should be set to 0 before dragging, and back to the previous value when dragging is done.

Parameters
id_objectthe object index
pithe particle index
[out]xx-coordinate
[out]yy-coordinate
[out]zz-coordinate

◆ set_render_nor()

virtual void IVivace::set_render_nor ( size_t  i,
Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the vertex normal

Parameters
ithe vertex index
xx-normal
yy-normal
zz-normal

◆ set_render_nor_obj()

virtual void IVivace::set_render_nor_obj ( size_t  id_object,
size_t  id_vert,
Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the normal of a vertex

Parameters
id_objectobject index
id_vertparticle index
[out]xx-position
[out]yy-position
[out]zz-position

◆ set_solver_iterations()

virtual void IVivace::set_solver_iterations ( int  num_iters)
pure virtual

Sets the number of solver iterations. Increasing the number of iterations will increase the accuracy of the solver at the expense of performance.

Parameters
num_itersthe number of iterations (> 1)

◆ set_stiffness_obj()

virtual void IVivace::set_stiffness_obj ( size_t  id_object,
ConstraintType  ct,
Scalar  value 
)
pure virtual

Sets the constraint stiffness of an object. Values closer to 1 means that the constraints are stiffer.

Parameters
id_objectobject index
cttype of constraint { DISTANCE = 0, BENDING = 1, TETRA = 2 }
valuestiffness coefficient [0, 1]

◆ set_velocity_cap()

virtual void IVivace::set_velocity_cap ( float  v_cap)
pure virtual

Sets the maximum velocity for all objects in the simulation

Parameters
v_capthe maximum allowed velocity

◆ set_wind()

virtual void IVivace::set_wind ( Scalar  x,
Scalar  y,
Scalar  z 
)
pure virtual

Sets the global wind of the simulation

Parameters
xwind x-value
ywind y-value
zwind z-value

◆ sew_objs()

virtual void IVivace::sew_objs ( size_t  id0,
size_t  id1,
size_t *  sew_array,
size_t  num,
size_t  priority = 0 
)
pure virtual

[Init]

Sews two objects together.

Parameters
id0first object index
id1second object index
sew_arrayarray of vertex indices ordered in pairs of vertices that should be stitched together. Uses the indices that are specific to each object
numnumber of elements in the array
prioritydetermines the priority of this seam. A lower value means a higher priority

◆ Shutdown()

virtual void IVivace::Shutdown ( )
pure virtual

Shuts down the simulation engine

◆ stiffness_num()

virtual size_t IVivace::stiffness_num ( ConstraintType  ct)
pure virtual
Parameters
cttype of constraint { DISTANCE = 0, BENDING = 1, TETRA = 2 }
Returns
the number of types of constraints

◆ Update()

virtual void IVivace::Update ( )
pure virtual

[Runtime]

Updates the simulation

◆ update_coll_capsule()

virtual void IVivace::update_coll_capsule ( size_t  id,
Scalar  radius0,
Scalar  radius1,
Scalar  p0_x,
Scalar  p0_y,
Scalar  p0_z,
Scalar  p1_x,
Scalar  p1_y,
Scalar  p1_z 
)
pure virtual

Update the values of the capsule collider. The positions are in world coordinates.

Parameters
idcollider index
radius0the new radius of p0 (> 0)
radius1the new radius of p1 (> 0)
p0_xthe new x-position of p0
p0_ythe new y-position of p0
p0_zthe new z-position of p0
p1_xthe new x-position of p1
p1_ythe new y-position of p1
p1_zthe new z-position of p1

◆ update_coll_mesh()

virtual void IVivace::update_coll_mesh ( size_t  id,
Scalar *  vert,
Scalar *  norm 
)
pure virtual

Updates the vertices of a mesh collider.

Parameters
idcollider index
vertlist of collision vertices

◆ update_coll_sphere()

virtual void IVivace::update_coll_sphere ( size_t  id,
Scalar  radius,
Scalar  c_x,
Scalar  c_y,
Scalar  c_z 
)
pure virtual

Update the values of the sphere collider. The position is in world coordinates.

Parameters
idthe collider index
radiusthe new radius (> 0)
c_xthe new x-position
c_ythe new y-position
c_zthe new z-position