From cb3716ffb584fe0f593b6f1669a8efdba1305104 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 29 Mar 2016 02:16:55 +1000 Subject: Added my version of libg3d and friends. --- .../mimesh/libg3d-0.0.8/include/g3d/Makefile | 470 ++++++++++++++++++ .../mimesh/libg3d-0.0.8/include/g3d/Makefile.am | 21 + .../mimesh/libg3d-0.0.8/include/g3d/Makefile.in | 470 ++++++++++++++++++ .../mimesh/libg3d-0.0.8/include/g3d/config.h | 72 +++ .../mimesh/libg3d-0.0.8/include/g3d/config.h.in | 71 +++ .../mimesh/libg3d-0.0.8/include/g3d/context.h | 149 ++++++ src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h | 44 ++ src/others/mimesh/libg3d-0.0.8/include/g3d/face.h | 98 ++++ src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h | 35 ++ src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h | 325 +++++++++++++ .../mimesh/libg3d-0.0.8/include/g3d/material.h | 64 +++ .../mimesh/libg3d-0.0.8/include/g3d/matrix.h | 189 +++++++ src/others/mimesh/libg3d-0.0.8/include/g3d/model.h | 180 +++++++ .../mimesh/libg3d-0.0.8/include/g3d/object.h | 151 ++++++ .../mimesh/libg3d-0.0.8/include/g3d/plugins.h | 243 +++++++++ .../mimesh/libg3d-0.0.8/include/g3d/primitive.h | 164 +++++++ src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h | 117 +++++ src/others/mimesh/libg3d-0.0.8/include/g3d/read.h | 156 ++++++ .../mimesh/libg3d-0.0.8/include/g3d/stream.h | 541 +++++++++++++++++++++ .../mimesh/libg3d-0.0.8/include/g3d/texture.h | 123 +++++ src/others/mimesh/libg3d-0.0.8/include/g3d/types.h | 478 ++++++++++++++++++ .../mimesh/libg3d-0.0.8/include/g3d/vector.h | 125 +++++ 22 files changed, 4286 insertions(+) create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/config.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/context.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/face.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/material.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/model.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/object.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/read.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/types.h create mode 100644 src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h (limited to 'src/others/mimesh/libg3d-0.0.8/include/g3d') diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile new file mode 100644 index 0000000..524e64c --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile @@ -0,0 +1,470 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# include/g3d/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/libg3d +pkglibdir = $(libdir)/libg3d +pkgincludedir = $(includedir)/libg3d +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +subdir = include/g3d +DIST_COMMON = $(g3dinclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(g3dincludedir)" +g3dincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(g3dinclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf +AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader +AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DBG_CFLAGS = -O2 +DEBUG = 0 +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = +FFLAGS = +GDKPIXBUF_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GDKPIXBUF_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include +GLIB_GENMARSHAL = glib-genmarshal +GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +GLIB_MKENUMS = glib-mkenums +GOBJECT_QUERY = gobject-query +GREP = /bin/grep +GTKDOC_CHECK = /usr/bin/gtkdoc-check +GTK_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +HTML_DIR = ${datadir}/gtk-doc/html +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LEX = flex +LEXLIB = -lfl +LEX_OUTPUT_ROOT = lex.yy +LIBGSF_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgsf-1 +LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 +LIBOBJS = +LIBS = -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBXML2_CFLAGS = -I/usr/include/libxml2 +LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +LN_S = ln -s +LTLIBOBJS = +LTVERSION = 0:8:0 +MAGIC_LIBS = -lmagic +MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo +MATH_LIBS = -lm +MKDIR_P = /bin/mkdir -p +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libg3d +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /usr/bin/pkg-config +PLUGINS_LDFLAGS = -avoid-version -export-dynamic +RANLIB = ranlib +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 0.0.8 +XML2_CONFIG = /usr/bin/xml2-config +XML_CPPFLAGS = -I/usr/include/libxml2 +XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +Z_CFLAGS = +Z_LIBS = -lz +abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/include/g3d +abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/include/g3d +abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = ../.. +top_srcdir = ../.. +g3dincludedir = $(includedir)/g3d +g3dinclude_HEADERS = \ + debug.h \ + g3d.h \ + types.h \ + context.h \ + plugins.h \ + model.h \ + object.h \ + face.h \ + material.h \ + texture.h \ + stream.h \ + read.h \ + iff.h \ + primitive.h \ + vector.h \ + matrix.h \ + quat.h + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/g3d/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/g3d/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status include/g3d/config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-g3dincludeHEADERS: $(g3dinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(g3dincludedir)" || $(MKDIR_P) "$(DESTDIR)$(g3dincludedir)" + @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(g3dincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(g3dincludedir)/$$f'"; \ + $(g3dincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(g3dincludedir)/$$f"; \ + done + +uninstall-g3dincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(g3dincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(g3dincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) config.h +installdirs: + for dir in "$(DESTDIR)$(g3dincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-g3dincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-g3dincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-g3dincludeHEADERS install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-g3dincludeHEADERS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am new file mode 100644 index 0000000..9b31564 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am @@ -0,0 +1,21 @@ +g3dincludedir = $(includedir)/g3d + +g3dinclude_HEADERS = \ + debug.h \ + g3d.h \ + types.h \ + context.h \ + plugins.h \ + model.h \ + object.h \ + face.h \ + material.h \ + texture.h \ + stream.h \ + read.h \ + iff.h \ + primitive.h \ + vector.h \ + matrix.h \ + quat.h + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in new file mode 100644 index 0000000..9b863f4 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in @@ -0,0 +1,470 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/g3d +DIST_COMMON = $(g3dinclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(g3dincludedir)" +g3dincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(g3dinclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBG_CFLAGS = @DBG_CFLAGS@ +DEBUG = @DEBUG@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ +GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ +LIBGSF_LIBS = @LIBGSF_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +MAGIC_LIBS = @MAGIC_LIBS@ +MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +g3dincludedir = $(includedir)/g3d +g3dinclude_HEADERS = \ + debug.h \ + g3d.h \ + types.h \ + context.h \ + plugins.h \ + model.h \ + object.h \ + face.h \ + material.h \ + texture.h \ + stream.h \ + read.h \ + iff.h \ + primitive.h \ + vector.h \ + matrix.h \ + quat.h + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/g3d/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/g3d/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status include/g3d/config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-g3dincludeHEADERS: $(g3dinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(g3dincludedir)" || $(MKDIR_P) "$(DESTDIR)$(g3dincludedir)" + @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(g3dincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(g3dincludedir)/$$f'"; \ + $(g3dincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(g3dincludedir)/$$f"; \ + done + +uninstall-g3dincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(g3dincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(g3dincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) config.h +installdirs: + for dir in "$(DESTDIR)$(g3dincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-g3dincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-g3dincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-g3dincludeHEADERS install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-g3dincludeHEADERS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h new file mode 100644 index 0000000..e3455ba --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h @@ -0,0 +1,72 @@ +/* include/g3d/config.h. Generated from config.h.in by configure. */ +/* include/g3d/config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* have GSF library */ +#define HAVE_LIBGSF 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* have zlib */ +#define HAVE_ZLIB 1 + +/* magic file */ +#define MAGIC_FILENAME "/usr/local/lib/libg3d/libg3d.magic" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Plugin directory */ +#define PLUGIN_DIR "/usr/local/lib/libg3d/plugins" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* use libmagic for file type detection */ +#define USE_LIBMAGIC 1 + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in new file mode 100644 index 0000000..4e99250 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in @@ -0,0 +1,71 @@ +/* include/g3d/config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* have GSF library */ +#undef HAVE_LIBGSF + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* have zlib */ +#undef HAVE_ZLIB + +/* magic file */ +#undef MAGIC_FILENAME + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Plugin directory */ +#undef PLUGIN_DIR + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* use libmagic for file type detection */ +#undef USE_LIBMAGIC + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h new file mode 100644 index 0000000..26b2134 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h @@ -0,0 +1,149 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_CONTEXT_H__ +#define __G3D_CONTEXT_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + + +/** + * SECTION:context + * @short_description: Libg3d initialization and configuration + * @see_also: #G3DContext + * @include: g3d/g3d.h + * + * All state information is saved in the context. It also serves as an + * interface to the application. + */ + + +/** + * g3d_context_new: + * + * Create a new context. This initializes the library (and also the + * plugin system so this has not to be done seperately). + * + * Returns: a valid context, or NULL on failure. + */ +EAPI +G3DContext *g3d_context_new(void); + +/** + * g3d_context_free: + * @context: the context to free + * + * Cleans up the context and the plugin system and frees all reserved + * memory. + */ +EAPI +void g3d_context_free(G3DContext *context); + +/** + * g3d_context_set_bgcolor: + * @context: a valid context + * @r: red component (range: 0.0 .. 1.0) + * @g: green component (range: 0.0 .. 1.0) + * @b: green component (range: 0.0 .. 1.0) + * @a: alpha component + * + * Try to set the background color. This will call a function registered + * with @g3d_context_set_set_bgcolor_func. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_context_set_bgcolor(G3DContext *context, + G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a); + +/** + * g3d_context_update_interface: + * @context: a valid context + * + * Try to update the interface. This will call a function registered with + * @g3d_context_set_update_interface_func. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_context_update_interface(G3DContext *context); + +/** + * g3d_context_update_progress_bar: + * @context: a valid context + * @percentage: the percentage to set on the progress bar + * @visibility: show or hide the progress bar + * + * Try to update the progress bar. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_context_update_progress_bar(G3DContext *context, + G3DFloat percentage, gboolean visibility); + +/** + * g3d_context_set_set_bgcolor_func: + * @context: a valid context + * @func: the callback function + * @user_data: user-defined opaque pointer + * + * Registers a callback function for setting the background color. + */ +EAPI +void g3d_context_set_set_bgcolor_func(G3DContext *context, + G3DSetBgColorFunc func, gpointer user_data); + +/** + * g3d_context_set_update_interface_func: + * @context: a valid context + * @func: the callback function + * @user_data: user-defined opaque pointer + * + * Registers a callback function for updating the interface. + */ +EAPI +void g3d_context_set_update_interface_func(G3DContext *context, + G3DUpdateInterfaceFunc func, gpointer user_data); + +/** + * g3d_context_set_update_progress_bar_func: + * @context: a valid context + * @func: the callback function + * @user_data: user-defined opaque pointer + * + * Registers a callback function for updating the progress bar. + */ +EAPI +void g3d_context_set_update_progress_bar_func(G3DContext *context, + G3DUpdateProgressBarFunc func, gpointer user_data); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_CONTEXT_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h new file mode 100644 index 0000000..874764b --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h @@ -0,0 +1,44 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _G3D_DEBUG_H +#define _G3D_DEBUG_H + + +#include +/* g_debug() is defined since glib 2.6 */ + +/*< private >*/ +#ifndef g_debug +#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__) +#endif +/*< public >*/ + +#if DEBUG > 0 +#include +static const gchar *debug_padding_str = " "; +static inline const gchar *debug_pad(guint32 level) { + return debug_padding_str + (strlen(debug_padding_str) - level); +} +#endif + +#endif /* _G3D_DEBUG_H */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h new file mode 100644 index 0000000..b94b5cf --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h @@ -0,0 +1,98 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _G3D_FACE_H +#define _G3D_FACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:face + * @short_description: Face manipulation + * @include: g3d/face.h + * + * A face is plane bordered by at least 3 vertices. + */ + + +/** + * g3d_face_free: + * @face: the face to free + * + * Frees all memory allocated for this face. + */ +EAPI +void g3d_face_free(G3DFace *face); + +/** + * g3d_face_get_normal: + * @face: face to calculate normal of + * @object: object containing vertices of face + * @nx: x component of resulting normal + * @ny: y component of resulting normal + * @nz: z component of resulting normal + * + * calculates the normal of a face. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_face_get_normal(G3DFace *face, G3DObject *object, + G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); + +/** + * g3d_face_new_tri: + * @material: material to use for face + * @i1: index of first vertex + * @i2: index of second vertex + * @i3: index of third vertex + * + * creates a new triangle face. + * + * Returns: a new face + */ +_G3D_STATIC_INLINE G3DFace *g3d_face_new_tri(G3DMaterial *material, + guint32 i1, guint32 i2, guint32 i3) +{ + G3DFace *face; + + face = g_new0(G3DFace, 1); + face->material = material; + face->vertex_count = 3; + face->vertex_indices = g_new0(guint32, 3); + face->vertex_indices[0] = i1; + face->vertex_indices[1] = i2; + face->vertex_indices[2] = i3; + + return face; +} + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* _G3D_FACE_H */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h new file mode 100644 index 0000000..ca30be7 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h @@ -0,0 +1,35 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_G3D_H__ +#define __G3D_G3D_H__ + +#include +#include +#include +#include +#include + +#include + +#endif /* __G3D_G3D_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h new file mode 100644 index 0000000..a8df77e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h @@ -0,0 +1,325 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_IFF_H__ +#define __G3D_IFF_H__ + +/* FIXME: still needed for FILE until all plugins are converted + * #ifndef G3D_DISABLE_DEPRECATED */ +#include +/* #endif */ +#include + +#include + +/** + * SECTION:iff + * @short_description: IFF file helper functions + * @include: g3d/iff.h + * + * These are helper functions to read data from the Interchange File Format + * (IFF). + */ + + +/** + * G3D_IFF_PAD1: + * + * No padding is done after chunks. + */ +#define G3D_IFF_PAD1 0x01 +/** + * G3D_IFF_PAD2: + * + * Chunks are 2-byte aligned + */ +#define G3D_IFF_PAD2 0x02 +/** + * G3D_IFF_PAD4: + * + * Chunks are 4-byte aligned + */ +#define G3D_IFF_PAD4 0x04 +/** + * G3D_IFF_PAD8: + * + * Chunks are 8-byte aligned + */ +#define G3D_IFF_PAD8 0x08 + +/** + * G3D_IFF_SUBCHUNK_LEN16: + * + * All chunks except the toplevel ones have 16-bit sizes. + */ +#define G3D_IFF_SUBCHUNK_LEN16 0x10 +/** + * G3D_IFF_LEN16: + * + * All chunks have 16-bit sizes. + */ +#define G3D_IFF_LEN16 0x20 +/** + * G3D_IFF_LE: + * + * The file has little-endian data. + */ +#define G3D_IFF_LE 0x40 /* little endian */ + +/** + * G3D_IFF_MKID: + * @a: first byte + * @b: second byte + * @c: third byte + * @d: fourth byte + * + * Generate an IFF chunk identifier from character representation, e.g. + * G3D_IFF_MKID('F','O','R','M'). + * + * Returns: unsigned integer identifier. + */ +#define G3D_IFF_MKID(a,b,c,d) ( \ + (((guint32)(a))<<24) | \ + (((guint32)(b))<<16) | \ + (((guint32)(c))<< 8) | \ + (((guint32)(d)) ) ) + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +#ifndef G3D_DISABLE_DEPRECATED +/** + * g3d_iff_gdata: + * + * IFF global data (deprecated). + */ +#define g3d_iff_gdata G3DIffGlobal +/** + * g3d_iff_ldata: + * + * IFF local data (deprecated). + */ +#define g3d_iff_ldata G3DIffLocal +/** + * g3d_iff_chunk_callback: + * + * IFF chunk callback (deprecated). + */ +#define g3d_iff_chunk_callback G3DIffChunkCallback +/** + * g3d_iff_chunk_info: + * + * IFF chunk description (deprecated). + */ +#define g3d_iff_chunk_info G3DIffChunkInfo +#endif + +/** + * G3DIffGlobal: + * @context: a valid context + * @model: a model + * @stream: the stream to read model from + * @flags: IFF flags + * @user_data: to be used by plugin + * @f: file to read model from (DEPRECATED) + * @max_fpos: maximum file position (DEPRECATED) + * + * The plugin-global data to be given to IFF callback functions. + */ +typedef struct { + G3DContext *context; + G3DModel *model; + G3DStream *stream; + guint32 flags; + gpointer user_data; + FILE *f; + long int max_fpos; +} G3DIffGlobal; + +/** + * G3DIffLocal: + * @id: chunk identifier + * @parent_id: parent chunk identifier + * @object: an object set by parent callbacks, may be NULL + * @level: level of chunk + * @level_object: object shared by callbacks on the same level, may be NULL + * @nb: number of bytes remaining in chunk, has to be decremented after + * correctly after reading from stream + * @finalize: for container chunks the callback function is called before + * and after processing possible sub-chunks, the second time @finalize is set + * to TRUE + * + * The function-local data for IFF callback functions. + */ +typedef struct { + guint32 id; + guint32 parent_id; + gpointer object; + gint32 level; + gpointer level_object; + gint32 nb; + gboolean finalize; +} G3DIffLocal; + +/** + * G3DIffChunkCallback: + * @global: the global data + * @local: the local data + * + * IFF callback function prototype. + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DIffChunkCallback)( + G3DIffGlobal *global, G3DIffLocal *local); + +/** + * G3DIffChunkInfo: + * @id: identifier of chunk + * @description: human-readable description of chunk type + * @container: TRUE if this chunk contains sub-chunks + * @callback: function to be called if such a chunk is found + * + * A chunk type description. + */ +typedef struct { + gchar *id; + gchar *description; + gboolean container; + G3DIffChunkCallback callback; +} G3DIffChunkInfo; + +/** + * g3d_iff_check: + * @stream: stream containing IFF file to check + * @id: top level ID (out) + * @len: length of top level container (out) + * + * Checks a stream for a valid IFF signature and reads the top level container. + * + * Returns: TRUE on success (valid IFF), FALSE else + */ +EAPI +gboolean g3d_iff_check(G3DStream *stream, guint32 *id, gsize *len); + +/** + * g3d_iff_read_chunk: + * @stream: stream to read from + * @id: ID of chunk (out) + * @len: length of chunk (excluding header) (out) + * @flags: flags + * + * Reads one chunk header from an IFF file. + * + * Returns: real length of chunk including header and possible padding byte + */ +EAPI +gsize g3d_iff_read_chunk(G3DStream *stream, guint32 *id, gsize *len, + guint32 flags); + +#ifndef G3D_DISABLE_DEPRECATED +/** + * g3d_iff_open: + * @filename: file name of IFF file + * @id: top level ID (out) + * @len: length of top level container (out) + * + * Opens an IFF file, checks it and reads its top level container. + * + * Returns: the file pointer of open file or NULL in case of an error + */ +FILE *g3d_iff_open(const gchar *filename, guint32 *id, guint32 *len); + +/** + * g3d_iff_readchunk: + * @f: the open IFF file pointer + * @id: ID of chunk (out) + * @len: length of chunk (excluding header) (out) + * @flags: flags + * + * Reads one chunk header from an IFF file. + * + * Returns: real length of chunk including header and possible padding byte + */ +int g3d_iff_readchunk(FILE *f, guint32 *id, guint32 *len, guint32 flags); +#endif /* G3D_DISABLE_DEPRECATED */ + +/** + * g3d_iff_id_to_text: + * @id: an IFF identifier + * + * Get the text representation of an IFF chunk identifier. + * + * Returns: a newly allocated string containing the text identifier. + */ +EAPI +gchar *g3d_iff_id_to_text(guint32 id); + +/** + * g3d_iff_chunk_matches: + * @id: IFF identifier + * @tid: textual representation of identifier + * + * Check whether @id and @tid match. + * + * Returns: TRUE on match, FALSE else. + */ +EAPI +gboolean g3d_iff_chunk_matches(guint32 id, gchar *tid); + +/** + * g3d_iff_handle_chunk: + * @global: global data + * @plocal: local data of parent chunk, must not be NULL + * @chunks: chunk description list + * @flags: IFF flags + * + * Handle an IFF chunk based on chunk description. + * + * Returns: level object for siblings, may be NULL. + */ +EAPI +gpointer g3d_iff_handle_chunk(G3DIffGlobal *global, G3DIffLocal *plocal, + G3DIffChunkInfo *chunks, guint32 flags); + +/** + * g3d_iff_read_ctnr: + * @global: global data + * @local: local data of current chunk, must not be NULL + * @chunks: chunk description list + * @flags: IFF flags + * + * Read subchunks in current chunk and handle them appropriately. + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_iff_read_ctnr(G3DIffGlobal *global, G3DIffLocal *local, + G3DIffChunkInfo *chunks, guint32 flags); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h new file mode 100644 index 0000000..d04ea4d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h @@ -0,0 +1,64 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_MATERIAL_H__ +#define __G3D_MATERIAL_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:material + * @short_description: Material generation and manipulation + * @include: g3d/material.h + * + * A material contains all color, shading and texture information for a + * #G3DFace. + */ +/** + * g3d_material_new + * + * Generates a new material with a default color. + * + * Returns: the new material or NULL on error + */ +EAPI +G3DMaterial *g3d_material_new(void); + +/** + * g3d_material_free: + * @material: the material to free + * + * Frees all memory allocated for that material. + */ +EAPI +void g3d_material_free(G3DMaterial *material); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_MATERIAL_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h new file mode 100644 index 0000000..df4a7a2 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h @@ -0,0 +1,189 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _G3D_MATRIX_H +#define _G3D_MATRIX_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:matrix + * @short_description: Matrix manipulation and calculation + * @include: g3d/matrix.h + * + * Matrices in libg3d have the following layout: + * + * G3DMatrix matrix[16]: + * + * matrix[col * 4 + row] = f; + */ + +/** + * g3d_matrix_identity: + * @matrix: 4x4 matrix (float[16]) + * + * Sets the given matrix to the identity matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_identity(G3DMatrix *matrix); + +/** + * g3d_matrix_new: + * + * Create a new matrix. It is also set to the identity matrix. + * + * Returns: the new matrix + */ +_G3D_STATIC_INLINE G3DMatrix *g3d_matrix_new(void) { + G3DMatrix *matrix = g_new(G3DMatrix, 16); + g3d_matrix_identity(matrix); + return matrix; +} + +/** + * g3d_matrix_free: + * @matrix: the matrix to free + * + * Free the memory allocated by a matrix. + */ +_G3D_STATIC_INLINE void g3d_matrix_free(G3DMatrix *matrix) { + g_free(matrix); +} + +/** + * g3d_matrix_multiply: + * @m1: first matrix + * @m2: second matrix + * @rm: resulting matrix + * + * Multiplies the matrixes. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_multiply(G3DMatrix *m1, G3DMatrix *m2, G3DMatrix *rm); + +/** + * g3d_matrix_translate: + * @x: x translation + * @y: y translation + * @z: z translation + * @rm: resulting matrix + * + * Adds a translation to the the matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_translate(G3DFloat x, G3DFloat y, G3DFloat z, + G3DMatrix *rm); + +/** + * g3d_matrix_rotate: + * @angle: rotation angle + * @ax: x component of rotation axis + * @ay: y component of rotation axis + * @az: z component of rotation axis + * @rm: resulting matrix + * + * Adds a rotation to the matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_rotate(G3DFloat angle, G3DFloat ax, G3DFloat ay, + G3DFloat az, G3DMatrix *rm); + +/** + * g3d_matrix_rotate_xyz + * @rx: rotation around x axis + * @ry: rotation around y axis + * @rz: rotation around z axis + * @rm: resulting matrix + * + * Adds a rotation around the 3 coordinate system axes to the matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_rotate_xyz(G3DFloat rx, G3DFloat ry, G3DFloat rz, + G3DMatrix *rm); + +/** + * g3d_matrix_scale: + * @x: x factor + * @y: y factor + * @z: z factor + * @rm: resulting matrix + * + * Adds a scaling to the matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_scale(G3DFloat x, G3DFloat y, G3DFloat z, G3DMatrix *rm); + +/** + * g3d_matrix_transpose: + * @matrix: the matrix + * + * Transposes the matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_matrix_transpose(G3DMatrix *matrix); + +/** + * g3d_matrix_determinant: + * @matrix: the matrix + * + * Calculate the determinant of the matrix (FIXME: not verified). + * + * Returns: the determinant. + */ +EAPI +G3DFloat g3d_matrix_determinant(G3DMatrix *matrix); + +/** + * g3d_matrix_dump: + * @matrix: the matrix + * + * If debugging is enabled, this function dump the matrix to stderr. + * + * Returns: TRUE if matrix is dumped, FALSE else + */ +EAPI +gboolean g3d_matrix_dump(G3DMatrix *matrix); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* _G3D_MATRIX_H */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h new file mode 100644 index 0000000..86047a6 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h @@ -0,0 +1,180 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_MODEL_H__ +#define __G3D_MODEL_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:model + * @short_description: Model manipulation functions + * @include: g3d/g3d.h + * + * A model is a group of objects. All information loaded from a file by libg3d + * is found in this model. + */ + +/** + * g3d_model_new: + * + * This functions allocates and initializes a new G3DModel. + * + * Returns: a newly allocated G3DModel + */ +EAPI +G3DModel *g3d_model_new(void); + +/** + * G3D_MODEL_SCALE: + * + * The model should be scaled to a maximum extension of +/- 10.0. + */ +#define G3D_MODEL_SCALE (1 << 0) +/** + * G3D_MODEL_CENTER: + * + * The model should be centered around the (0,0,0). + */ +#define G3D_MODEL_CENTER (1 << 1) +/** + * G3D_MODEL_OPTIMIZE: + * + * The model material/object/face lists should be serialized to some private + * arrays (deprecated). + */ +#define G3D_MODEL_OPTIMIZE (1 << 2) +/** + * G3D_MODEL_NOCHECK: + * + * The common checks should be disabled. The checks include: + * + * faces have at least 3 indices + * face indices are <= number of vertices + * material of faces is not NULL + * + */ +#define G3D_MODEL_NOCHECK (1 << 3) + +/** + * g3d_model_load_full: + * @context: a valid context + * @filename: the file name of the model to load + * @flags: object manipulation flags + * + * Loads a model from a file. Depending on @flags the model is checked, + * centered, resized, optimized. + * + * Returns: the loaded model or NULL in case of an error. + */ +EAPI +G3DModel *g3d_model_load_full(G3DContext *context, const gchar *filename, + guint32 flags); + +/** + * g3d_model_load: + * @context: a valid context + * @filename: the file name of the model to load + * + * Loads a model from a file. The model is checked, centered, resized, + * optimized. + * + * Returns: the loaded model or NULL in case of an error + */ +EAPI +G3DModel *g3d_model_load(G3DContext *context, const gchar *filename); + +/** + * g3d_model_check: + * @model: the model to check + * + * Checks whether a model returned by plugin is valid. + * + * Returns: TRUE on success, FALSE on error + */ +EAPI +gboolean g3d_model_check(G3DModel *model); + +/** + * g3d_model_center: + * @model: the model to center + * + * Translates all object coordinates that the object center is at (0, 0, 0) + * + * Returns: TRUE on success, FALSE on error + */ +EAPI +gboolean g3d_model_center(G3DModel *model); + +/** + * g3d_model_clear: + * @model: the model to clear + * + * Removes all objects from a model. + */ +EAPI +void g3d_model_clear(G3DModel *model); + +/** + * g3d_model_free: + * @model: the model to free + * + * Frees all memory allocated for the model including all objects, materials + * and textures. + */ +EAPI +void g3d_model_free(G3DModel *model); + +/** + * g3d_model_get_object_by_name: + * @model: the model containing all objects + * @name: the name of the requested object + * + * Searches the object tree for an object with the given name. + * + * Returns: the requested object or NULL if non was found + */ +EAPI +G3DObject *g3d_model_get_object_by_name(G3DModel *model, const gchar *name); + +/** + * g3d_model_transform: + * @model: the model + * @matrix: transformation matrix + * + * Transform all toplevel objects in model with matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_model_transform(G3DModel *model, G3DMatrix *matrix); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_MODEL_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h new file mode 100644 index 0000000..97dfefc --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h @@ -0,0 +1,151 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_OBJECT_H__ +#define __G3D_OBJECT_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:object + * @short_description: Object manipulation + * @include: g3d/object.h + * + * Objects are parts of a model. In most file formats vertices and faces are + * grouped in some way into objects. Objects can be hierarchical, so what a + * model contains is basically an object tree. + */ + +/** + * g3d_object_free: + * @object: the object to free + * + * Frees all memory allocated for that object. + */ +EAPI +void g3d_object_free(G3DObject *object); + +/** + * g3d_object_radius: + * @object: the object to measure + * + * Calculates the radius of the object. This is the maximum from the + * center to a vertex. + * + * Returns: the radius of the given object + */ +EAPI +gdouble g3d_object_radius(G3DObject *object); + +/** + * g3d_object_scale: + * @object: the object to scale + * @scale: scale factor + * + * Resizes the object by the factor @scale. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_scale(G3DObject *object, G3DFloat scale); + +/** + * g3d_object_transform: + * @object: the object to transform + * @matrix: the transformation matrix + * + * Multiplies all vertices of the object with the transformation matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_transform(G3DObject *object, G3DMatrix *matrix); + +/** + * g3d_object_transform_normals: + * @object: the object to transform + * @matrix: the transformation matrix + * + * Multiplies all normals of the object with the transformation matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_transform_normals(G3DObject *object, G3DMatrix *matrix); + +/** + * g3d_object_duplicate: + * @object: the object to duplicate + * + * Duplicates an object with all vertices, faces and materials. + * + * Returns: the new clone object + */ +EAPI +G3DObject *g3d_object_duplicate(G3DObject *object); + +/** + * g3d_object_optimize: + * @object: the object to optimize + * + * Puts all vertex and face information into special arrays for faster + * rendering. It is deprecated and should not be used. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_optimize(G3DObject *object); + +/** + * g3d_object_smooth: + * @object: the object to smooth + * + * FIXME: unimplemented. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_smooth(G3DObject *object); + +/** + * g3d_object_merge: + * @o1: first and target object + * @o2: second object + * + * Merges both objects into @o1. + * FIXME: needs cleanup + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_object_merge(G3DObject *o1, G3DObject *o2); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_OBJECT_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h new file mode 100644 index 0000000..0a98dcd --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h @@ -0,0 +1,243 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_PLUGINS_H__ +#define __G3D_PLUGINS_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:plugins + * @short_description: G3DPlugin interface + * @see_also: #G3DPlugin + * @include: g3d/plugins.h + * + * Direct interaction with the plugin system is normally not needed when using + * libg3d. It may be required when writing a plugin which should load a + * #G3DImage or a #G3DModel with another plugin. + */ + +/** + * G3DPluginType: + * @G3D_PLUGIN_UNKNOWN: unknown plugin type + * @G3D_PLUGIN_IMPORT: model import plugin + * @G3D_PLUGIN_IMAGE: image loading plugin + * + * Type of plugin. + */ +typedef enum { + G3D_PLUGIN_UNKNOWN = 0x00, + G3D_PLUGIN_IMPORT, + G3D_PLUGIN_IMAGE +} G3DPluginType; + +/** + * G3DPluginInitFunc: + * @context: the context + * + * Prototype for plugin_init(). + * + * Returns: opaque plugin data. + */ +typedef gpointer (* G3DPluginInitFunc)(G3DContext *context); + +/** + * G3DPluginCleanupFunc: + * @user_data: opaque plugin data + * + * Prototype for plugin_cleanup(). + */ +typedef void (* G3DPluginCleanupFunc)(gpointer user_data); + +/** + * G3DPluginLoadModelFromStreamFunc: + * @context: the context + * @stream: the stream to load from + * @model: the model structure to fill + * @user_data: opaque plugin data + * + * Prototype for plugin_load_model_from_stream(). + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DPluginLoadModelFromStreamFunc)(G3DContext *context, + G3DStream *stream, G3DModel *model, gpointer user_data); + +/** + * G3DPluginLoadImageStreamFunc: + * @context: the context + * @stream: the stream to load from + * @image: image structure to fill + * @user_data: opaque plugin data + * + * Prototype for plugin_load_image_from_stream(). + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DPluginLoadImageStreamFunc)(G3DContext *context, + G3DStream *stream, G3DImage *image, gpointer user_data); + +/** + * G3DPluginGetDescFunc: + * @context: the context + * + * Prototype for plugin_description(). + * + * Returns: a newly-allocated string containing the description of the plugin. + */ +typedef gchar *(* G3DPluginGetDescFunc)(G3DContext *context); + +/** + * G3DPluginGetExtFunc: + * @context: the context + * + * Prototype for plugin_extensions(). + * + * Returns: NULL-terminated list of file extensions supported by this plugin. + * Free with g_strfreev(). + */ +typedef gchar **(* G3DPluginGetExtFunc)(G3DContext *context); + +/** + * G3DPlugin: + * + * A libg3d plugin. + */ +struct _G3DPlugin { + /*< private >*/ + gchar *name; + gchar *path; + G3DPluginType type; + gchar **extensions; + + G3DPluginInitFunc init_func; + G3DPluginCleanupFunc cleanup_func; + G3DPluginLoadModelFromStreamFunc loadmodelstream_func; + G3DPluginLoadImageStreamFunc loadimagestream_func; + G3DPluginGetDescFunc desc_func; + G3DPluginGetExtFunc ext_func; + + gpointer user_data; + + GModule *module; +}; + +/** + * g3d_plugins_init: + * @context: a valid #G3DContext + * + * Initializes the plugin system. This is implicitly done when using + * g3d_context_new(). + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_plugins_init(G3DContext *context); + +/** + * g3d_plugins_cleanup: + * @context: a valid context + * + * Clean up the plugin system. Usually done by g3d_context_free(). + */ +EAPI +void g3d_plugins_cleanup(G3DContext *context); + +/** + * g3d_plugins_load_model: + * @context: a valid context + * @filename: file name of model to load + * @model: model structure to fill + * + * Try to load a model from file using import plugins. + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_plugins_load_model(G3DContext *context, const gchar *filename, + G3DModel *model); + +/** + * g3d_plugins_load_model_from_stream: + * @context: a valid context + * @stream: stream to load model from + * @model: model structure to fill + * + * Try to load a model from stream using import plugins. + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_plugins_load_model_from_stream(G3DContext *context, + G3DStream *stream, G3DModel *model); + +/** + * g3d_plugins_load_image: + * @context: a valid context + * @filename: file name of image to load + * @image: image structure to fill + * + * Try to load an image from file using import plugins. + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_plugins_load_image(G3DContext *context, const gchar *filename, + G3DImage *image); + +/** + * g3d_plugins_load_image_from_stream: + * @context: a valid context + * @stream: stream to load image from + * @image: image structure to fill + * + * Try to load an image from stream using import plugins. + * + * Returns: TRUE on success, FALSE else. + */ +EAPI +gboolean g3d_plugins_load_image_from_stream(G3DContext *context, + G3DStream *stream, G3DImage *image); + +/** + * g3d_plugins_get_image_extensions: + * @context: a valid context + * + * Get the supported image type extensions. + * + * Returns: NULL-terminated list of image file extensions supported by this + * plugin. Free with g_strfreev(). + */ +EAPI +gchar **g3d_plugins_get_image_extensions(G3DContext *context); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_PLUGINS_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h new file mode 100644 index 0000000..3db23df --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h @@ -0,0 +1,164 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_PRIMITIVE_H__ +#define __G3D_PRIMITIVE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:primitive + * @short_description: 3D primitive generation functions + * @include: g3d/primitive.h + * + * Primitives are objects containing basic 3D geometrical structures. A + * variety of them can be created using these functions. + */ + +/** + * g3d_primitive_box: + * @width: the width of the box + * @height: the height of the box + * @depth: the depth of the box + * @material: the material to use for all faces + * + * Generates an object containing a box. + * + * Returns: the box object + */ +EAPI +G3DObject *g3d_primitive_box(G3DFloat width, G3DFloat height, G3DFloat depth, + G3DMaterial *material); + +#ifndef G3D_DISABLE_DEPRECATED +/** + * g3d_primitive_cube: + * @width: the width of the box + * @height: the height of the box + * @depth: the depth of the box + * @material: the material to use for all faces + * + * Generates an object containing a box. It is deprecated and now a wrapper for + * g3d_primitive_box(). + * + * Returns: the box object + */ +EAPI +G3DObject *g3d_primitive_cube(G3DFloat width, G3DFloat height, G3DFloat depth, + G3DMaterial *material); +#endif + +/** + * g3d_primitive_cylinder: + * @radius: the radius of the cylinder + * @height: the height of the side faces + * @sides: number of side faces (number of circle segments) + * @top: add top faces + * @bottom: add bottom faces + * @material: material to use for faces + * + * Generates an object containing a cylinder. + * + * Returns: cylinder object + */ +EAPI +G3DObject *g3d_primitive_cylinder(G3DFloat radius, G3DFloat height, + guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material); + +/** + * g3d_primitive_tube: + * @r_in: inner radius + * @r_out: outer radius + * @height: the height of the side faces + * @sides: number of side faces (number of circle segments) + * @top: add top faces + * @bottom: add bottom faces + * @material: material to use for faces + * + * Generates an object containing a tube (a cylinder with a hole). + * + * Returns: tube object + */ +EAPI +G3DObject *g3d_primitive_tube(G3DFloat r_in, G3DFloat r_out, G3DFloat height, + guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material); + +/** + * g3d_primitive_sphere: + * @radius: radius + * @vseg: number of vertical segments + * @hseg: number of horizontal segments + * @material: material to use for faces + * + * Generates an object containing a sphere. + * + * Returns: sphere object + */ +EAPI +G3DObject *g3d_primitive_sphere(G3DFloat radius, guint32 vseg, guint32 hseg, + G3DMaterial *material); + +/** + * g3d_primitive_box_strip_2d: + * @vcnt: number of control points + * @vdata: 2-dimensional control point data (2 * vcnt * gdouble) + * @height: height of resulting strip (y component) + * @width: width of strip (corner diameter) + * @material: material to use for faces + * + * Generates a strip of box segments defined by corner center points + * using two-dimensional data (x/z plane). + * + * Returns: strip object + */ +EAPI +G3DObject *g3d_primitive_box_strip_2d(guint32 vcnt, gdouble *vdata, + gdouble height, gdouble width, G3DMaterial *material); + +/** + * g3d_primitive_mesh: + * @m: number of vertices in m direction + * @n: number of vertices in n direction + * @wrap_m: wrap around in m direction + * @wrap_n: wrap around in n direction + * @material: material to use for faces + * + * Generate a mesh consisting of m * n vertices. The vertex data is + * initialized with (0.0, 0.0, 0.0) and has to be set to something + * useful. + * + * Returns: mesh object + */ +EAPI +G3DObject *g3d_primitive_mesh(guint32 m, guint32 n, gboolean wrap_m, + gboolean wrap_n, G3DMaterial *material); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_PRIMITIVE_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h new file mode 100644 index 0000000..2d68907 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h @@ -0,0 +1,117 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#ifndef _G3D_QUAT_H +#define _G3D_QUAT_H + +#include + +/** + * SECTION:quat + * @short_description: quaternion helpers + * @include: g3d/quat.h + */ + +/** + * g3d_quat_normalize: + * @q: a quaternion + * + * normalize the quaternion to a length of 1.0. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_normalize(G3DQuat *q); + +/** + * g3d_quat_rotate: + * @q: resulting quat + * @axis: rotation axis + * @angle: rotation angle + * + * Encode a rotation around an axis into quaternion. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_rotate(G3DQuat *q, G3DVector *axis, G3DFloat angle); + +/** + * g3d_quat_add: + * @qr: result quat + * @q1: first quat + * @q2: second quat + * + * Add two quats. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_add(G3DQuat *qr, G3DQuat *q1, G3DQuat *q2); + +/** + * g3d_quat_trackball: + * @q: resulting quaternion + * @x1: x value of first point + * @y1: y value of first point + * @x2: x value of second point + * @y2: y value of second point + * @r: radius of virtual trackball, usually 0.8 + * + * Emulate a virtual trackball movement and return rotation as quaternion. + * The x and y values of the starting and end point of the movement have + * to be in the range -1.0 .. 1.0. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_trackball(G3DQuat *q, G3DFloat x1, G3DFloat y1, + G3DFloat x2, G3DFloat y2, G3DFloat r); + +/** + * g3d_quat_to_matrix: + * @q: source quat + * @matrix: resulting matrix + * + * Convert a quaternion to a transformation matrix. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_to_matrix(G3DQuat *q, G3DMatrix *matrix); + +/** + * g3d_quat_to_rotation_xyz: + * @q: a quaternion + * @rx: rotation around x axis + * @ry: rotation around y axis + * @rz: rotation around z axis + * + * Calculate the rotation around the three coordinate axes from a given + * quaternion. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_quat_to_rotation_xyz(G3DQuat *q, G3DFloat *rx, G3DFloat *ry, + G3DFloat *rz); + +#endif /* _G3D_QUAT_H */ diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h new file mode 100644 index 0000000..08211e3 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h @@ -0,0 +1,156 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_READ_H__ +#define __G3D_READ_H__ + +#ifndef G3D_DISABLE_DEPRECATED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:read + * @short_description: file reading abstraction (deprecated) + * @see_also: g3d_stream_open_file + * @include: g3d/read.h + * + * The g3d_read_* family of functions is deprecated in favour of the #G3DStream + * interface. + */ + + +/** + * g3d_read_int8: + * @f: the file to read from + * + * Read a 1 byte signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +gint32 g3d_read_int8(FILE *f); + +/** + * g3d_read_int16_be: + * @f: the file to read from + * + * Read a 2 byte big-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +gint32 g3d_read_int16_be(FILE *f); + +/** + * g3d_read_int16_le: + * @f: the file to read from + * + * Read a 2 byte little-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +gint32 g3d_read_int16_le(FILE *f); + +/** + * g3d_read_int32_be: + * @f: the file to read from + * + * Read a 4 byte big-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +gint32 g3d_read_int32_be(FILE *f); + +/** + * g3d_read_int32_le: + * @f: the file to read from + * + * Read a 4 byte little-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +gint32 g3d_read_int32_le(FILE *f); + +/** + * g3d_read_float_be: + * @f: the file to read from + * + * Read a 4 byte big-endian floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +G3DFloat g3d_read_float_be(FILE *f); + +/** + * g3d_read_float_le: + * @f: the file to read from + * + * Read a 4 byte little-endian floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +G3DFloat g3d_read_float_le(FILE *f); + +/** + * g3d_read_double_be: + * @f: the file to read from + * + * Read a 8 byte big-endian double-precision floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +G3DDouble g3d_read_double_be(FILE *f); + +/** + * g3d_read_double_le: + * @f: the file to read from + * + * Read a 8 byte little-endian double-precision floating point number from + * file. + * + * Returns: The read value, 0 in case of error + */ +G3DDouble g3d_read_double_le(FILE *f); + +/** + * g3d_read_cstr: + * @f: the file to read from + * @buffer: the buffer to store line in + * @max_len: maximum length of string including termination character + * + * Read a zero-terminated string from file. + * + * Returns: number of bytes read from file. + */ +gint32 g3d_read_cstr(FILE *f, gchar *buffer, gint32 max_len); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* G3D_DISABLE_DEPRECATED */ + +#endif /* __G3D_READ_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h new file mode 100644 index 0000000..f3f9630 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h @@ -0,0 +1,541 @@ +/* $Id:$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _G3D_STREAM_H +#define _G3D_STREAM_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:stream + * @short_description: I/O abstraction layer for plugins + * @see_also: #G3DStream + * @include: g3d/stream.h + * + * A stream is an abstraction for data input. It enables plugins to read + * data from a file, a memory buffer, a container file or some other medium. + */ + +enum { + /* shift offsets */ + G3D_STREAM_SEEKABLE = 0x00, + G3D_STREAM_READABLE = 0x01, + G3D_STREAM_WRITABLE = 0x02 +}; + +/** + * G3DStreamReadFunc: + * @ptr: buffer to read bytes into + * @size: number of bytes to read + * @data: opaque stream data + * + * Callback function for g3d_stream_read(). + * + * Returns: number of bytes actually read. + */ +typedef gsize (* G3DStreamReadFunc)(gpointer ptr, gsize size, gpointer data); + +/** + * G3DStreamReadLineFunc: + * @buf: buffer to read bytes into + * @size: maximum size of buffer + * @data: opaque stream data + * + * Callback function for g3d_stream_read_line(). + * + * Returns: The line buffer or NULL in case of an error. + */ +typedef gchar *(* G3DStreamReadLineFunc)(gchar *buf, gsize size, + gpointer data); + +/** + * G3DStreamSeekFunc: + * @data: opaque stream data + * @offset: seek offset + * @whence: seek type + * + * Callback function for g3d_stream_seek(). + * + * Returns: 0 on success, -1 else. + */ +typedef gint (*G3DStreamSeekFunc)(gpointer data, goffset offset, + GSeekType whence); + +/** + * G3DStreamTellFunc: + * @data: opaque stream data + * + * Callback function for g3d_stream_tell(). + * + * Returns: current stream position. + */ +typedef goffset (*G3DStreamTellFunc)(gpointer data); + +/** + * G3DStreamSizeFunc: + * @data: opaque stream data + * + * Callback function for g3d_stream_size(). + * + * Returns: size of stream. + */ +typedef goffset (*G3DStreamSizeFunc)(gpointer data); + +/** + * G3DStreamEofFunc: + * @data: opaque stream data + * + * Callback function for g3d_stream_eof(). + * + * Returns: TRUE on stream end-of-file, FALSE else. + */ +typedef gboolean (*G3DStreamEofFunc)(gpointer data); + +/** + * G3DStreamCloseFunc: + * @data: opaque stream data + * + * Callback function for g3d_stream_close(). + * + * Returns: 0 on success, -1 else. + */ +typedef gint (*G3DStreamCloseFunc)(gpointer data); + +/** + * G3DStream: + * + * An abstraction of input handling. + */ +struct _G3DStream { + /*< private >*/ + guint32 flags; + gchar *uri; + G3DStreamReadFunc read; + G3DStreamReadLineFunc readline; + G3DStreamSeekFunc seek; + G3DStreamTellFunc tell; + G3DStreamSizeFunc size; + G3DStreamEofFunc eof; + G3DStreamCloseFunc close; + gpointer data; + guint32 linecount; + struct _G3DStream *zip_container; +}; + +/* public interface */ + +/** + * g3d_stream_is_seekable: + * @stream: the stream + * + * Get information whether it is possible to seek in a stream. + * + * Returns: TRUE if seekable, FALSE else + */ +EAPI +gboolean g3d_stream_is_seekable(G3DStream *stream); + +/** + * g3d_stream_get_uri: + * @stream: the stream + * + * Get the URI of a stream + * + * Returns: a non-NULL, zero-terminated string containing the URI of the + * string. This return value should not be freed. + */ +EAPI +gchar *g3d_stream_get_uri(G3DStream *stream); + +/** + * g3d_stream_read_int8: + * @stream: the stream to read from + * + * Read a 1 byte signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +gint32 g3d_stream_read_int8(G3DStream *stream); + +/** + * g3d_stream_read_int16_be: + * @stream: the stream to read from + * + * Read a 2 byte big-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +gint32 g3d_stream_read_int16_be(G3DStream *stream); + +/** + * g3d_stream_read_int16_le: + * @stream: the stream to read from + * + * Read a 2 byte little-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +gint32 g3d_stream_read_int16_le(G3DStream *stream); + +/** + * g3d_stream_read_int32_be: + * @stream: the stream to read from + * + * Read a 4 byte big-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +gint32 g3d_stream_read_int32_be(G3DStream *stream); + +/** + * g3d_stream_read_int32_le: + * @stream: the stream to read from + * + * Read a 4 byte little-endian signed integer from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +gint32 g3d_stream_read_int32_le(G3DStream *stream); + +/** + * g3d_stream_read_float_be: + * @stream: the stream to read from + * + * Read a 4 byte big-endian floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +G3DFloat g3d_stream_read_float_be(G3DStream *stream); + +/** + * g3d_stream_read_float_le: + * @stream: the stream to read from + * + * Read a 4 byte little-endian floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +G3DFloat g3d_stream_read_float_le(G3DStream *stream); + +/** + * g3d_stream_read_double_be: + * @stream: the stream to read from + * + * Read a 8 byte big-endian double-precision floating point number from file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +G3DDouble g3d_stream_read_double_be(G3DStream *stream); + +/** + * g3d_stream_read_double_le: + * @stream: the stream to read from + * + * Read a 8 byte little-endian double-precision floating point number from + * file. + * + * Returns: The read value, 0 in case of error + */ +EAPI +G3DDouble g3d_stream_read_double_le(G3DStream *stream); + +/** + * g3d_stream_read_cstr: + * @stream: the stream to read from + * @buffer: the buffer to fill + * @max_len: maximum number to read from stream + * + * Read a string (terminated by '\0') from stream + * + * Returns: number of bytes read from stream + */ +EAPI +gint32 g3d_stream_read_cstr(G3DStream *stream, gchar *buffer, gint32 max_len); + +/** + * g3d_stream_read: + * @stream: the stream to read from + * @ptr: pointer to memory storage + * @size: number of bytes to read + * + * Reads a number of bytes from the stream. + * + * Returns: number of bytes successfully read. + */ +EAPI +gsize g3d_stream_read(G3DStream *stream, gpointer ptr, gsize size); + +/** + * g3d_stream_read_line: + * @stream: stream to read a line from + * @buf: an allocated buffer to be filled + * @size: maximum length of line including terminating zero + * + * Read a line (terminated by a newline character or end of file) from a + * stream. + * + * Returns: the read line or NULL in case of an error. + */ +EAPI +gchar *g3d_stream_read_line(G3DStream *stream, gchar *buf, gsize size); + +/** + * g3d_stream_skip: + * @stream: stream to skip bytes from + * @offset: number of bytes to skip + * + * Skip a number of bytes (>= 0) in stream even if it does not support + * seeking. + * + * Returns: 0 on success, -1 else + */ +EAPI +gint g3d_stream_skip(G3DStream *stream, goffset offset); + +/** + * g3d_stream_seek: + * @stream: stream to seek in + * @offset: number of bytes to seek + * @whence: seek type + * + * Moves around the current position in the stream. + * + * Returns: 0 on success, -1 else + */ +EAPI +gint g3d_stream_seek(G3DStream *stream, goffset offset, GSeekType whence); + +/** + * g3d_stream_tell: + * @stream: stream to get position from + * + * Tells the current position in the stream. + * + * Returns: current stream position + */ +EAPI +goffset g3d_stream_tell(G3DStream *stream); + +/** + * g3d_stream_line: + * @stream: stream to get line from + * + * Get the current line number from stream. This only works if line are + * consequently read with g3d_stream_read_line(), so it's only applicable + * for text streams. + * + * Returns: current line number, may be 0 + */ +EAPI +guint32 g3d_stream_line(G3DStream *stream); + +/** + * g3d_stream_size: + * @stream: stream to get size from + * + * Get the size in bytes of a stream. + * + * Returns: size of stream in bytes + */ +EAPI +goffset g3d_stream_size(G3DStream *stream); + +/** + * g3d_stream_eof: + * @stream: the stream + * + * Checks whether the stream has reached its end. + * + * Returns: TRUE if no more data can be read, FALSE else. + */ +EAPI +gboolean g3d_stream_eof(G3DStream *stream); + +/** + * g3d_stream_close: + * @stream: the stream + * + * Closes an open stream. + * + * Returns: 0 on success. + */ +EAPI +gint g3d_stream_close(G3DStream *stream); + +/** + * g3d_stream_new_custom: + * @flags: stream capability flags + * @uri: URI of new stream, must not be NULL + * @readfunc: read callback function + * @readlinefunc: read line callback function, may be NULL in which case + * line reading is emulated with g3d_stream_read() + * @seekfunc: seek callback function + * @tellfunc: tell callback function + * @sizefunc: size callback function + * @eoffunc: end-of-file callback function + * @closefunc: close callback function + * @data: opaque data for all callback functions + * @zip_container: original zip container + * + * Creates a new #G3DStream with custom callback functions. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_new_custom(guint32 flags, const gchar *uri, + G3DStreamReadFunc readfunc, G3DStreamReadLineFunc readlinefunc, + G3DStreamSeekFunc seekfunc, G3DStreamTellFunc tellfunc, + G3DStreamSizeFunc sizefunc, + G3DStreamEofFunc eoffunc, G3DStreamCloseFunc closefunc, gpointer data, + G3DStream *zip_container); + +/** + * g3d_stream_open_file: + * @filename: the name of the file to open + * @mode: the mode to open the file, as given to fopen() + * + * Opens a file with the C stdio routines. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_file(const gchar *filename, const gchar *mode); + +/** + * g3d_stream_from_buffer: + * @buffer: memory buffer to use + * @size: size of buffer + * @title: optional title of stream, may be NULL + * @free_buffer: whether to free the memory with g_free() on g3d_stream_close() + * + * Use a buffer in memory as #G3DStream. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_from_buffer(guint8 *buffer, gsize size, + const gchar *title, gboolean free_buffer); + +#ifdef HAVE_ZLIB + +/** + * g3d_stream_zlib_inflate_stream: + * @stream: a parent stream + * @cmp_size: the compressed size of the deflated part + * + * Opens a new stream to decompress zlib-deflated parts of a stream. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error + */ +EAPI +G3DStream *g3d_stream_zlib_inflate_stream(G3DStream *stream, gsize cmp_size); + +#endif /* HAVE_ZLIB */ + +#ifdef HAVE_LIBGSF + +/** + * g3d_stream_open_gzip_from_stream: + * @stream: stream to read from + * + * Reads data from a gzip-compressed stream. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_gzip_from_stream(G3DStream *stream); + +/** + * g3d_stream_open_structured_file: + * @filename: name of container file + * @subfile: name of (contained) sub-file + * + * Open a file within a Structured File as #G3DStream. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_structured_file(const gchar *filename, + const gchar *subfile); + +/** + * g3d_stream_open_structured_file_from_stream: + * @stream: stream of container file + * @subfile: name of (contained) sub-file + * + * Open a file within a Structured File which is opened as a stream. At the + * moment this only works for streams opened by g3d_stream_open_file() as + * the file is directly opened again. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_structured_file_from_stream(G3DStream *stream, + const gchar *subfile); + +/** + * g3d_stream_open_zip: + * @filename: name of container file + * @subfile: name of (contained) sub-file + * + * Open a file within a Zip archive. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_zip(const gchar *filename, const gchar *subfile); + +/** + * g3d_stream_open_zip_from_stream: + * @stream: stream of container file + * @subfile: name of (contained) sub-file + * + * Open a file within a Zip archive which is opened as a stream. At the + * moment this only works for streams opened by g3d_stream_open_file() as + * the file is directly opened again. + * + * Returns: a newly allocated #G3DStream or NULL in case of an error. + */ +EAPI +G3DStream *g3d_stream_open_zip_from_stream(G3DStream *stream, + const gchar *subfile); +#endif + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* _G3D_STREAM_H */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h new file mode 100644 index 0000000..f5643a8 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h @@ -0,0 +1,123 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_TEXTURE_H__ +#define __G3D_TEXTURE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:texture + * @short_description: Texture loading and manipulation + * @include: g3d/texture.h + * + * A texture is an image used in materials. Here are some helper functions, + * mostly for cached loading of a #G3DImage. + */ + +/** + * g3d_texture_load_from_stream: + * @context: a valid context + * @model: a valid model or NULL + * @stream: an open stream + * + * Load a texture image from a stream. The file type is determined by the + * extension of the stream URI, so it should be valid. If @model is not NULL + * the texture image is cached (or retrieved from cache if available). + * + * Returns: the texture image or NULL in case of an error. + */ +EAPI +G3DImage *g3d_texture_load_from_stream(G3DContext *context, G3DModel *model, + G3DStream *stream); + +/** + * g3d_texture_load_cached: + * @context: a valid context + * @model: a valid model + * @filename: the file name of the texture to load + * + * Loads a texture image from file and attaches it to a hash table in the + * model. On a second try to load this texture it is returned from cache. + * + * Returns: the texture image + */ +EAPI +G3DImage *g3d_texture_load_cached(G3DContext *context, G3DModel *model, + const gchar *filename); + +/** + * g3d_texture_free: + * @texture: a texture image + * + * Frees all memory used by this texture image. + */ +EAPI +void g3d_texture_free(G3DImage *texture); + +/** + * g3d_texture_prepare: + * @texture: a texture image + * + * Resizes the image to dimensions which are a power of 2 to be + * usable as an OpenGL texture. + * (FIXME: unimplemented) + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_texture_prepare(G3DImage *texture); + +/** + * g3d_texture_flip_y: + * @texture: a texture image + * + * Mirror the image along the x axis - all y coordinates are inverted. + * + * Returns: TRUE on success, FALSE on error. + */ +EAPI +gboolean g3d_texture_flip_y(G3DImage *texture); + +/** + * g3d_texture_merge_alpha: + * @image: a texture image or NULL + * @aimage: an image with alpha information + * + * Merges alpha information from @aimage into output image. If @image is NULL a + * new image is created, else @image is returned with alpha from @aimage. + * + * Returns: a texture image or NULL in case of an error. + */ +EAPI +G3DImage *g3d_texture_merge_alpha(G3DImage *image, G3DImage *aimage); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_TEXTURE_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h new file mode 100644 index 0000000..a2403a0 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h @@ -0,0 +1,478 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_TYPES_H__ +#define __G3D_TYPES_H__ + +#include + +#include + +#ifdef USE_LIBMAGIC +#include +#endif + +#ifdef EAPI +# undef EAPI +#endif /* ifdef EAPI */ + +#ifdef _WIN32 +# ifdef EFL_EET_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else /* ifdef DLL_EXPORT */ +# define EAPI +# endif /* ! DLL_EXPORT */ +# else /* ifdef EFL_EET_BUILD */ +# define EAPI __declspec(dllimport) +# endif /* ! EFL_EET_BUILD */ +#else /* ifdef _WIN32 */ +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# else /* if __GNUC__ >= 4 */ +# define EAPI +# endif /* if __GNUC__ >= 4 */ +# else /* ifdef __GNUC__ */ +# define EAPI +# endif /* ifdef __GNUC__ */ +#endif /* ! _WIN32 */ + + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:types + * @short_description: some defined types for libg3d + * @include: g3d/g3d.h + */ +/* goffset is defined since glib 2.14 */ +#ifndef G_MAXOFFSET +typedef gint64 goffset; +#endif + +/* supposed to trick gtk-doc not to ignore these functions - not really... */ +#define _G3D_STATIC_INLINE static inline + +/***************************************************************************** + * basic types + *****************************************************************************/ + +/** + * SECTION:types + * @short_description: Basic types + * @include: g3d/types.h + * + * Some basic type abstractions used in libg3d. + */ + +/** + * G3DFloat: + * + * Default floating point type. If used consistently in the library (not the + * case at the moment) this type can be switched between single and double + * precision at compile-time. + */ +/** + * G3D_FLOAT_IS_DOUBLE + * + * A flag indicating type of #G3DFloat. It is TRUE if #G3DFloat is double and + * FALSE if #G3DFloat is single precision. + */ +#if 1 +#define G3D_FLOAT_IS_DOUBLE TRUE +#define G3D_SCANF_FLOAT "%lf" +typedef gdouble G3DFloat; +#else +#define G3D_FLOAT_IS_DOUBLE FALSE +#define G3D_SCANF_FLOAT "%f" +typedef gfloat G3DFloat; +#endif +/** + * G3DSingle: + * + * Single-precision floating point number. + */ +typedef gfloat G3DSingle; +/** + * G3DDouble: + * + * Double-precision floating point number. + */ +typedef gdouble G3DDouble; +/** + * G3DVector + * + * Vector element type. + */ +typedef G3DFloat G3DVector; +/** + * G3DMatrix: + * + * Matrix element type. + */ +typedef G3DFloat G3DMatrix; +/** + * G3DQuat + * + * Quaternion element type. + */ +typedef G3DFloat G3DQuat; + +/***************************************************************************** + * G3DImage + *****************************************************************************/ + +/** + * G3D_FLAG_IMG_GREYSCALE: + * + * The image just uses the red channel for grey value + */ +#define G3D_FLAG_IMG_GREYSCALE (1L << 1) + +/** + * G3DTexEnv: + * @G3D_TEXENV_UNSPECIFIED: unspecified, application decides + * @G3D_TEXENV_BLEND: use blending + * @G3D_TEXENV_DECAL: use as decal + * @G3D_TEXENV_MODULATE: use modulate + * @G3D_TEXENV_REPLACE: replace color + * + * Specify how the texture should interact with other material properties. + */ +typedef enum { + G3D_TEXENV_UNSPECIFIED = 0, + G3D_TEXENV_BLEND, + G3D_TEXENV_DECAL, + G3D_TEXENV_MODULATE, + G3D_TEXENV_REPLACE +} G3DTexEnv; + +/** + * G3DImage: + * @name: name of image + * @width: width of image in pixels + * @height: height of image in pixels + * @depth: depth of image in bits + * @flags: flags + * @pixeldata: the binary image data + * @tex_id: the OpenGL texture id, should be unique model-wide + * @tex_env: texture environment flags + * @tex_scale_u: factor scaling texture width, should be 1.0 for most cases + * @tex_scale_v: factor scaling texture height, should be 1.0 for most cases + * + * Object containing a two-dimensional pixel image. + */ +typedef struct { + gchar *name; + guint32 width; + guint32 height; + guint8 depth; + guint32 flags; + guint8 *pixeldata; + + guint32 tex_id; + G3DTexEnv tex_env; + G3DFloat tex_scale_u; + G3DFloat tex_scale_v; +} G3DImage; + +/***************************************************************************** + * G3DMaterial + *****************************************************************************/ + +/** + * G3D_FLAG_MAT_TWOSIDE: + * + * Faces using this material should be rendered two-sided as the direction + * is unknown. + */ +#define G3D_FLAG_MAT_TWOSIDE (1L << 0) + +/** + * G3DMaterial: + * @name: name of material + * @r: red component of color + * @g: green component of color + * @b: blue component of color + * @a: alpha component of color + * @shininess: shiny color + * @specular: specular color + * @flags: flags + * @tex_image: texture image (optional, may be NULL) + * + * A material object. + */ + +typedef struct { + gchar *name; + G3DFloat r, g, b, a; + GLfloat shininess; + GLfloat specular[4]; + guint32 flags; + + G3DImage *tex_image; +} G3DMaterial; + +/***************************************************************************** + * G3DFace + *****************************************************************************/ + +/** + * G3D_FLAG_FAC_NORMALS: + * + * The face has custom normals. + */ +#define G3D_FLAG_FAC_NORMALS (1L << 0) +/** + * G3D_FLAG_FAC_TEXMAP: + * + * The face has a texture map and texture coordinates. + */ +#define G3D_FLAG_FAC_TEXMAP (1L << 1) + +/** + * G3DFace: + * @vertex_count: number of vertices + * @vertex_indices: indices of vertices in #G3DObject + * @material: material to use for surface + * @flags: flags + * @normals: optional normal array (one vector - 3 #G3DVector values - for each + * vertex) + * @tex_image: optional texture image + * @tex_vertex_count: number of texture vertices, should be 0 or match + * vertex_count + * @tex_vertex_data: array of texture vertices + * + * An object representing a surface. + */ +typedef struct { + guint32 vertex_count; + guint32 *vertex_indices; + + G3DMaterial *material; + + guint32 flags; + + G3DVector *normals; + + G3DImage *tex_image; + guint32 tex_vertex_count; + G3DVector *tex_vertex_data; +} G3DFace; + +/***************************************************************************** + * G3DTransformation + *****************************************************************************/ + +/** + * G3DTransformation: + * @matrix: the transformation matrix + * @flags: flags + * + * A three-dimensional matrix transformation object. + */ +typedef struct { + G3DMatrix matrix[16]; + guint32 flags; +} G3DTransformation; + + +/***************************************************************************** + * G3DObject + *****************************************************************************/ + +/** + * G3DObject: + * @name: name of object + * @materials: list of materials + * @faces: list of faces + * @objects: list of sub-objects + * @transformation: optional transformation + * @hide: flag to disable object rendering + * @vertex_count: number of vertices + * @vertex_data: vertex vector data + * + * A three-dimensional object. + */ +typedef struct { + gchar *name; + + GSList *materials; + GSList *faces; + GSList *objects; + + /* transformation, may be NULL */ + G3DTransformation *transformation; + + /* don't render this object */ + gboolean hide; + + /* vertices */ + guint32 vertex_count; + G3DVector *vertex_data; + + /*< private >*/ + /* FIXME: texture stuff: temporary storage, should be in G3DFace items */ + guint32 tex_vertex_count; + G3DVector *tex_vertex_data; + G3DImage *tex_image; + + /*< private >*/ + /* some fields to speed up rendering, should not be used by plugins */ + /* FIXME: remove from API (replace with user_data pointer?) */ + G3DVector *_normals; + G3DMaterial **_materials; + guint32 _num_faces; + guint32 *_indices; + guint32 *_flags; + guint32 *_tex_images; + G3DVector *_tex_coords; +} G3DObject; + +/***************************************************************************** + * G3DContext + *****************************************************************************/ + +/** + * G3DSetBgColorFunc: + * @r: red component + * @g: green component + * @b: blue component + * @a: alpha component + * @user_data: opaque data as given to g3d_context_set_set_bgcolor_func() + * + * Background color setting callback. + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DSetBgColorFunc)(G3DFloat r, G3DFloat g, G3DFloat b, + G3DFloat a, gpointer user_data); + +/** + * G3DUpdateInterfaceFunc: + * @user_data: opaque data as given to g3d_context_set_update_interface_func() + * + * Interface updating callback. + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DUpdateInterfaceFunc)(gpointer user_data); + +/** + * G3DUpdateProgressBarFunc: + * @percentage: progress of plugin operation + * @show: #TRUE if the progress bar should be visible, #FALSE else + * @user_data: opaque data as given to + * g3d_context_set_update_progress_bar_func() + * + * Progress updating callback. + * + * Returns: TRUE on success, FALSE else. + */ +typedef gboolean (* G3DUpdateProgressBarFunc)(G3DFloat percentage, + gboolean show, gpointer user_data); + +/*< private >*/ +#ifdef USE_LIBMAGIC +#define MAGIC_PTR_TYPE magic_t +#else +#define MAGIC_PTR_TYPE void * +#endif +/*< public >*/ + +/** + * G3DContext: + * + * Internal stuff for libg3d. + */ +typedef struct { + /*< private >*/ + GSList *plugins; + MAGIC_PTR_TYPE magic_cookie; + + GHashTable *exts_import; + GHashTable *exts_image; + + G3DSetBgColorFunc set_bgcolor_func; + gpointer set_bgcolor_data; + G3DUpdateInterfaceFunc update_interface_func; + gpointer update_interface_data; + G3DUpdateProgressBarFunc update_progress_bar_func; + gpointer update_progress_bar_data; + + GHashTable *modelCache; +} G3DContext; + +/***************************************************************************** + * G3DPlugin: real definition in g3d/plugins.h + *****************************************************************************/ + +typedef struct _G3DPlugin G3DPlugin; + +/***************************************************************************** + * G3DStream + *****************************************************************************/ + +/* declared in stream.h */ +typedef struct _G3DStream G3DStream; + +/***************************************************************************** + * G3DModel + *****************************************************************************/ + +/** + * G3DModel: + * @filename: file name or URI of loaded model, may be set by application + * @materials: list of materials (#G3DMaterial) + * @objects: list of objects (#G3DObject) + * + * A 3D model. + */ +typedef struct { + gchar *filename; + /*< private >*/ + G3DContext *context; + + /*< public >*/ + GSList *materials; + GSList *objects; + + /*< private >*/ + GHashTable *tex_images; + + /* the plugin used to load the model, may be NULL */ + G3DPlugin *plugin; + /* The stream used to load the model, may be NULL */ + G3DStream *stream; + + int refCount; +} G3DModel; + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_TYPES_H__ */ + diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h new file mode 100644 index 0000000..aeb838c --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h @@ -0,0 +1,125 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __G3D_VECTOR_H__ +#define __G3D_VECTOR_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* ifdef __cplusplus */ + +/** + * SECTION:vector + * @short_description: Vector manipulation and calculation + * @include: g3d/vector.h + * + * A vector is a one-dimensional array of floating point data. + * + * Declare it as statically as: + * + * G3DVector vector[3]; + * + * or allocate it dynamically with: + * + * G3DVector *vector = g3d_vector_new(3, 1); + */ + +/** + * g3d_vector_new: + * @size: number of items in one vector + * @n: number of vectors to allocate + * + * Allocate memory for a number of vectors. + * + * Returns: newly allocated vectors + */ +_G3D_STATIC_INLINE G3DVector *g3d_vector_new(guint32 size, guint32 n) { + return g_new0(G3DVector, size * n); +} + +/** + * g3d_vector_free: + * @vector: vector to free + * + * Free memory allocated for vector. + */ +_G3D_STATIC_INLINE void g3d_vector_free(G3DVector *vector) { + g_free(vector); +} + +/** + * g3d_vector_normal: + * @ax: x component first vector + * @ay: y component first vector + * @az: z component first vector + * @bx: x component second vector + * @by: y component second vector + * @bz: z component second vector + * @nx: x component resulting normal + * @ny: y component resulting normal + * @nz: z component resulting normal + * + * calculate the normal from a plane defined by two vectors + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_vector_normal(G3DFloat ax, G3DFloat ay, G3DFloat az, + G3DFloat bx, G3DFloat by, G3DFloat bz, + G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); + +/** + * g3d_vector_unify: + * @nx: x component of vector + * @ny: y component of vector + * @nz: z component of vector + * + * Transforms the given vector to the unit vector. + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_vector_unify(G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); + +/** + * g3d_vector_transform: + * @x: x component of vector + * @y: y component of vector + * @z: z component of vector + * @matrix: transformation matrix (4x4) + * + * Transforms the given vector corresponding to the given matrix + * + * Returns: TRUE on success, FALSE else + */ +EAPI +gboolean g3d_vector_transform(G3DFloat *x, G3DFloat *y, G3DFloat *z, + G3DMatrix *matrix); + +#ifdef __cplusplus +} +#endif /* ifdef __cplusplus */ + +#endif /* __G3D_VECTOR_H__ */ + -- cgit v1.1