zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
API

Classes

struct  Lib3dsAmbientColorNode
 
struct  Lib3dsAtmosphere
 
struct  Lib3dsBackground
 
struct  Lib3dsCamera
 
struct  Lib3dsCameraNode
 
struct  Lib3dsFace
 
struct  Lib3dsFile
 
struct  Lib3dsIo
 
struct  Lib3dsKey
 
struct  Lib3dsLight
 
struct  Lib3dsMaterial
 
struct  Lib3dsMesh
 
struct  Lib3dsMeshInstanceNode
 
struct  Lib3dsNode
 
struct  Lib3dsOmnilightNode
 
struct  Lib3dsShadow
 
struct  Lib3dsSpotlightNode
 
struct  Lib3dsTargetNode
 
struct  Lib3dsTextureMap
 
struct  Lib3dsTrack
 
struct  Lib3dsView
 
struct  Lib3dsViewport
 

Macros

#define LIB3DS_LAYOUT_MAX_VIEWS   32
 

Typedefs

typedef struct
Lib3dsAmbientColorNode 
Lib3dsAmbientColorNode
 
typedef struct Lib3dsAtmosphere Lib3dsAtmosphere
 
typedef enum Lib3dsAutoReflMapFlags Lib3dsAutoReflMapFlags
 
typedef struct Lib3dsBackground Lib3dsBackground
 
typedef struct Lib3dsCamera Lib3dsCamera
 
typedef struct Lib3dsCameraNode Lib3dsCameraNode
 
typedef struct Lib3dsFace Lib3dsFace
 
typedef enum Lib3dsFaceFlags Lib3dsFaceFlags
 
typedef struct Lib3dsFile Lib3dsFile
 
typedef struct Lib3dsIo Lib3dsIo
 
typedef enum Lib3dsIoSeek Lib3dsIoSeek
 
typedef struct Lib3dsKey Lib3dsKey
 
typedef enum Lib3dsKeyFlags Lib3dsKeyFlags
 
typedef enum Lib3dsLayoutStyle Lib3dsLayoutStyle
 
typedef struct Lib3dsLight Lib3dsLight
 
typedef enum Lib3dsLogLevel Lib3dsLogLevel
 
typedef struct Lib3dsMaterial Lib3dsMaterial
 
typedef struct Lib3dsMesh Lib3dsMesh
 
typedef struct
Lib3dsMeshInstanceNode 
Lib3dsMeshInstanceNode
 
typedef struct Lib3dsNode Lib3dsNode
 
typedef enum Lib3dsNodeFlags Lib3dsNodeFlags
 
typedef enum Lib3dsNodeType Lib3dsNodeType
 
typedef enum Lib3dsObjectFlags Lib3dsObjectFlags
 
typedef struct Lib3dsOmnilightNode Lib3dsOmnilightNode
 
typedef enum Lib3dsShading Lib3dsShading
 
typedef struct Lib3dsShadow Lib3dsShadow
 
typedef struct Lib3dsSpotlightNode Lib3dsSpotlightNode
 
typedef struct Lib3dsTargetNode Lib3dsTargetNode
 
typedef struct Lib3dsTextureMap Lib3dsTextureMap
 
typedef enum Lib3dsTextureMapFlags Lib3dsTextureMapFlags
 
typedef struct Lib3dsTrack Lib3dsTrack
 
typedef enum Lib3dsTrackType Lib3dsTrackType
 
typedef struct Lib3dsView Lib3dsView
 
typedef struct Lib3dsViewport Lib3dsViewport
 
typedef enum Lib3dsViewType Lib3dsViewType
 

Enumerations

enum  Lib3dsAutoReflMapFlags { LIB3DS_AUTOREFL_USE = 0x0001, LIB3DS_AUTOREFL_READ_FIRST_FRAME_ONLY = 0x0004, LIB3DS_AUTOREFL_FLAT_MIRROR = 0x0008 }
 
enum  Lib3dsFaceFlags {
  LIB3DS_FACE_VIS_AC = 0x01, LIB3DS_FACE_VIS_BC = 0x02, LIB3DS_FACE_VIS_AB = 0x04, LIB3DS_FACE_WRAP_U = 0x08,
  LIB3DS_FACE_WRAP_V = 0x10, LIB3DS_FACE_SELECT_3 = (1<<13), LIB3DS_FACE_SELECT_2 = (1<<14), LIB3DS_FACE_SELECT_1 = (1<<15)
}
 
enum  Lib3dsIoSeek { LIB3DS_SEEK_SET = 0, LIB3DS_SEEK_CUR = 1, LIB3DS_SEEK_END = 2 }
 
enum  Lib3dsKeyFlags {
  LIB3DS_KEY_USE_TENS = 0x01, LIB3DS_KEY_USE_CONT = 0x02, LIB3DS_KEY_USE_BIAS = 0x04, LIB3DS_KEY_USE_EASE_TO = 0x08,
  LIB3DS_KEY_USE_EASE_FROM = 0x10
}
 
enum  Lib3dsLayoutStyle {
  LIB3DS_LAYOUT_SINGLE = 0, LIB3DS_LAYOUT_TWO_PANE_VERT_SPLIT = 1, LIB3DS_LAYOUT_TWO_PANE_HORIZ_SPLIT = 2, LIB3DS_LAYOUT_FOUR_PANE = 3,
  LIB3DS_LAYOUT_THREE_PANE_LEFT_SPLIT = 4, LIB3DS_LAYOUT_THREE_PANE_BOTTOM_SPLIT = 5, LIB3DS_LAYOUT_THREE_PANE_RIGHT_SPLIT = 6, LIB3DS_LAYOUT_THREE_PANE_TOP_SPLIT = 7,
  LIB3DS_LAYOUT_THREE_PANE_VERT_SPLIT = 8, LIB3DS_LAYOUT_THREE_PANE_HORIZ_SPLIT = 9, LIB3DS_LAYOUT_FOUR_PANE_LEFT_SPLIT = 10, LIB3DS_LAYOUT_FOUR_PANE_RIGHT_SPLIT = 11
}
 
enum  Lib3dsLogLevel { LIB3DS_LOG_ERROR = 0, LIB3DS_LOG_WARN = 1, LIB3DS_LOG_INFO = 2, LIB3DS_LOG_DEBUG = 3 }
 
enum  Lib3dsMapType { LIB3DS_MAP_NONE = -1, LIB3DS_MAP_PLANAR = 0, LIB3DS_MAP_CYLINDRICAL = 1, LIB3DS_MAP_SPHERICAL = 2 }
 
enum  Lib3dsNodeFlags {
  LIB3DS_NODE_HIDDEN = 0x000800, LIB3DS_NODE_SHOW_PATH = 0x010000, LIB3DS_NODE_SMOOTHING = 0x020000, LIB3DS_NODE_MOTION_BLUR = 0x100000,
  LIB3DS_NODE_MORPH_MATERIALS = 0x400000
}
 
enum  Lib3dsNodeType {
  LIB3DS_NODE_AMBIENT_COLOR = 0, LIB3DS_NODE_MESH_INSTANCE = 1, LIB3DS_NODE_CAMERA = 2, LIB3DS_NODE_CAMERA_TARGET = 3,
  LIB3DS_NODE_OMNILIGHT = 4, LIB3DS_NODE_SPOTLIGHT = 5, LIB3DS_NODE_SPOTLIGHT_TARGET = 6
}
 
enum  Lib3dsObjectFlags {
  LIB3DS_OBJECT_HIDDEN = 0x01, LIB3DS_OBJECT_VIS_LOFTER = 0x02, LIB3DS_OBJECT_DOESNT_CAST = 0x04, LIB3DS_OBJECT_MATTE = 0x08,
  LIB3DS_OBJECT_DONT_RCVSHADOW = 0x10, LIB3DS_OBJECT_FAST = 0x20, LIB3DS_OBJECT_FROZEN = 0x40
}
 
enum  Lib3dsShading {
  LIB3DS_SHADING_WIRE_FRAME = 0, LIB3DS_SHADING_FLAT = 1, LIB3DS_SHADING_GOURAUD = 2, LIB3DS_SHADING_PHONG = 3,
  LIB3DS_SHADING_METAL = 4
}
 
enum  Lib3dsTextureMapFlags {
  LIB3DS_TEXTURE_DECALE = 0x0001, LIB3DS_TEXTURE_MIRROR = 0x0002, LIB3DS_TEXTURE_NEGATE = 0x0008, LIB3DS_TEXTURE_NO_TILE = 0x0010,
  LIB3DS_TEXTURE_SUMMED_AREA = 0x0020, LIB3DS_TEXTURE_ALPHA_SOURCE = 0x0040, LIB3DS_TEXTURE_TINT = 0x0080, LIB3DS_TEXTURE_IGNORE_ALPHA = 0x0100,
  LIB3DS_TEXTURE_RGB_TINT = 0x0200
}
 
