goat3d

changeset 2:f358b482d286

added a couple of stuff in the chunk description
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 18 Aug 2013 23:49:22 +0300
parents e46529a5d057
children 31cf61bfd29d
files src/chunk.h
diffstat 1 files changed, 53 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/src/chunk.h	Sat Aug 17 23:51:24 2013 +0300
     1.2 +++ b/src/chunk.h	Sun Aug 18 23:49:22 2013 +0300
     1.3 @@ -7,10 +7,10 @@
     1.4  
     1.5  	// general purpose chunks
     1.6  	CNK_INT,
     1.7 -	CNK_UINT,
     1.8 +	CNK_INT4,
     1.9  	CNK_FLOAT,
    1.10 -	CNK_VEC3,
    1.11 -	CNK_VEC4,
    1.12 +	CNK_FLOAT3,
    1.13 +	CNK_FLOAT4,
    1.14  	CNK_STRING,
    1.15  
    1.16  	// --- first level chunks ---
    1.17 @@ -21,11 +21,10 @@
    1.18  	CNK_LIGHT_LIST,		// likewise for lights
    1.19  	CNK_CAMERA_LIST,	// likewise for cameras
    1.20  	CNK_NODE_LIST,		// likewise for nodes
    1.21 -	CNK_ANIM_LIST,		// all animations
    1.22  
    1.23  	// --- second level chunks ---
    1.24  	// children of CNK_ENV
    1.25 -	CNK_ENV_AMBIENT,	// ambient color, contains a single CNK_VEC3
    1.26 +	CNK_ENV_AMBIENT,	// ambient color, contains a single CNK_FLOAT3
    1.27  	CNK_ENV_FOG,
    1.28  
    1.29  	// children of CNK_*_LIST
    1.30 @@ -37,18 +36,64 @@
    1.31  
    1.32  	// --- third level chunks ---
    1.33  	// children of CNK_FOG
    1.34 -	CNK_FOG_COLOR,		// fog color, contains a single CNK_VEC3
    1.35 +	CNK_FOG_COLOR,		// fog color, contains a single CNK_FLOAT3
    1.36  	CNK_FOG_EXP,		// fog exponent, contains a single CNK_REAL
    1.37  
    1.38  	// children of CNK_MTL
    1.39  	CNK_MTL_ATTR,		// material attribute, has a CNK_STRING for its name,
    1.40  						// a CNK_MTL_ATTR_VAL, and optionally a CNK_MTL_ATTR_MAP
    1.41  	// children of CNK_MTL_ATTR
    1.42 -	CNK_MTL_ATTR_VAL,	// can have a single CNK_FLOAT, CNK_VEC3, or CNK_VEC4
    1.43 +	CNK_MTL_ATTR_VAL,	// can have a single CNK_FLOAT, CNK_FLOAT3, or CNK_FLOAT4
    1.44  	CNK_MTL_ATTR_MAP,	// has a single CNK_STRING
    1.45  
    1.46  	// children of CNK_MESH
    1.47 -	// TODO...
    1.48 +	CNK_MESH_NAME,			// has a single CNK_STRING
    1.49 +	CNK_MESH_MATERIAL,		// has one of CNK_STRING or CNK_INT to identify the material
    1.50 +	CNK_MESH_VERTEX_LIST,	// has a series of CNK_FLOAT3 chunks
    1.51 +	CNK_MESH_NORMAL_LIST,	// has a series of CNK_FLOAT3 chunks
    1.52 +	CNK_MESH_TANGENT_LIST,	// has a series of CNK_FLOAT3 chunks
    1.53 +	CNK_MESH_TEXCOORD_LIST,	// has a series of CNK_FLOAT3 chunks
    1.54 +	CNK_MESH_SKINWEIGHT_LIST,	// has a series of CNK_FLOAT4 chunks (4 skin weights)
    1.55 +	CNK_MESH_SKINMATRIX_LIST,	// has a series of CNK_INT4 chunks (4 matrix indices)
    1.56 +	CNK_MESH_COLOR_LIST,	// has a series of CNK_FLOAT4 chunks
    1.57 +	CNK_MESH_BONES_LIST,	// has a series of CNK_INT or CNK_STRING chunks identifying the bone nodes
    1.58 +
    1.59 +	// children of CNK_LIGHT
    1.60 +	CNK_LIGHT_NAME,			// has a single CNK_STRING
    1.61 +	CNK_LIGHT_POS,			// has a single CNK_FLOAT3
    1.62 +	CNK_LIGHT_COLOR,		// has a single CNK_FLOAT3
    1.63 +	CNK_LIGHT_ATTEN,		// has a single CNK_FLOAT3 (constant, linear, squared attenuation)
    1.64 +	CNK_LIGHT_DISTANCE,		// has a single CNK_FLOAT
    1.65 +	CNK_LIGHT_DIR,			// a single CNK_FLOAT3 (for spotlights and dir-lights)
    1.66 +	CNK_LIGHT_CONE_INNER,	// single CNK_FLOAT, inner cone angle (for spotlights)
    1.67 +	CNK_LIGHT_CONE_OUTER,	// single CNK_FLOAT, outer cone angle (for spotlights)
    1.68 +
    1.69 +	// children of CNK_CAMERA
    1.70 +	CNK_CAMERA_NAME,		// has a single CNK_STRING
    1.71 +	CNK_CAMERA_POS,			// single CNK_FLOAT3
    1.72 +	CNK_CAMERA_TARGET,		// single CNK_FLOAT3
    1.73 +	CNK_CAMERA_FOV,			// single CNK_FLOAT (field of view in radians)
    1.74 +	CNK_CAMERA_NEARCLIP,	// single CNK_FLOAT (near clipping plane distance)
    1.75 +	CNK_CAMERA_FARCLIP,		// signle CNK_FLOAT (far clipping plane distance)
    1.76 +
    1.77 +	// children of CNK_NODE
    1.78 +	CNK_NODE_NAME,			// node name, a single CNK_STRING
    1.79 +	CNK_NODE_PARENT,		// it can have a CNK_INT or a CNK_STRING to identify the parent node
    1.80 +
    1.81 +	CNK_NODE_MESH,			// it can have a CNK_INT or a CNK_STRING to identify this node's mesh
    1.82 +	CNK_NODE_LIGHT,			// same as CNK_NODE_MESH
    1.83 +	CNK_NODE_CAMERA,		// same as CNK_NODE_MESH
    1.84 +
    1.85 +	CNK_NODE_POS,			// has a CNK_VEC3, position vector
    1.86 +	CNK_NODE_ROT,			// has a CNK_VEC4, rotation quaternion (x, y, z imaginary, w real)
    1.87 +	CNK_NODE_SCALE,			// has a CNK_VEC3, scaling
    1.88 +	CNK_NODE_PIVOT,			// has a CNK_VEC3, pivot point
    1.89 +
    1.90 +	CNK_NODE_MATRIX0,		// has a CNK_VEC4, first matrix row (4x3)
    1.91 +	CNK_NODE_MATRXI1,		// has a CNK_VEC4, second matrix row (4x3)
    1.92 +	CNK_NODE_MATRIX2,		// has a CNK_VEC4, third matrix row (4x3)
    1.93 +
    1.94 +	MAX_NUM_CHUNKS
    1.95  };
    1.96  
    1.97  struct ChunkHeader {