BRL-CAD
uv.h File Reference
#include "common.h"
#include "bu/vls.h"
#include "bu/mapped_file.h"
#include "vmath.h"
#include "rt/geom.h"
#include "rt/functab.h"
Include dependency graph for uv.h:

Go to the source code of this file.

Data Structures

struct  rt_texture
 

Macros

#define TXT_SRC_FILE   'f'
 
#define TXT_SRC_OBJECT   'o'
 
#define TXT_SRC_AUTO   0
 
#define RT_TEXTURE_INIT_ZERO   {{0,0,0}, BU_VLS_INIT_ZERO, 0, 0, 0, {0.0, 0.0}, 0, 0, NULL, NULL}
 
#define RT_HIT_UV(_ap, _stp, _hitp, _uvp)
 

Functions

int rt_texture_load (struct rt_texture *tp, const char *name, struct db_i *dbip)
 
int rt_texture_lookup (fastf_t *data, const struct rt_texture *tp, const struct uvcoord *uvp)
 

Detailed Description

This file is API pertaining to uv parameterization on objects.

Definition in file uv.h.

Macro Definition Documentation

◆ TXT_SRC_FILE

#define TXT_SRC_FILE   'f'

Definition at line 80 of file uv.h.

◆ TXT_SRC_OBJECT

#define TXT_SRC_OBJECT   'o'

Definition at line 81 of file uv.h.

◆ TXT_SRC_AUTO

#define TXT_SRC_AUTO   0

Definition at line 82 of file uv.h.

◆ RT_TEXTURE_INIT_ZERO

#define RT_TEXTURE_INIT_ZERO   {{0,0,0}, BU_VLS_INIT_ZERO, 0, 0, 0, {0.0, 0.0}, 0, 0, NULL, NULL}

initialize an rt_texture to zero

Definition at line 94 of file uv.h.

◆ RT_HIT_UV

#define RT_HIT_UV (   _ap,
  _stp,
  _hitp,
  _uvp 
)
Value:
{ \
RT_CK_HIT(_hitp); \
RT_CK_SOLTAB(_stp); \
RT_CK_FUNCTAB((_stp)->st_meth); \
if ((_stp)->st_meth->ft_uv) { \
(_stp)->st_meth->ft_uv(ap, _stp, _hitp, uvp); \
} \
}

As rt_shootray() only calculates hit points and returns a list of partitions, applications must request that the corresponding UV coordinate be computed via: RT_HIT_UV(NULL, hitp, stp, rayp, 0);

These calculations are deferred to user code to avoid needless computation in other ray situations.

Definition at line 114 of file uv.h.

Function Documentation

◆ rt_texture_load()

int rt_texture_load ( struct rt_texture tp,
const char *  name,
struct db_i dbip 
)

loads a texture from either a file or database object.

TODO: replace txt_load_datasource in liboptical

◆ rt_texture_lookup()

int rt_texture_lookup ( fastf_t data,
const struct rt_texture tp,
const struct uvcoord uvp 
)

Given a uv coordinate (0.0 <= u, v <= 1.0) and a texture, return a pointer to the corresponding texture data (as a fastf_t[3]).

TODO: replace txt_render in liboptical