enum  Lib3dsTrackFlags {
  LIB3DS_TRACK_REPEAT = 0x0001, LIB3DS_TRACK_SMOOTH = 0x0002, LIB3DS_TRACK_LOCK_X = 0x0008, LIB3DS_TRACK_LOCK_Y = 0x0010,
  LIB3DS_TRACK_LOCK_Z = 0x0020, LIB3DS_TRACK_UNLINK_X = 0x0100, LIB3DS_TRACK_UNLINK_Y = 0x0200, LIB3DS_TRACK_UNLINK_Z = 0x0400
}
 
enum  Lib3dsTrackType { LIB3DS_TRACK_BOOL = 0, LIB3DS_TRACK_FLOAT = 1, LIB3DS_TRACK_VECTOR = 3, LIB3DS_TRACK_QUAT = 4 }
 
enum  Lib3dsViewType {
  LIB3DS_VIEW_NOT_USED = 0, LIB3DS_VIEW_TOP = 1, LIB3DS_VIEW_BOTTOM = 2, LIB3DS_VIEW_LEFT = 3,
  LIB3DS_VIEW_RIGHT = 4, LIB3DS_VIEW_FRONT = 5, LIB3DS_VIEW_BACK = 6, LIB3DS_VIEW_USER = 7,
  LIB3DS_VIEW_SPOTLIGHT = 18, LIB3DS_VIEW_CAMERA = 65535
}
 

Functions

LIB3DSAPI void lib3ds_camera_free (Lib3dsCamera *mesh)
 
LIB3DSAPI Lib3dsCameralib3ds_camera_new (const char *name)
 
LIB3DSAPI void lib3ds_file_append_node (Lib3dsFile *file, Lib3dsNode *node, Lib3dsNode *parent)
 
LIB3DSAPI void lib3ds_file_bounding_box_of_nodes (Lib3dsFile *file, int include_meshes, int include_cameras, int include_lights, float bmin[3], float bmax[3], float matrix[4][4])
 
LIB3DSAPI void lib3ds_file_bounding_box_of_objects (Lib3dsFile *file, int include_meshes, int include_cameras, int include_lights, float bmin[3], float bmax[3])
 
LIB3DSAPI int lib3ds_file_camera_by_name (Lib3dsFile *file, const char *name)
 
LIB3DSAPI void lib3ds_file_create_nodes_for_meshes (Lib3dsFile *file)
 
LIB3DSAPI void lib3ds_file_eval (Lib3dsFile *file, float t)
 
LIB3DSAPI void lib3ds_file_free (Lib3dsFile *file)
 
LIB3DSAPI void lib3ds_file_insert_camera (Lib3dsFile *file, Lib3dsCamera *camera, int index)
 
LIB3DSAPI void lib3ds_file_insert_light (Lib3dsFile *file, Lib3dsLight *light, int index)
 
LIB3DSAPI void lib3ds_file_insert_material (Lib3dsFile *file, Lib3dsMaterial *material, int index)
 
LIB3DSAPI void lib3ds_file_insert_mesh (Lib3dsFile *file, Lib3dsMesh *mesh, int index)
 
LIB3DSAPI void lib3ds_file_insert_node (Lib3dsFile *file, Lib3dsNode *node, Lib3dsNode *at)
 
LIB3DSAPI int lib3ds_file_light_by_name (Lib3dsFile *file, const char *name)
 
LIB3DSAPI int lib3ds_file_material_by_name (Lib3dsFile *file, const char *name)
 
LIB3DSAPI int lib3ds_file_mesh_by_name (Lib3dsFile *file, const char *name)
 
LIB3DSAPI Lib3dsMeshlib3ds_file_mesh_for_node (Lib3dsFile *file, Lib3dsNode *node)
 
LIB3DSAPI void lib3ds_file_minmax_node_id (Lib3dsFile *file, unsigned short *min_id, unsigned short *max_id)
 
LIB3DSAPI Lib3dsFilelib3ds_file_new ()
 
LIB3DSAPI Lib3dsNodelib3ds_file_node_by_id (Lib3dsFile *file, unsigned short node_id)
 
LIB3DSAPI Lib3dsNodelib3ds_file_node_by_name (Lib3dsFile *file, const char *name, Lib3dsNodeType type)
 
LIB3DSAPI Lib3dsFilelib3ds_file_open (const char *filename)
 
LIB3DSAPI int lib3ds_file_read (Lib3dsFile *file, Lib3dsIo *io)
 
LIB3DSAPI void lib3ds_file_remove_camera (Lib3dsFile *file, int index)
 
LIB3DSAPI void lib3ds_file_remove_light (Lib3dsFile *file, int index)
 
LIB3DSAPI void lib3ds_file_remove_material (Lib3dsFile *file, int index)
 
LIB3DSAPI void lib3ds_file_remove_mesh (Lib3dsFile *file, int index)
 
LIB3DSAPI void lib3ds_file_remove_node (Lib3dsFile *file, Lib3dsNode *node)
 
LIB3DSAPI void lib3ds_file_reserve_cameras (Lib3dsFile *file, int size, int force)
 
LIB3DSAPI void lib3ds_file_reserve_lights (Lib3dsFile *file, int size, int force)
 
LIB3DSAPI void lib3ds_file_reserve_materials (Lib3dsFile *file, int size, int force)
 
LIB3DSAPI void lib3ds_file_reserve_meshes (Lib3dsFile *file, int size, int force)
 
LIB3DSAPI int lib3ds_file_save (Lib3dsFile *file, const char *filename)
 
LIB3DSAPI int lib3ds_file_write (Lib3dsFile *file, Lib3dsIo *io)
 
LIB3DSAPI void lib3ds_light_free (Lib3dsLight *mesh)
 
LIB3DSAPI Lib3dsLightlib3ds_light_new (const char *name)
 
LIB3DSAPI void lib3ds_material_free (Lib3dsMaterial *material)
 
LIB3DSAPI Lib3dsMateriallib3ds_material_new (const char *name)
 
LIB3DSAPI void lib3ds_math_cubic_interp (float *v, float *a, float *p, float *q, float *b, int n, float t)
 
LIB3DSAPI float lib3ds_math_ease (float fp, float fc, float fn, float ease_from, float ease_to)
 
LIB3DSAPI void lib3ds_matrix_add (float m[4][4], float a[4][4], float b[4][4])
 
LIB3DSAPI void lib3ds_matrix_camera (float m[4][4], float pos[3], float tgt[3], float roll)
 
LIB3DSAPI void lib3ds_matrix_copy (float dest[4][4], float src[4][4])
 
LIB3DSAPI float lib3ds_matrix_det (float m[4][4])
 
LIB3DSAPI void lib3ds_matrix_identity (float m[4][4])
 
LIB3DSAPI int lib3ds_matrix_inv (float m[4][4])
 
LIB3DSAPI void lib3ds_matrix_mult (float m[4][4], float a[4][4], float b[4][4])
 
LIB3DSAPI void lib3ds_matrix_neg (float m[4][4])
 
LIB3DSAPI void lib3ds_matrix_rotate (float m[4][4], float angle, float ax, float ay, float az)
 
LIB3DSAPI void lib3ds_matrix_rotate_quat (float m[4][4], float q[4])
 
LIB3DSAPI void lib3ds_matrix_scalar (float m[4][4], float k)
 
LIB3DSAPI void lib3ds_matrix_scale (float m[4][4], float x, float y, float z)
 
LIB3DSAPI void lib3ds_matrix_sub (float m[4][4], float a[4][4], float b[4][4])
 
LIB3DSAPI void lib3ds_matrix_translate (float m[4][4], float x, float y, float z)
 
LIB3DSAPI void lib3ds_matrix_transpose (float m[4][4])
 
LIB3DSAPI void lib3ds_matrix_zero (float m[4][4])
 
LIB3DSAPI void lib3ds_mesh_bounding_box (Lib3dsMesh *mesh, float bmin[3], float bmax[3])
 
LIB3DSAPI void lib3ds_mesh_calculate_face_normals (Lib3dsMesh *mesh, float(*face_normals)[3])
 
LIB3DSAPI void lib3ds_mesh_calculate_vertex_normals (Lib3dsMesh *mesh, float(*normals)[3])
 
LIB3DSAPI void lib3ds_mesh_free (Lib3dsMesh *mesh)
 
LIB3DSAPI Lib3dsMeshlib3ds_mesh_new (const char *name)
 
LIB3DSAPI void lib3ds_mesh_resize_faces (Lib3dsMesh *mesh, int nfaces)
 
LIB3DSAPI void lib3ds_mesh_resize_vertices (Lib3dsMesh *mesh, int nvertices, int use_texcos, int use_flags)
 
