Wise&mystical  1.0
Project about Europe
Loading...
Searching...
No Matches
par_shapes.h File Reference
#include <stdint.h>
+ Include dependency graph for par_shapes.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  par_shapes_mesh_s
 

Macros

#define PAR_SHAPES_T   uint16_t
 
#define PAR_PI   (3.14159265359)
 
#define PAR_MIN(a, b)   (a > b ? b : a)
 
#define PAR_MAX(a, b)   (a > b ? a : b)
 
#define PAR_CLAMP(v, lo, hi)   PAR_MAX(lo, PAR_MIN(hi, v))
 
#define PAR_SWAP(T, A, B)   { T tmp = B; B = A; A = tmp; }
 
#define PAR_SQR(a)   ((a) * (a))
 
#define PAR_MALLOC(T, N)   ((T*) malloc(N * sizeof(T)))
 
#define PAR_CALLOC(T, N)   ((T*) calloc(N * sizeof(T), 1))
 
#define PAR_REALLOC(T, BUF, N)   ((T*) realloc(BUF, sizeof(T) * (N)))
 
#define PAR_FREE(BUF)   free(BUF)
 

Typedefs

typedef struct par_shapes_mesh_s par_shapes_mesh
 
typedef void(* par_shapes_fn) (float const *, float *, void *)
 

Functions

void par_shapes_free_mesh (par_shapes_mesh *)
 
par_shapes_meshpar_shapes_create_cylinder (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_cone (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_parametric_disk (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_torus (int slices, int stacks, float radius)
 
par_shapes_meshpar_shapes_create_parametric_sphere (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_subdivided_sphere (int nsubdivisions)
 
par_shapes_meshpar_shapes_create_klein_bottle (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_trefoil_knot (int slices, int stacks, float radius)
 
par_shapes_meshpar_shapes_create_hemisphere (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_plane (int slices, int stacks)
 
par_shapes_meshpar_shapes_create_parametric (par_shapes_fn, int slices, int stacks, void *userdata)
 
par_shapes_meshpar_shapes_create_icosahedron ()
 
par_shapes_meshpar_shapes_create_dodecahedron ()
 
par_shapes_meshpar_shapes_create_octahedron ()
 
par_shapes_meshpar_shapes_create_tetrahedron ()
 
par_shapes_meshpar_shapes_create_cube ()
 
par_shapes_meshpar_shapes_create_disk (float radius, int slices, float const *center, float const *normal)
 
par_shapes_meshpar_shapes_create_empty ()
 
par_shapes_meshpar_shapes_create_rock (int seed, int nsubdivisions)
 
par_shapes_meshpar_shapes_create_lsystem (char const *program, int slices, int maxdepth)
 
void par_shapes_export (par_shapes_mesh const *, char const *objfile)
 
void par_shapes_compute_aabb (par_shapes_mesh const *mesh, float *aabb)
 
par_shapes_meshpar_shapes_clone (par_shapes_mesh const *mesh, par_shapes_mesh *target)
 
void par_shapes_merge (par_shapes_mesh *dst, par_shapes_mesh const *src)
 
void par_shapes_translate (par_shapes_mesh *, float x, float y, float z)
 
void par_shapes_rotate (par_shapes_mesh *, float radians, float const *axis)
 
void par_shapes_scale (par_shapes_mesh *, float x, float y, float z)
 
void par_shapes_merge_and_free (par_shapes_mesh *dst, par_shapes_mesh *src)
 
void par_shapes_invert (par_shapes_mesh *, int startface, int nfaces)
 
void par_shapes_remove_degenerate (par_shapes_mesh *, float minarea)
 
void par_shapes_unweld (par_shapes_mesh *mesh, bool create_indices)
 
par_shapes_meshpar_shapes_weld (par_shapes_mesh const *, float epsilon, PAR_SHAPES_T *mapping)
 
void par_shapes_compute_normals (par_shapes_mesh *m)
 
void par_shapes_set_epsilon_welded_normals (float epsilon)
 
void par_shapes_set_epsilon_degenerate_sphere (float epsilon)
 
void par_shapes__compute_welded_normals (par_shapes_mesh *m)
 
void par_shapes__connect (par_shapes_mesh *scene, par_shapes_mesh *cylinder, int slices)
 

Macro Definition Documentation

◆ PAR_CALLOC

#define PAR_CALLOC (   T,
 
)    ((T*) calloc(N * sizeof(T), 1))

Definition at line 203 of file par_shapes.h.

◆ PAR_CLAMP

#define PAR_CLAMP (   v,
  lo,
  hi 
)    PAR_MAX(lo, PAR_MIN(hi, v))

Definition at line 196 of file par_shapes.h.

◆ PAR_FREE

#define PAR_FREE (   BUF)    free(BUF)

Definition at line 205 of file par_shapes.h.

◆ PAR_MALLOC

#define PAR_MALLOC (   T,
 
)    ((T*) malloc(N * sizeof(T)))

Definition at line 202 of file par_shapes.h.

◆ PAR_MAX

#define PAR_MAX (   a,
 
)    (a > b ? a : b)

Definition at line 195 of file par_shapes.h.

◆ PAR_MIN

#define PAR_MIN (   a,
 
)    (a > b ? b : a)

Definition at line 194 of file par_shapes.h.

◆ PAR_PI

#define PAR_PI   (3.14159265359)

Definition at line 193 of file par_shapes.h.

◆ PAR_REALLOC

#define PAR_REALLOC (   T,
  BUF,
 
)    ((T*) realloc(BUF, sizeof(T) * (N)))