LIB3DSAPI Lib3dsNodelib3ds_node_by_id (Lib3dsNode *node, unsigned short node_id)
 
LIB3DSAPI Lib3dsNodelib3ds_node_by_name (Lib3dsNode *node, const char *name, Lib3dsNodeType type)
 
LIB3DSAPI void lib3ds_node_eval (Lib3dsNode *node, float t)
 
LIB3DSAPI void lib3ds_node_free (Lib3dsNode *node)
 
LIB3DSAPI Lib3dsNodelib3ds_node_new (Lib3dsNodeType type)
 
LIB3DSAPI Lib3dsAmbientColorNodelib3ds_node_new_ambient_color (float color0[3])
 
LIB3DSAPI Lib3dsCameraNodelib3ds_node_new_camera (Lib3dsCamera *camera)
 
LIB3DSAPI Lib3dsTargetNodelib3ds_node_new_camera_target (Lib3dsCamera *camera)
 
LIB3DSAPI Lib3dsMeshInstanceNodelib3ds_node_new_mesh_instance (Lib3dsMesh *mesh, const char *instance_name, float pos0[3], float scl0[3], float rot0[4])
 
LIB3DSAPI Lib3dsOmnilightNodelib3ds_node_new_omnilight (Lib3dsLight *light)
 
LIB3DSAPI Lib3dsSpotlightNodelib3ds_node_new_spotlight (Lib3dsLight *light)
 
LIB3DSAPI Lib3dsTargetNodelib3ds_node_new_spotlight_target (Lib3dsLight *light)
 
LIB3DSAPI void lib3ds_quat_axis_angle (float c[4], float axis[3], float angle)
 
LIB3DSAPI void lib3ds_quat_cnj (float c[4])
 
LIB3DSAPI void lib3ds_quat_copy (float dest[4], float src[4])
 
LIB3DSAPI float lib3ds_quat_dot (float a[4], float b[4])
 
LIB3DSAPI void lib3ds_quat_exp (float c[4])
 
LIB3DSAPI void lib3ds_quat_identity (float c[4])
 
LIB3DSAPI void lib3ds_quat_inv (float c[4])
 
LIB3DSAPI void lib3ds_quat_ln (float c[4])
 
LIB3DSAPI void lib3ds_quat_ln_dif (float c[4], float a[4], float b[4])
 
LIB3DSAPI void lib3ds_quat_mul (float c[4], float a[4], float b[4])
 
LIB3DSAPI void lib3ds_quat_neg (float c[4])
 
LIB3DSAPI float lib3ds_quat_norm (float c[4])
 
LIB3DSAPI void lib3ds_quat_normalize (float c[4])
 
LIB3DSAPI void lib3ds_quat_scalar (float c[4], float k)
 
LIB3DSAPI void lib3ds_quat_slerp (float c[4], float a[4], float b[4], float t)
 
LIB3DSAPI void lib3ds_quat_squad (float c[4], float a[4], float p[4], float q[4], float b[4], float t)
 
LIB3DSAPI void lib3ds_quat_tangent (float c[4], float p[4], float q[4], float n[4])
 
LIB3DSAPI void lib3ds_track_eval_bool (Lib3dsTrack *track, int *b, float t)
 
LIB3DSAPI void lib3ds_track_eval_float (Lib3dsTrack *track, float *f, float t)
 
LIB3DSAPI void lib3ds_track_eval_quat (Lib3dsTrack *track, float q[4], float t)
 
LIB3DSAPI void lib3ds_track_eval_vector (Lib3dsTrack *track, float v[3], float t)
 
LIB3DSAPI void lib3ds_track_free (Lib3dsTrack *track)
 
LIB3DSAPI Lib3dsTracklib3ds_track_new (Lib3dsTrackType type, int nkeys)
 
LIB3DSAPI void lib3ds_track_resize (Lib3dsTrack *track, int nkeys)
 
LIB3DSAPI void lib3ds_vector_add (float c[3], float a[3], float b[3])
 
LIB3DSAPI void lib3ds_vector_copy (float dst[3], float src[3])
 
LIB3DSAPI void lib3ds_vector_cross (float c[3], float a[3], float b[3])
 
LIB3DSAPI float lib3ds_vector_dot (float a[3], float b[3])
 
LIB3DSAPI float lib3ds_vector_length (float c[3])
 
LIB3DSAPI void lib3ds_vector_make (float c[3], float x, float y, float z)
 
LIB3DSAPI void lib3ds_vector_max (float c[3], float a[3])
 
LIB3DSAPI void lib3ds_vector_min (float c[3], float a[3])
 
LIB3DSAPI void lib3ds_vector_neg (float c[3])
 
LIB3DSAPI void lib3ds_vector_normal (float n[3], float a[3], float b[3], float c[3])
 
LIB3DSAPI void lib3ds_vector_normalize (float c[3])
 
LIB3DSAPI void lib3ds_vector_scalar_mul (float c[3], float a[3], float k)
 
LIB3DSAPI void lib3ds_vector_sub (float c[3], float a[3], float b[3])
 
LIB3DSAPI void lib3ds_vector_transform (float c[3], float m[4][4], float a[3])
 
LIB3DSAPI void lib3ds_vector_zero (float c[3])
 

Detailed Description

Macro Definition Documentation

#define LIB3DS_LAYOUT_MAX_VIEWS   32

Definition at line 154 of file lib3ds.h.

Referenced by lib3ds_viewport_read().

Typedef Documentation

typedef struct Lib3dsCamera Lib3dsCamera

Camera object

typedef struct Lib3dsFace Lib3dsFace

Meaning of Lib3dsFace::flags. ABC are points of the current face (A: is 1st vertex, B is 2nd vertex, C is 3rd vertex)

typedef struct Lib3dsFile Lib3dsFile
typedef struct Lib3dsIo Lib3dsIo
typedef enum Lib3dsIoSeek Lib3dsIoSeek
typedef struct Lib3dsKey Lib3dsKey
typedef struct Lib3dsLight Lib3dsLight

Light object

Material

typedef struct Lib3dsMesh Lib3dsMesh
typedef struct Lib3dsNode Lib3dsNode

Object flags for cameras, lights and meshes

typedef struct Lib3dsShadow Lib3dsShadow
typedef struct Lib3dsTrack Lib3dsTrack
typedef struct Lib3dsView Lib3dsView

Enumeration Type Documentation

Enumerator
LIB3DS_AUTOREFL_USE 
LIB3DS_AUTOREFL_READ_FIRST_FRAME_ONLY 
LIB3DS_AUTOREFL_FLAT_MIRROR 

Definition at line 208 of file lib3ds.h.

Meaning of Lib3dsFace::flags. ABC are points of the current face (A: is 1st vertex, B is 2nd vertex, C is 3rd vertex)

Enumerator
LIB3DS_FACE_VIS_AC 

Bit 0: Edge visibility AC

LIB3DS_FACE_VIS_BC 

Bit 1: Edge visibility BC

LIB3DS_FACE_VIS_AB 

Bit 2: Edge visibility AB

LIB3DS_FACE_WRAP_U 

Bit 3: Face is at tex U wrap seam

LIB3DS_FACE_WRAP_V 

Bit 4: Face is at tex V wrap seam

LIB3DS_FACE_SELECT_3 

Bit 13: Selection of the face in selection 3

LIB3DS_FACE_SELECT_2 

Bit 14: Selection of the face in selection 2

LIB3DS_FACE_SELECT_1 

Bit 15: Selection of the face in selection 1

Definition at line 340 of file lib3ds.h.

Enumerator
LIB3DS_SEEK_SET 
LIB3DS_SEEK_CUR 
LIB3DS_SEEK_END 

Definition at line 43 of file lib3ds.h.

Enumerator
LIB3DS_KEY_USE_TENS 
LIB3DS_KEY_USE_CONT 
LIB3DS_KEY_USE_BIAS 
LIB3DS_KEY_USE_EASE_TO 
LIB3DS_KEY_USE_EASE_FROM 

Definition at line 418 of file lib3ds.h.

Enumerator
LIB3DS_LAYOUT_SINGLE 
LIB3DS_LAYOUT_TWO_PANE_VERT_SPLIT 
LIB3DS_LAYOUT_TWO_PANE_HORIZ_SPLIT 
LIB3DS_LAYOUT_FOUR_PANE 
LIB3DS_LAYOUT_THREE_PANE_LEFT_SPLIT 
LIB3DS_LAYOUT_THREE_PANE_BOTTOM_SPLIT 
LIB3DS_LAYOUT_THREE_PANE_RIGHT_SPLIT 
LIB3DS_LAYOUT_THREE_PANE_TOP_SPLIT 
LIB3DS_LAYOUT_THREE_PANE_VERT_SPLIT 
LIB3DS_LAYOUT_THREE_PANE_HORIZ_SPLIT 
LIB3DS_LAYOUT_FOUR_PANE_LEFT_SPLIT 
LIB3DS_LAYOUT_FOUR_PANE_RIGHT_SPLIT 

Definition at line 126 of file lib3ds.h.

Enumerator
LIB3DS_LOG_ERROR 
LIB3DS_LOG_WARN 
LIB3DS_LOG_INFO 
LIB3DS_LOG_DEBUG 

Definition at line 49 of file lib3ds.h.

Enumerator
LIB3DS_MAP_NONE 
LIB3DS_MAP_PLANAR 
LIB3DS_MAP_CYLINDRICAL 
LIB3DS_MAP_SPHERICAL 

Definition at line 331 of file lib3ds.h.

Enumerator
LIB3DS_NODE_HIDDEN 
LIB3DS_NODE_SHOW_PATH 
LIB3DS_NODE_SMOOTHING 
LIB3DS_NODE_MOTION_BLUR 
LIB3DS_NODE_MORPH_MATERIALS 

Definition at line 397 of file lib3ds.h.

Enumerator
LIB3DS_NODE_AMBIENT_COLOR 
LIB3DS_NODE_MESH_INSTANCE 
LIB3DS_NODE_CAMERA 
LIB3DS_NODE_CAMERA_TARGET 
LIB3DS_NODE_OMNILIGHT 
LIB3DS_NODE_SPOTLIGHT 
LIB3DS_NODE_SPOTLIGHT_TARGET 

Definition at line 387 of file lib3ds.h.

Object flags for cameras, lights and meshes

Enumerator
LIB3DS_OBJECT_HIDDEN 
LIB3DS_OBJECT_VIS_LOFTER 
LIB3DS_OBJECT_DOESNT_CAST 
LIB3DS_OBJECT_MATTE 
LIB3DS_OBJECT_DONT_RCVSHADOW 
LIB3DS_OBJECT_FAST 
LIB3DS_OBJECT_FROZEN 

Definition at line 272 of file lib3ds.h.

Enumerator
LIB3DS_SHADING_WIRE_FRAME 
LIB3DS_SHADING_FLAT 
LIB3DS_SHADING_GOURAUD 
LIB3DS_SHADING_PHONG 
LIB3DS_SHADING_METAL 

Definition at line 215 of file lib3ds.h.

Enumerator
LIB3DS_TEXTURE_DECALE 
LIB3DS_TEXTURE_MIRROR 
LIB3DS_TEXTURE_NEGATE 
LIB3DS_TEXTURE_NO_TILE 
LIB3DS_TEXTURE_SUMMED_AREA 
LIB3DS_TEXTURE_ALPHA_SOURCE 
LIB3DS_TEXTURE_TINT 
LIB3DS_TEXTURE_IGNORE_ALPHA 
LIB3DS_TEXTURE_RGB_TINT 

Definition at line 177 of file lib3ds.h.

Enumerator
LIB3DS_TRACK_REPEAT 
LIB3DS_TRACK_SMOOTH 
LIB3DS_TRACK_LOCK_X 
LIB3DS_TRACK_LOCK_Y 
LIB3DS_TRACK_LOCK_Z 
LIB3DS_TRACK_UNLINK_X 
LIB3DS_TRACK_UNLINK_Y 
LIB3DS_TRACK_UNLINK_Z 

Definition at line 444 of file lib3ds.h.

Enumerator
LIB3DS_TRACK_BOOL 
LIB3DS_TRACK_FLOAT 
LIB3DS_TRACK_VECTOR 
LIB3DS_TRACK_QUAT 

Definition at line 437 of file lib3ds.h.

Enumerator
LIB3DS_VIEW_NOT_USED 
LIB3DS_VIEW_TOP 
LIB3DS_VIEW_BOTTOM 
LIB3DS_VIEW_LEFT 
LIB3DS_VIEW_RIGHT 
LIB3DS_VIEW_FRONT 
LIB3DS_VIEW_BACK 
LIB3DS_VIEW_USER 
LIB3DS_VIEW_SPOTLIGHT 
LIB3DS_VIEW_CAMERA 

Definition at line 112 of file lib3ds.h.

Function Documentation

LIB3DSAPI void lib3ds_camera_free ( Lib3dsCamera camera)

Free a Lib3dsCamera object and all of its resources.

Parameters
cameraLib3dsCamera object to be freed.

Definition at line 54 of file lib3ds_camera.c.

References free, and memset.

Referenced by lib3ds_file_remove_camera(), and lib3ds_file_reserve_cameras().

LIB3DSAPI Lib3dsCamera* lib3ds_camera_new ( const char *  name)

Return a new Lib3dsCamera object.

Object is initialized with the given name and fov=45. All other values are 0.

Parameters
nameName of this camera. Must not be NULL. Must be < 64 characters.
Returns
Lib3dsCamera object or NULL on failure.

Definition at line 32 of file lib3ds_camera.c.

References assert, calloc, Lib3dsCamera::fov, and Lib3dsCamera::name.

Referenced by named_object_read().

LIB3DSAPI void lib3ds_file_append_node ( Lib3dsFile file,
Lib3dsNode node,
Lib3dsNode parent 
)
LIB3DSAPI void lib3ds_file_bounding_box_of_nodes ( Lib3dsFile file,
int  include_meshes,
int  include_cameras,
int  include_lights,
float  bmin[3],
float  bmax[3],
float  matrix[4][4] 
)

This function computes the bounding box of mesh, camera and light instances defined in the Keyframer.

Parameters
fileThe Lib3dsFile object to be examined.
include_meshesInclude meshes in bounding box calculation.
include_camerasInclude cameras in bounding box calculation.
include_lightsInclude lights in bounding box calculation.
bminReturned minimum x,y,z values.
bmaxReturned maximum x,y,z values.
matrixA matrix describing the coordinate system to calculate the bounding box in.

Definition at line 1394 of file lib3ds_file.c.

References file_bounding_box_of_nodes_impl(), lib3ds_matrix_copy(), lib3ds_matrix_identity(), Lib3dsNode::next, and Lib3dsFile::nodes.

LIB3DSAPI void lib3ds_file_bounding_box_of_objects ( Lib3dsFile file,
int  include_meshes,
int  include_cameras,
int  include_lights,
float  bmin[3],
float  bmax[3] 
)

This function computes the bounding box of meshes, cameras and lights defined in the 3D editor.

Parameters
fileThe Lib3dsFile object to be examined.
include_meshesInclude meshes in bounding box calculation.
include_camerasInclude cameras in bounding box calculation.
include_lightsInclude lights in bounding box calculation.
bminReturned minimum x,y,z values.
bmaxReturned maximum x,y,z values.

Definition at line 1283 of file lib3ds_file.c.

References Lib3dsFile::cameras, i, lib3ds_mesh_bounding_box(), lib3ds_vector_max(), lib3ds_vector_min(), Lib3dsFile::lights, Lib3dsFile::meshes, Lib3dsFile::ncameras, Lib3dsFile::nmeshes, Lib3dsCamera::position, Lib3dsLight::position, Lib3dsLight::spot_light, Lib3dsCamera::target, and Lib3dsLight::target.

LIB3DSAPI int lib3ds_file_camera_by_name ( Lib3dsFile file,
const char *  name 
)

Definition at line 985 of file lib3ds_file.c.

References assert, Lib3dsFile::cameras, i, Lib3dsCamera::name, and Lib3dsFile::ncameras.

LIB3DSAPI void lib3ds_file_eval ( Lib3dsFile file,
float  t 
)

Evaluate all of the nodes in this Lib3dsFile object.

Parameters
fileThe Lib3dsFile object to be evaluated.
ttime value, between 0. and file->frames
See Also
lib3ds_node_eval

Definition at line 214 of file lib3ds_file.c.

References lib3ds_node_eval(), Lib3dsNode::next, and Lib3dsFile::nodes.

Referenced by Zeni::Model::set_keyframe().

LIB3DSAPI void lib3ds_file_free ( Lib3dsFile file)

Free a Lib3dsFile object and all of its resources.

Parameters
fileThe Lib3dsFile object to be freed.

Definition at line 187 of file lib3ds_file.c.

References assert, free, lib3ds_file_reserve_cameras(), lib3ds_file_reserve_lights(), lib3ds_file_reserve_materials(), lib3ds_file_reserve_meshes(), lib3ds_node_free(), Lib3dsNode::next, Lib3dsFile::nodes, and TRUE.

Referenced by Zeni::Model::~Model().