Definition at line 204 of file par_shapes.h.

◆ PAR_SHAPES_T

#define PAR_SHAPES_T   uint16_t

Definition at line 50 of file par_shapes.h.

◆ PAR_SQR

#define PAR_SQR (   a)    ((a) * (a))

Definition at line 198 of file par_shapes.h.

◆ PAR_SWAP

#define PAR_SWAP (   T,
  A,
 
)    { T tmp = B; B = A; A = tmp; }

Definition at line 197 of file par_shapes.h.

Typedef Documentation

◆ par_shapes_fn

typedef void(* par_shapes_fn) (float const *, float *, void *)

Definition at line 101 of file par_shapes.h.

◆ par_shapes_mesh

Function Documentation

◆ par_shapes__compute_welded_normals()

void par_shapes__compute_welded_normals ( par_shapes_mesh m)

◆ par_shapes__connect()

void par_shapes__connect ( par_shapes_mesh scene,
par_shapes_mesh cylinder,
int  slices 
)

◆ par_shapes_clone()

par_shapes_mesh * par_shapes_clone ( par_shapes_mesh const *  mesh,
par_shapes_mesh target 
)

◆ par_shapes_compute_aabb()

void par_shapes_compute_aabb ( par_shapes_mesh const *  mesh,
float *  aabb 
)

◆ par_shapes_compute_normals()

void par_shapes_compute_normals ( par_shapes_mesh m)
+ Here is the caller graph for this function:

◆ par_shapes_create_cone()