LIB3DSAPI void lib3ds_file_insert_camera ( Lib3dsFile file,
Lib3dsCamera camera,
int  index 
)
LIB3DSAPI void lib3ds_file_insert_light ( Lib3dsFile file,
Lib3dsLight light,
int  index 
)
LIB3DSAPI void lib3ds_file_insert_material ( Lib3dsFile file,
Lib3dsMaterial material,
int  index 
)
LIB3DSAPI void lib3ds_file_insert_mesh ( Lib3dsFile file,
Lib3dsMesh mesh,
int  index 
)
LIB3DSAPI void lib3ds_file_insert_node ( Lib3dsFile file,
Lib3dsNode node,
Lib3dsNode at 
)
LIB3DSAPI int lib3ds_file_light_by_name ( Lib3dsFile file,
const char *  name 
)

Definition at line 1021 of file lib3ds_file.c.

References assert, i, Lib3dsFile::lights, Lib3dsLight::name, and Lib3dsFile::nlights.

LIB3DSAPI int lib3ds_file_material_by_name ( Lib3dsFile file,
const char *  name 
)

Definition at line 949 of file lib3ds_file.c.

References assert, i, Lib3dsFile::materials, Lib3dsMaterial::name, and Lib3dsFile::nmaterials.

Referenced by face_array_read().

LIB3DSAPI int lib3ds_file_mesh_by_name ( Lib3dsFile file,
const char *  name 
)
LIB3DSAPI Lib3dsMesh* lib3ds_file_mesh_for_node ( Lib3dsFile file,
Lib3dsNode node 
)
LIB3DSAPI void lib3ds_file_minmax_node_id ( Lib3dsFile file,
unsigned short *  min_id,
unsigned short *  max_id 
)

Definition at line 1266 of file lib3ds_file.c.

References file_minmax_node_id_impl(), Lib3dsNode::next, and Lib3dsFile::nodes.

LIB3DSAPI Lib3dsFile* lib3ds_file_new ( )

Creates and returns a new, empty Lib3dsFile object.

Returns
A pointer to the Lib3dsFile structure. If the structure cannot be allocated, NULL is returned.

Definition at line 160 of file lib3ds_file.c.

References calloc, Lib3dsFile::current_frame, file, Lib3dsFile::frames, Lib3dsFile::keyf_revision, Lib3dsFile::master_scale, Lib3dsFile::mesh_version, Lib3dsFile::name, Lib3dsFile::segment_from, and Lib3dsFile::segment_to.

Referenced by lib3ds_file_open().

LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_id ( Lib3dsFile file,
uint16_t  node_id 
)

Return a node object by id.

This function performs a recursive search for the specified node.

Parameters
fileThe Lib3dsFile to be searched.
node_idThe target node id.
Returns
A pointer to the first matching node, or NULL if not found.
See Also
lib3ds_node_by_id

Definition at line 1130 of file lib3ds_file.c.

References assert, lib3ds_node_by_id(), Lib3dsNode::next, Lib3dsNode::node_id, and Lib3dsFile::nodes.

LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_name ( Lib3dsFile file,
const char *  name,
Lib3dsNodeType  type 
)

Return a node object by name and type.

This function performs a recursive search for the specified node. Both name and type must match.

Parameters
fileThe Lib3dsFile to be searched.
nameThe target node name.
typeThe target node type
Returns
A pointer to the first matching node, or NULL if not found.
See Also
lib3ds_node_by_name

Definition at line 1100 of file lib3ds_file.c.

References assert, lib3ds_node_by_name(), Lib3dsNode::name, Lib3dsNode::next, Lib3dsFile::nodes, and Lib3dsNode::type.

LIB3DSAPI Lib3dsFile* lib3ds_file_open ( const char *  filename)

Loads a .3DS file from disk into memory.

Parameters
filenameThe filename of the .3DS file
Returns
A pointer to the Lib3dsFile structure containing the data of the .3DS file. If the .3DS file can not be loaded NULL is returned.
Note
To free the returned structure use lib3ds_free.
See Also
lib3ds_file_save
lib3ds_file_new
lib3ds_file_free

Definition at line 83 of file lib3ds_file.c.

References file, fileio_read_func(), fileio_seek_func(), fileio_tell_func(), fileio_write_func(), free, lib3ds_file_new(), lib3ds_file_read(), Lib3dsIo::log_func, memset, NULL, Lib3dsIo::read_func, Lib3dsIo::seek_func, Lib3dsIo::self, Lib3dsIo::tell_func, and Lib3dsIo::write_func.

LIB3DSAPI int lib3ds_file_read ( Lib3dsFile file,
Lib3dsIo io 
)

Read 3ds file data into a Lib3dsFile object.

Parameters
fileThe Lib3dsFile object to be filled.
ioA Lib3dsIo object previously set up by the caller.
Returns
LIB3DS_TRUE on success, LIB3DS_FALSE on failure.

Definition at line 595 of file lib3ds_file.c.

References CHK_CMAGIC, CHK_KFDATA, CHK_M3D_VERSION, CHK_M3DMAGIC, CHK_MDATA, CHK_MLIBMAGIC, Lib3dsChunk::chunk, chunk, FALSE, if(), Lib3dsIo::impl, Lib3dsIoImpl::jmpbuf, kfdata_read(), lib3ds_chunk_read_end(), lib3ds_chunk_read_next(), lib3ds_chunk_read_reset(), lib3ds_chunk_read_start(), lib3ds_chunk_unknown(), lib3ds_io_cleanup(), lib3ds_io_read_dword(), lib3ds_io_setup(), mdata_read(), memset, Lib3dsFile::mesh_version, and TRUE.

Referenced by lib3ds_file_open().

LIB3DSAPI void lib3ds_file_remove_camera ( Lib3dsFile file,
int  index 
)
LIB3DSAPI void lib3ds_file_remove_light ( Lib3dsFile file,
int  index 
)
LIB3DSAPI void lib3ds_file_remove_material ( Lib3dsFile file,
int  index 
)
LIB3DSAPI void lib3ds_file_remove_mesh ( Lib3dsFile file,
int  index 
)
LIB3DSAPI void lib3ds_file_remove_node ( Lib3dsFile file,
Lib3dsNode node 
)

Remove a node from the a Lib3dsFile object.

Parameters
fileThe Lib3dsFile object to be modified.
nodeThe Lib3dsNode object to be removed from file
Returns
LIB3DS_TRUE on success, LIB3DS_FALSE if node is not found in file

Definition at line 1211 of file lib3ds_file.c.

References Lib3dsNode::childs, Lib3dsNode::next, Lib3dsFile::nodes, and Lib3dsNode::parent.

LIB3DSAPI void lib3ds_file_reserve_cameras ( Lib3dsFile file,
int  size,
int  force 
)
LIB3DSAPI void lib3ds_file_reserve_lights ( Lib3dsFile file,
int  size,
int  force 
)
LIB3DSAPI void lib3ds_file_reserve_materials ( Lib3dsFile file,
int  size,
int  force 
)
LIB3DSAPI void lib3ds_file_reserve_meshes ( Lib3dsFile file,
int  size,
int  force 
)
LIB3DSAPI int lib3ds_file_save ( Lib3dsFile file,
const char *  filename 
)

Saves a .3DS file from memory to disk.

Parameters
fileA pointer to a Lib3dsFile structure containing the the data that should be stored.
filenameThe filename of the .3DS file to store the data in.
Returns
TRUE on success, FALSE otherwise.
See Also
lib3ds_file_open

Definition at line 129 of file lib3ds_file.c.

References FALSE, fileio_read_func(), fileio_seek_func(), fileio_tell_func(), fileio_write_func(), lib3ds_file_write(), Lib3dsIo::log_func, memset, NULL, Lib3dsIo::read_func, Lib3dsIo::seek_func, Lib3dsIo::self, Lib3dsIo::tell_func, and Lib3dsIo::write_func.

LIB3DSAPI int lib3ds_file_write ( Lib3dsFile file,
Lib3dsIo io 
)

Write 3ds file data from a Lib3dsFile object to a file.

Parameters
fileThe Lib3dsFile object to be written.
ioA Lib3dsIo object previously set up by the caller.
Returns
LIB3DS_TRUE on success, LIB3DS_FALSE on failure.

Definition at line 892 of file lib3ds_file.c.

References CHK_M3D_VERSION, CHK_M3DMAGIC, Lib3dsChunk::chunk, FALSE, if(), Lib3dsIo::impl, Lib3dsIoImpl::jmpbuf, kfdata_write(), lib3ds_chunk_write(), lib3ds_chunk_write_end(), lib3ds_chunk_write_start(), lib3ds_io_cleanup(), lib3ds_io_setup(), lib3ds_io_write_dword(), mdata_write(), memset, Lib3dsFile::mesh_version, Lib3dsChunk::size, and TRUE.

Referenced by lib3ds_file_save().