par_shapes_mesh * par_shapes_create_cone ( int  slices,
int  stacks 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_cube()

par_shapes_mesh * par_shapes_create_cube ( )
+ Here is the caller graph for this function:

◆ par_shapes_create_cylinder()

par_shapes_mesh * par_shapes_create_cylinder ( int  slices,
int  stacks 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_disk()

par_shapes_mesh * par_shapes_create_disk ( float  radius,
int  slices,
float const *  center,
float const *  normal 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_dodecahedron()

par_shapes_mesh * par_shapes_create_dodecahedron ( )

◆ par_shapes_create_empty()

par_shapes_mesh * par_shapes_create_empty ( )

◆ par_shapes_create_hemisphere()

par_shapes_mesh * par_shapes_create_hemisphere ( int  slices,
int  stacks 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_icosahedron()

par_shapes_mesh * par_shapes_create_icosahedron ( )

◆ par_shapes_create_klein_bottle()

par_shapes_mesh * par_shapes_create_klein_bottle ( int  slices,
int  stacks 
)

◆ par_shapes_create_lsystem()

par_shapes_mesh * par_shapes_create_lsystem ( char const *  program,
int  slices,
int  maxdepth 
)

◆ par_shapes_create_octahedron()

par_shapes_mesh * par_shapes_create_octahedron ( )

◆ par_shapes_create_parametric()

par_shapes_mesh * par_shapes_create_parametric ( par_shapes_fn  ,
int  slices,
int  stacks,
void *  userdata 
)

◆ par_shapes_create_parametric_disk()

par_shapes_mesh * par_shapes_create_parametric_disk ( int  slices,
int  stacks 
)

◆ par_shapes_create_parametric_sphere()

par_shapes_mesh * par_shapes_create_parametric_sphere ( int  slices,
int  stacks 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_plane()

par_shapes_mesh * par_shapes_create_plane ( int  slices,
int  stacks 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_rock()

par_shapes_mesh * par_shapes_create_rock ( int  seed,
int  nsubdivisions 
)

◆ par_shapes_create_subdivided_sphere()

par_shapes_mesh * par_shapes_create_subdivided_sphere ( int  nsubdivisions)

◆ par_shapes_create_tetrahedron()

par_shapes_mesh * par_shapes_create_tetrahedron ( )

◆ par_shapes_create_torus()

par_shapes_mesh * par_shapes_create_torus ( int  slices,
int  stacks,
float  radius 
)
+ Here is the caller graph for this function:

◆ par_shapes_create_trefoil_knot()

par_shapes_mesh * par_shapes_create_trefoil_knot ( int  slices,
int  stacks,
float  radius 
)
+ Here is the caller graph for this function:

◆ par_shapes_export()

void par_shapes_export ( par_shapes_mesh const *  ,
char const *  objfile 
)

◆ par_shapes_free_mesh()

void par_shapes_free_mesh ( par_shapes_mesh )
+ Here is the caller graph for this function:

◆ par_shapes_invert()

void par_shapes_invert ( par_shapes_mesh ,
int  startface,
int  nfaces 
)

◆ par_shapes_merge()

void par_shapes_merge ( par_shapes_mesh dst,
par_shapes_mesh const *  src 
)

◆ par_shapes_merge_and_free()

void par_shapes_merge_and_free ( par_shapes_mesh dst,
par_shapes_mesh src 
)
+ Here is the caller graph for this function:

◆ par_shapes_remove_degenerate()

void par_shapes_remove_degenerate ( par_shapes_mesh ,
float  minarea 
)

◆ par_shapes_rotate()

void par_shapes_rotate ( par_shapes_mesh ,
float  radians,
float const *  axis 
)
+ Here is the caller graph for this function:

◆ par_shapes_scale()

void par_shapes_scale ( par_shapes_mesh ,
float  x,
float  y,
float  z 
)
+ Here is the caller graph for this function:

◆ par_shapes_set_epsilon_degenerate_sphere()

void par_shapes_set_epsilon_degenerate_sphere ( float  epsilon)

◆ par_shapes_set_epsilon_welded_normals()

void par_shapes_set_epsilon_welded_normals ( float  epsilon)

◆ par_shapes_translate()

void par_shapes_translate ( par_shapes_mesh ,
float  x,
float  y,
float  z 
)
+ Here is the caller graph for this function:

◆ par_shapes_unweld()

void par_shapes_unweld ( par_shapes_mesh mesh,
bool  create_indices 
)

◆ par_shapes_weld()

par_shapes_mesh * par_shapes_weld ( par_shapes_mesh const *  ,
float  epsilon,
PAR_SHAPES_T mapping 
)