LIB3DSAPI void lib3ds_light_free ( Lib3dsLight mesh)

Definition at line 38 of file lib3ds_light.c.

References free, and memset.

Referenced by lib3ds_file_remove_light(), and lib3ds_file_reserve_lights().

LIB3DSAPI Lib3dsLight* lib3ds_light_new ( const char *  name)

Definition at line 22 of file lib3ds_light.c.

References assert, calloc, light, and Lib3dsLight::name.

Referenced by named_object_read().

LIB3DSAPI void lib3ds_material_free ( Lib3dsMaterial material)

Definition at line 79 of file lib3ds_material.c.

References free, and memset.

Referenced by lib3ds_file_remove_material(), and lib3ds_file_reserve_materials().

LIB3DSAPI void lib3ds_math_cubic_interp ( float *  v,
float *  a,
float *  p,
float *  q,
float *  b,
int  n,
float  t 
)

Computes a point on a n-dimensional cubic hermite spline.

Parameters
v[out] Result
a[in] First point of the spline.
p[in] Tangent at the first point of the spline.
q[in] Tangent at the second point of the spline.
b[in] Second point of the spline.
n[in] Dimension
t[in] Parameter value [0...1]

Definition at line 51 of file lib3ds_math.c.

References i.

Referenced by track_eval_linear().

LIB3DSAPI float lib3ds_math_ease ( float  fp,
float  fc,
float  fn,
float  ease_from,
float  ease_to 
)

Calculates the ease in/out function. See Lib3dsKey for details.

Parameters
fpPrevious frame number.
fcCurrent frame number.
fnNext frame number.
ease_fromEase in value [0, 1.0]
ease_toEase out value [0, 1.0]

Definition at line 22 of file lib3ds_math.c.

LIB3DSAPI void lib3ds_matrix_add ( float  m[4][4],
float  a[4][4],
float  b[4][4] 
)

Add two matrices.

Definition at line 98 of file lib3ds_matrix.c.

References i, and j.

LIB3DSAPI void lib3ds_matrix_camera ( float  matrix[4][4],
float  pos[3],
float  tgt[3],
float  roll 
)

Compute a camera matrix based on position, target and roll.

Generates a translate/rotate matrix that maps world coordinates to camera coordinates. Resulting matrix does not include perspective transform.

Parameters
matrixDestination matrix.
posCamera position
tgtCamera target
rollRoll angle

Definition at line 423 of file lib3ds_matrix.c.

References lib3ds_matrix_identity(), lib3ds_matrix_mult(), lib3ds_matrix_rotate(), lib3ds_matrix_translate(), lib3ds_vector_cross(), lib3ds_vector_normalize(), and lib3ds_vector_sub().

LIB3DSAPI void lib3ds_matrix_copy ( float  dest[4][4],
float  src[4][4] 
)
LIB3DSAPI float lib3ds_matrix_det ( float  m[4][4])

Find determinant of a matrix.

Definition at line 191 of file lib3ds_matrix.c.

References det3x3().

Referenced by lib3ds_mesh_read(), and point_array_write().

LIB3DSAPI void lib3ds_matrix_identity ( float  m[4][4])

Set a matrix to identity.

Parameters
mMatrix to be set.

Definition at line 42 of file lib3ds_matrix.c.

References i, and j.

Referenced by lib3ds_file_bounding_box_of_nodes(), lib3ds_matrix_camera(), lib3ds_mesh_new(), lib3ds_mesh_read(), lib3ds_node_eval(), and lib3ds_node_new().

LIB3DSAPI int lib3ds_matrix_inv ( float  m[4][4])

Invert a matrix in place.

Parameters
mMatrix to invert.
Returns
LIB3DS_TRUE on success, LIB3DS_FALSE on failure.

GGemsII, K.Wu, Fast Matrix Inversion

Definition at line 229 of file lib3ds_matrix.c.

References fabs(), FALSE, i, j, k, LIB3DS_EPSILON, and TRUE.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_mesh_read(), and point_array_write().

LIB3DSAPI void lib3ds_matrix_mult ( float  m[4][4],
float  a[4][4],
float  b[4][4] 
)

Multiplies a matrix by a second one (m = m * n).

Definition at line 132 of file lib3ds_matrix.c.

References i, j, k, and memcpy.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_matrix_camera(), lib3ds_matrix_rotate_quat(), lib3ds_mesh_read(), lib3ds_node_eval(), and point_array_write().

LIB3DSAPI void lib3ds_matrix_neg ( float  m[4][4])

Negate a matrix – all elements negated.

Definition at line 65 of file lib3ds_matrix.c.

References i, and j.

LIB3DSAPI void lib3ds_matrix_rotate ( float  m[4][4],
float  angle,
float  ax,
float  ay,
float  az 
)

Apply a rotation about an arbitrary axis to a matrix.

Definition at line 400 of file lib3ds_matrix.c.

References lib3ds_matrix_rotate_quat(), lib3ds_quat_axis_angle(), and lib3ds_vector_make().

Referenced by lib3ds_matrix_camera().

LIB3DSAPI void lib3ds_matrix_rotate_quat ( float  m[4][4],
float  q[4] 
)

Apply a rotation about an arbitrary axis to a matrix.

Definition at line 356 of file lib3ds_matrix.c.

References fabs(), LIB3DS_EPSILON, lib3ds_matrix_mult(), and R.

Referenced by lib3ds_matrix_rotate(), and lib3ds_node_eval().

LIB3DSAPI void lib3ds_matrix_scalar ( float  m[4][4],
float  k 
)

Multiply a matrix by a scalar.

Parameters
mMatrix to be set.
kScalar.

Definition at line 155 of file lib3ds_matrix.c.

References i, j, and k.

LIB3DSAPI void lib3ds_matrix_scale ( float  m[4][4],
float  x,
float  y,
float  z 
)

Apply scale factors to a matrix.

Definition at line 341 of file lib3ds_matrix.c.

References i.

Referenced by lib3ds_mesh_read(), lib3ds_node_eval(), and point_array_write().

LIB3DSAPI void lib3ds_matrix_sub ( float  m[4][4],
float  a[4][4],
float  b[4][4] 
)

Subtract two matrices.

Parameters
mResult.
aAddend.
bMinuend.

Definition at line 117 of file lib3ds_matrix.c.

References i, and j.

LIB3DSAPI void lib3ds_matrix_translate ( float  m[4][4],
float  x,
float  y,
float  z 
)

Apply a translation to a matrix.

Definition at line 328 of file lib3ds_matrix.c.

References i.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_matrix_camera(), and lib3ds_node_eval().

LIB3DSAPI void lib3ds_matrix_transpose ( float  m[4][4])

Transpose a matrix in place.

Definition at line 80 of file lib3ds_matrix.c.

References i, and j.

LIB3DSAPI void lib3ds_matrix_zero ( float  m[4][4])

Clear a matrix to all zeros.

Parameters
mMatrix to be cleared.

Definition at line 27 of file lib3ds_matrix.c.

References i, and j.

LIB3DSAPI void lib3ds_mesh_bounding_box ( Lib3dsMesh mesh,
float  bmin[3],
float  bmax[3] 
)

Find the bounding box of a mesh object.

Parameters
meshThe mesh object
bminReturned bounding box
bmaxReturned bounding box

Definition at line 105 of file lib3ds_mesh.c.

References i, lib3ds_vector_max(), lib3ds_vector_min(), Lib3dsMesh::nvertices, and Lib3dsMesh::vertices.

Referenced by lib3ds_file_bounding_box_of_objects().

LIB3DSAPI void lib3ds_mesh_calculate_face_normals ( Lib3dsMesh mesh,
float(*)  face_normals[3] 
)
LIB3DSAPI void lib3ds_mesh_calculate_vertex_normals ( Lib3dsMesh mesh,
float(*)  normals[3] 
)

Calculates the vertex normals corresponding to the smoothing group settings for each face of a mesh.

Parameters
meshA pointer to the mesh to calculate the normals for.
normalsA pointer to a buffer to store the calculated normals. The buffer must have the size: 3*3*sizeof(float)*mesh->nfaces.

To allocate the normal buffer do for example the following:

* Lib3dsVector *normals = malloc(3*3*sizeof(float)*mesh->nfaces);
*

To access the normal of the i-th vertex of the j-th face do the following:

* normals[3*j+i]
*

Definition at line 163 of file lib3ds_mesh.c.

References assert, calloc, Lib3dsMesh::faces, free, i, Lib3dsFace::index, j, lib3ds_vector_add(), lib3ds_vector_copy(), lib3ds_vector_cross(), lib3ds_vector_dot(), lib3ds_vector_length(), lib3ds_vector_normalize(), lib3ds_vector_scalar_mul(), lib3ds_vector_sub(), lib3ds_vector_zero(), malloc, Lib3dsMesh::nfaces, Lib3dsMesh::nvertices, Lib3dsFace::smoothing_group, and Lib3dsMesh::vertices.

LIB3DSAPI void lib3ds_mesh_free ( Lib3dsMesh mesh)

Free a mesh object and all of its resources.

Parameters
meshMesh object to be freed.

Definition at line 57 of file lib3ds_mesh.c.

References free, lib3ds_mesh_resize_faces(), lib3ds_mesh_resize_vertices(), and memset.

Referenced by lib3ds_file_remove_mesh(), and lib3ds_file_reserve_meshes().

LIB3DSAPI Lib3dsMesh* lib3ds_mesh_new ( const char *  name)

Create and return a new empty mesh object.

Mesh is initialized with the name and an identity matrix; all other fields are zero.

See Lib3dsFaceFlag for definitions of per-face flags.

Parameters
nameMesh name. Must not be NULL. Must be < 64 characters.
Returns
mesh object or NULL on error.

Definition at line 34 of file lib3ds_mesh.c.

References assert, calloc, LIB3DS_MAP_NONE, lib3ds_matrix_identity(), Lib3dsMesh::map_type, Lib3dsMesh::matrix, and Lib3dsMesh::name.

Referenced by named_object_read().

LIB3DSAPI void lib3ds_mesh_resize_faces ( Lib3dsMesh mesh,
int  nfaces 
)
LIB3DSAPI void lib3ds_mesh_resize_vertices ( Lib3dsMesh mesh,
int  nvertices,
int  use_texcos,
int  use_flags 
)
LIB3DSAPI Lib3dsNode* lib3ds_node_by_id ( Lib3dsNode node,
uint16_t  node_id 
)

Return a node object by id.

This function performs a recursive search for the specified node.

Parameters
nodeThe parent node for the search
node_idThe target node id.
Returns
A pointer to the first matching node, or NULL if not found.

Definition at line 518 of file lib3ds_node.c.

References Lib3dsNode::childs, lib3ds_node_by_id(), Lib3dsNode::next, and Lib3dsNode::node_id.

Referenced by lib3ds_file_node_by_id(), and lib3ds_node_by_id().

LIB3DSAPI Lib3dsNode* lib3ds_node_by_name ( Lib3dsNode node,
const char *  name,
Lib3dsNodeType  type 
)

Return a node object by name and type.

This function performs a recursive search for the specified node. Both name and type must match.

Parameters
nodeThe parent node for the search
nameThe target node name.
typeThe target node type
Returns
A pointer to the first matching node, or NULL if not found.

Definition at line 491 of file lib3ds_node.c.

References Lib3dsNode::childs, lib3ds_node_by_name(), Lib3dsNode::name, Lib3dsNode::next, and Lib3dsNode::type.

Referenced by lib3ds_file_node_by_name(), and lib3ds_node_by_name().

LIB3DSAPI void lib3ds_node_eval ( Lib3dsNode node,
float  t 
)

Evaluate an animation node.

Recursively sets node and its children to their appropriate values for this point in the animation.

Parameters
nodeNode to be evaluated.
ttime value, between 0. and file->frames

Definition at line 362 of file lib3ds_node.c.

References assert, Lib3dsNode::childs, Lib3dsAmbientColorNode::color, Lib3dsOmnilightNode::color, Lib3dsSpotlightNode::color, Lib3dsAmbientColorNode::color_track, Lib3dsOmnilightNode::color_track, Lib3dsSpotlightNode::color_track, Lib3dsSpotlightNode::falloff, Lib3dsSpotlightNode::falloff_track, Lib3dsCameraNode::fov, Lib3dsCameraNode::fov_track, Lib3dsMeshInstanceNode::hide, Lib3dsMeshInstanceNode::hide_track, Lib3dsSpotlightNode::hotspot, Lib3dsSpotlightNode::hotspot_track, lib3ds_matrix_copy(), lib3ds_matrix_identity(), lib3ds_matrix_mult(), lib3ds_matrix_rotate_quat(), lib3ds_matrix_scale(), lib3ds_matrix_translate(), LIB3DS_NODE_AMBIENT_COLOR, LIB3DS_NODE_CAMERA, LIB3DS_NODE_CAMERA_TARGET, lib3ds_node_eval(), LIB3DS_NODE_MESH_INSTANCE, LIB3DS_NODE_OMNILIGHT, LIB3DS_NODE_SPOTLIGHT, LIB3DS_NODE_SPOTLIGHT_TARGET, lib3ds_track_eval_bool(), lib3ds_track_eval_float(), lib3ds_track_eval_quat(), lib3ds_track_eval_vector(), Lib3dsNode::matrix, Lib3dsNode::next, Lib3dsTrack::nkeys, Lib3dsNode::parent, Lib3dsMeshInstanceNode::pos, Lib3dsCameraNode::pos, Lib3dsTargetNode::pos, Lib3dsOmnilightNode::pos, Lib3dsSpotlightNode::pos, Lib3dsMeshInstanceNode::pos_track, Lib3dsCameraNode::pos_track, Lib3dsTargetNode::pos_track, Lib3dsOmnilightNode::pos_track, Lib3dsSpotlightNode::pos_track, Lib3dsCameraNode::roll, Lib3dsSpotlightNode::roll, Lib3dsCameraNode::roll_track, Lib3dsSpotlightNode::roll_track, Lib3dsMeshInstanceNode::rot, Lib3dsMeshInstanceNode::rot_track, Lib3dsMeshInstanceNode::scl, Lib3dsMeshInstanceNode::scl_track, and Lib3dsNode::type.

Referenced by lib3ds_file_eval(), and lib3ds_node_eval().

LIB3DSAPI void lib3ds_node_free ( Lib3dsNode node)

Free a node and all of its resources.

Parameters
nodeLib3dsNode object to be freed.

Definition at line 346 of file lib3ds_node.c.

References assert, and free_node_and_childs().

Referenced by lib3ds_file_free(), and lib3ds_io_cleanup().

LIB3DSAPI Lib3dsTargetNode* lib3ds_node_new_spotlight_target ( Lib3dsLight light)
LIB3DSAPI void lib3ds_quat_axis_angle ( float  c[4],
float  axis[3],
float  angle 
)

Compute a quaternion from axis and angle.

Parameters
cComputed quaternion
axisRotation axis
angleAngle of rotation, radians.

Definition at line 51 of file lib3ds_quat.c.

References cos(), LIB3DS_EPSILON, and sin().

Referenced by lib3ds_matrix_rotate(), lib3ds_track_eval_quat(), quat_for_index(), rot_key_setup(), and setup_segment().

LIB3DSAPI void lib3ds_quat_cnj ( float  c[4])

Compute the conjugate of a quaternion

Definition at line 86 of file lib3ds_quat.c.

References i.

LIB3DSAPI void lib3ds_quat_copy ( float  dest[4],
float  src[4] 
)

Copy a quaternion.

Definition at line 35 of file lib3ds_quat.c.

References i.

Referenced by lib3ds_quat_ln_dif(), lib3ds_quat_mul(), and rot_key_setup().

LIB3DSAPI float lib3ds_quat_dot ( float  a[4],
float  b[4] 
)

Compute the dot-product of a quaternion.

Definition at line 170 of file lib3ds_quat.c.

Referenced by rot_key_setup().

LIB3DSAPI void lib3ds_quat_exp ( float  c[4])

Definition at line 214 of file lib3ds_quat.c.

References cos(), fabs(), i, LIB3DS_EPSILON, and sin().

Referenced by lib3ds_quat_tangent(), and rot_key_setup().

LIB3DSAPI void lib3ds_quat_identity ( float  c[4])

Set a quaternion to Identity

Definition at line 25 of file lib3ds_quat.c.

Referenced by lib3ds_track_eval_quat(), quat_for_index(), and setup_segment().

LIB3DSAPI void lib3ds_quat_inv ( float  c[4])

Compute the inverse of a quaternion.

Definition at line 149 of file lib3ds_quat.c.

References fabs(), LIB3DS_EPSILON, and m.

Referenced by lib3ds_quat_ln_dif().

LIB3DSAPI void lib3ds_quat_ln ( float  c[4])

Definition at line 182 of file lib3ds_quat.c.

References fabs(), i, and LIB3DS_EPSILON.

Referenced by lib3ds_quat_ln_dif(), and rot_key_setup().

LIB3DSAPI void lib3ds_quat_ln_dif ( float  c[4],
float  a[4],
float  b[4] 
)
LIB3DSAPI void lib3ds_quat_mul ( float  c[4],
float  a[4],
float  b[4] 
)

Multiply two quaternions.

Parameters
cResult
a,bInputs

Definition at line 101 of file lib3ds_quat.c.

References lib3ds_quat_copy().

Referenced by lib3ds_quat_ln_dif(), lib3ds_quat_tangent(), quat_for_index(), rot_key_setup(), and setup_segment().

LIB3DSAPI void lib3ds_quat_neg ( float  c[4])

Negate a quaternion

Definition at line 74 of file lib3ds_quat.c.

References i.

Referenced by rot_key_setup().

LIB3DSAPI float lib3ds_quat_norm ( float  c[4])

Definition at line 176 of file lib3ds_quat.c.

LIB3DSAPI void lib3ds_quat_normalize ( float  c[4])

Normalize a quaternion.

Definition at line 128 of file lib3ds_quat.c.

References fabs(), i, LIB3DS_EPSILON, and m.

LIB3DSAPI void lib3ds_quat_scalar ( float  c[4],
float  k 
)

Multiply a quaternion by a scalar.

Definition at line 116 of file lib3ds_quat.c.

References i, and k.

LIB3DSAPI void lib3ds_quat_slerp ( float  c[4],
float  a[4],
float  b[4],
float  t 
)

Definition at line 234 of file lib3ds_quat.c.

References fabs(), i, LIB3DS_EPSILON, and sin().

Referenced by lib3ds_quat_squad().

LIB3DSAPI void lib3ds_quat_squad ( float  c[4],
float  a[4],
float  p[4],
float  q[4],
float  b[4],
float  t 
)

Definition at line 264 of file lib3ds_quat.c.

References lib3ds_quat_slerp().

Referenced by lib3ds_track_eval_quat().

LIB3DSAPI void lib3ds_quat_tangent ( float  c[4],
float  p[4],
float  q[4],
float  n[4] 
)

Definition at line 275 of file lib3ds_quat.c.

References i, lib3ds_quat_exp(), lib3ds_quat_ln_dif(), and lib3ds_quat_mul().

LIB3DSAPI void lib3ds_track_eval_bool ( Lib3dsTrack track,
int b,
float  t 
)

Definition at line 277 of file lib3ds_track.c.

References assert, FALSE, find_index(), LIB3DS_TRACK_BOOL, Lib3dsTrack::nkeys, Lib3dsTrack::type, and u.

Referenced by lib3ds_node_eval().

LIB3DSAPI void lib3ds_track_eval_float ( Lib3dsTrack track,
float *  f,
float  t 
)

Definition at line 347 of file lib3ds_track.c.

References assert, LIB3DS_TRACK_FLOAT, track_eval_linear(), and Lib3dsTrack::type.

Referenced by lib3ds_node_eval().

LIB3DSAPI void lib3ds_track_eval_vector ( Lib3dsTrack track,
float  v[3],
float  t 
)
LIB3DSAPI void lib3ds_track_free ( Lib3dsTrack track)

Definition at line 31 of file lib3ds_track.c.

References assert, free, lib3ds_track_resize(), and memset.

LIB3DSAPI Lib3dsTrack* lib3ds_track_new ( Lib3dsTrackType  type,
int  nkeys 
)

Definition at line 22 of file lib3ds_track.c.

References calloc, lib3ds_track_resize(), and Lib3dsTrack::type.

LIB3DSAPI void lib3ds_vector_add ( float  c[3],
float  a[3],
float  b[3] 
)

Add two vectors.

Parameters
cResult.
aFirst addend.
bSecond addend.

Definition at line 55 of file lib3ds_vector.c.

References i.

Referenced by lib3ds_mesh_calculate_vertex_normals().

LIB3DSAPI void lib3ds_vector_copy ( float  dst[3],
float  src[3] 
)

Copies all components of a vector to another vector.

Parameters
dst[out] The destination vector.
src[in] The source vector.

Definition at line 39 of file lib3ds_vector.c.

References i.

Referenced by lib3ds_mesh_calculate_vertex_normals(), lib3ds_mesh_read(), lib3ds_node_new_ambient_color(), lib3ds_node_new_camera(), lib3ds_node_new_camera_target(), lib3ds_node_new_mesh_instance(), lib3ds_node_new_omnilight(), lib3ds_node_new_spotligf_target(), and lib3ds_node_new_spotlight().

LIB3DSAPI void lib3ds_vector_cross ( float  c[3],
float  a[3],
float  b[3] 
)

Compute cross product.

Parameters
cResult.
aFirst vector.
bSecond vector.

Definition at line 102 of file lib3ds_vector.c.

Referenced by lib3ds_matrix_camera(), lib3ds_mesh_calculate_vertex_normals(), and lib3ds_vector_normal().

LIB3DSAPI float lib3ds_vector_dot ( float  a[3],
float  b[3] 
)

Compute dot product.

Parameters
aFirst vector.
bSecond vector.
Returns
Dot product.

Definition at line 118 of file lib3ds_vector.c.

Referenced by lib3ds_mesh_calculate_vertex_normals().

LIB3DSAPI float lib3ds_vector_length ( float  c[3])

Compute length of vector.

Computes |c| = sqrt(x*x + y*y + z*z)

Parameters
cVector to compute.
Returns
Length of vector.

Definition at line 133 of file lib3ds_vector.c.

Referenced by lib3ds_mesh_calculate_vertex_normals().

LIB3DSAPI void lib3ds_vector_make ( float  c[3],
float  x,
float  y,
float  z 
)

Definition at line 22 of file lib3ds_vector.c.

Referenced by lib3ds_matrix_rotate(), and lib3ds_node_new_mesh_instance().

LIB3DSAPI void lib3ds_vector_max ( float  c[3],
float  a[3] 
)

c[i] = max(c[i], a[i]);

Computes maximum values of x,y,z independently.

Definition at line 232 of file lib3ds_vector.c.

References i.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_file_bounding_box_of_objects(), and lib3ds_mesh_bounding_box().

LIB3DSAPI void lib3ds_vector_min ( float  c[3],
float  a[3] 
)

c[i] = min(c[i], a[i]);

Computes minimum values of x,y,z independently.

Definition at line 216 of file lib3ds_vector.c.

References i.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_file_bounding_box_of_objects(), and lib3ds_mesh_bounding_box().

LIB3DSAPI void lib3ds_vector_neg ( float  c[3])

Negates all components of a vector.

Parameters
cThe Pointer to the vector.
LIB3DSAPI void lib3ds_vector_normal ( float  n[3],
float  a[3],
float  b[3],
float  c[3] 
)

Compute a vector normal to two line segments.

Computes the normal vector to the lines b-a and b-c.

Parameters
nReturned normal vector.
aEndpoint of first line.
bBase point of both lines.
cEndpoint of second line.

Definition at line 182 of file lib3ds_vector.c.

References lib3ds_vector_cross(), lib3ds_vector_normalize(), and lib3ds_vector_sub().

Referenced by lib3ds_mesh_calculate_face_normals().

LIB3DSAPI void lib3ds_vector_normalize ( float  c[3])

Normalize a vector.

Scales a vector so that its length is 1.0.

Parameters
cVector to normalize.

Definition at line 146 of file lib3ds_vector.c.

References fabs(), LIB3DS_EPSILON, and m.

Referenced by lib3ds_matrix_camera(), lib3ds_mesh_calculate_vertex_normals(), and lib3ds_vector_normal().

LIB3DSAPI void lib3ds_vector_scalar_mul ( float  c[3],
float  a[3],
float  k 
)

Multiply a vector by a scalar.

Parameters
cVector to be multiplied.
kScalar.

Definition at line 86 of file lib3ds_vector.c.

References i, and k.

Referenced by lib3ds_mesh_calculate_vertex_normals().

LIB3DSAPI void lib3ds_vector_sub ( float  c[3],
float  a[3],
float  b[3] 
)

Subtract two vectors.

Parameters
cResult.
aAddend.
bMinuend.

Definition at line 71 of file lib3ds_vector.c.

References i.

Referenced by lib3ds_matrix_camera(), lib3ds_mesh_calculate_vertex_normals(), and lib3ds_vector_normal().

LIB3DSAPI void lib3ds_vector_transform ( float  c[3],
float  m[4][4],
float  a[3] 
)

Multiply a point by a transformation matrix.

Applies the given transformation matrix to the given point. With some transformation matrices, a vector may also be transformed.

Parameters
cResult.
mTransformation matrix.
aInput point.

Definition at line 203 of file lib3ds_vector.c.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_mesh_read(), and point_array_write().

LIB3DSAPI void lib3ds_vector_zero ( float  c[3])

Sets all components of a vector to zero.

Parameters
cThe Pointer to the vector.

Definition at line 30 of file lib3ds_vector.c.

References i.

Referenced by file_bounding_box_of_nodes_impl(), lib3ds_mesh_calculate_vertex_normals(), lib3ds_node_new_ambient_color(), and lib3ds_track_eval_vector().