mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Update Assimp lib/dll/includes. Update glfw3 lib (all 64 bit now).
This commit is contained in:
BIN
dlls/assimp-vc140-mt.dll
Normal file
BIN
dlls/assimp-vc140-mt.dll
Normal file
Binary file not shown.
BIN
dlls/assimp.dll
BIN
dlls/assimp.dll
Binary file not shown.
8
includes/assimp/.editorconfig
Normal file
8
includes/assimp/.editorconfig
Normal file
@@ -0,0 +1,8 @@
|
||||
# See <http://EditorConfig.org> for details
|
||||
|
||||
[*.{h,hpp,inl}]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
@@ -3,7 +3,7 @@
|
||||
* BSD License:
|
||||
****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2005-2007 Paul Hsieh
|
||||
* Copyright (c) 2005-2016 Paul Hsieh
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
****************************************************************************
|
||||
*
|
||||
* Version 0.1.10
|
||||
* Version 0.1.15.4
|
||||
*
|
||||
* The ANSI C standard committee, for the C99 standard, specified the
|
||||
* inclusion of a new standard include file called stdint.h. This is
|
||||
@@ -42,19 +42,17 @@
|
||||
* integer libraries and so on. But for most developers its likely
|
||||
* useful just for programming sanity.
|
||||
*
|
||||
* The problem is that most compiler vendors have decided not to
|
||||
* implement the C99 standard, and the next C++ language standard
|
||||
* (which has a lot more mindshare these days) will be a long time in
|
||||
* coming and its unknown whether or not it will include stdint.h or
|
||||
* how much adoption it will have. Either way, it will be a long time
|
||||
* before all compilers come with a stdint.h and it also does nothing
|
||||
* for the extremely large number of compilers available today which
|
||||
* do not include this file, or anything comparable to it.
|
||||
* The problem is that some compiler vendors chose to ignore the C99
|
||||
* standard and some older compilers have no opportunity to be updated.
|
||||
* Because of this situation, simply including stdint.h in your code
|
||||
* makes it unportable.
|
||||
*
|
||||
* So that's what this file is all about. Its an attempt to build a
|
||||
* single universal include file that works on as many platforms as
|
||||
* possible to deliver what stdint.h is supposed to. A few things
|
||||
* that should be noted about this file:
|
||||
* possible to deliver what stdint.h is supposed to. Even compilers
|
||||
* that already come with stdint.h can use this file instead without
|
||||
* any loss of functionality. A few things that should be noted about
|
||||
* this file:
|
||||
*
|
||||
* 1) It is not guaranteed to be portable and/or present an identical
|
||||
* interface on all platforms. The extreme variability of the
|
||||
@@ -73,7 +71,7 @@
|
||||
* include stdint.h. The hope is that one or the other can be
|
||||
* used with no real difference.
|
||||
*
|
||||
* 5) In the current verison, if your platform can't represent
|
||||
* 5) In the current version, if your platform can't represent
|
||||
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
||||
* error.
|
||||
*
|
||||
@@ -154,7 +152,12 @@
|
||||
* PRINTF_INT64_DEC_WIDTH
|
||||
* PRINTF_INT32_DEC_WIDTH
|
||||
* PRINTF_INT16_DEC_WIDTH
|
||||
* PRINTF_INT8_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
* PRINTF_UINTMAX_DEC_WIDTH
|
||||
* PRINTF_UINT64_DEC_WIDTH
|
||||
* PRINTF_UINT32_DEC_WIDTH
|
||||
* PRINTF_UINT16_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
*
|
||||
* Which specifies the maximum number of characters required to
|
||||
* print the number of that type in either hexadecimal or decimal.
|
||||
@@ -178,6 +181,10 @@
|
||||
* Chris Howie
|
||||
* John Steele Scott
|
||||
* Dave Thorup
|
||||
* John Dill
|
||||
* Florian Wobbe
|
||||
* Christopher Sean Morrison
|
||||
* Mikkel Fahnoe Jorgensen
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -190,15 +197,28 @@
|
||||
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
|
||||
*/
|
||||
|
||||
#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)))) && !defined (_PSTDINT_H_INCLUDED) && !defined(_STDINT)
|
||||
#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
|
||||
#include <stdint.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "l"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# else
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# if (UINT_MAX == UINT32_MAX)
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# else
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
@@ -208,32 +228,62 @@
|
||||
# ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_HEX_WIDTH
|
||||
# define PRINTF_UINT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_HEX_WIDTH
|
||||
# define PRINTF_UINT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_HEX_WIDTH
|
||||
# define PRINTF_UINT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_HEX_WIDTH
|
||||
# define PRINTF_UINT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "20"
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_HEX_WIDTH
|
||||
# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_DEC_WIDTH
|
||||
# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
|
||||
/*
|
||||
@@ -287,6 +337,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* I have no idea what is the truly correct thing to do on older Solaris.
|
||||
* From some online discussions, this seems to be what is being
|
||||
* recommended. For people who actually are developing on older Solaris,
|
||||
* what I would like to know is, does this define all of the relevant
|
||||
* macros of a complete stdint.h? Remember, in pstdint.h 64 bit is
|
||||
* considered optional.
|
||||
*/
|
||||
|
||||
#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
|
||||
#include <sys/inttypes.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
#endif
|
||||
|
||||
#ifndef _PSTDINT_H_INCLUDED
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
|
||||
@@ -303,7 +367,7 @@
|
||||
#ifndef UINT8_MAX
|
||||
# define UINT8_MAX 0xff
|
||||
#endif
|
||||
#ifndef uint8_t
|
||||
#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
|
||||
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned char uint8_t;
|
||||
# define UINT8_C(v) ((uint8_t) v)
|
||||
@@ -318,7 +382,7 @@
|
||||
#ifndef INT8_MIN
|
||||
# define INT8_MIN INT8_C(0x80)
|
||||
#endif
|
||||
#ifndef int8_t
|
||||
#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
|
||||
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed char int8_t;
|
||||
# define INT8_C(v) ((int8_t) v)
|
||||
@@ -330,7 +394,7 @@
|
||||
#ifndef UINT16_MAX
|
||||
# define UINT16_MAX 0xffff
|
||||
#endif
|
||||
#ifndef uint16_t
|
||||
#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
|
||||
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned int uint16_t;
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
@@ -354,7 +418,7 @@
|
||||
#ifndef INT16_MIN
|
||||
# define INT16_MIN INT16_C(0x8000)
|
||||
#endif
|
||||
#ifndef int16_t
|
||||
#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
|
||||
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed int int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
@@ -375,7 +439,7 @@
|
||||
#ifndef UINT32_MAX
|
||||
# define UINT32_MAX (0xffffffffUL)
|
||||
#endif
|
||||
#ifndef uint32_t
|
||||
#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
|
||||
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned long uint32_t;
|
||||
# define UINT32_C(v) v ## UL
|
||||
@@ -405,7 +469,7 @@
|
||||
#ifndef INT32_MIN
|
||||
# define INT32_MIN INT32_C(0x80000000)
|
||||
#endif
|
||||
#ifndef int32_t
|
||||
#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
|
||||
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed long int32_t;
|
||||
# define INT32_C(v) v ## L
|
||||
@@ -438,7 +502,7 @@
|
||||
|
||||
#undef stdint_int64_defined
|
||||
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
|
||||
# if (__STDC__ && __STDC_VERSION >= 199901L) || defined (S_SPLINT_S)
|
||||
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
@@ -451,7 +515,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined (stdint_int64_defined)
|
||||
# if defined(__GNUC__)
|
||||
# if defined(__GNUC__) && !defined(vxWorks)
|
||||
# define stdint_int64_defined
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
@@ -514,9 +578,8 @@
|
||||
#ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
#endif
|
||||
|
||||
#ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "20"
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
@@ -527,6 +590,18 @@
|
||||
#ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ok, lets not worry about 128 bit integers for now. Moore's law says
|
||||
@@ -646,7 +721,7 @@ typedef uint_least32_t uint_fast32_t;
|
||||
* type limits.
|
||||
*/
|
||||
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
|
||||
# include <wchar.h>
|
||||
# ifndef WCHAR_MIN
|
||||
# define WCHAR_MIN 0
|
||||
@@ -661,12 +736,12 @@ typedef uint_least32_t uint_fast32_t;
|
||||
* (u)intptr_t types and limits.
|
||||
*/
|
||||
|
||||
#if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
|
||||
#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef STDINT_H_UINTPTR_T_DEFINED
|
||||
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
|
||||
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 64
|
||||
# elif defined (__WATCOMC__) || defined (__TURBOC__)
|
||||
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
||||
@@ -674,10 +749,12 @@ typedef uint_least32_t uint_fast32_t;
|
||||
# else
|
||||
# define stdint_intptr_bits 32
|
||||
# endif
|
||||
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
|
||||
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 32
|
||||
# elif defined (__INTEL_COMPILER)
|
||||
/* TODO -- what will Intel do about x86-64? */
|
||||
/* TODO -- what did Intel do about x86-64? */
|
||||
# else
|
||||
/* #error "This platform might not be supported yet" */
|
||||
# endif
|
||||
|
||||
# ifdef stdint_intptr_bits
|
||||
@@ -727,3 +804,109 @@ typedef uint_least32_t uint_fast32_t;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
|
||||
|
||||
/*
|
||||
* Please compile with the maximum warning settings to make sure macros are
|
||||
* not defined more than once.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define glue3_aux(x,y,z) x ## y ## z
|
||||
#define glue3(x,y,z) glue3_aux(x,y,z)
|
||||
|
||||
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
|
||||
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
|
||||
|
||||
#define DECL(us,bits) glue3(DECL,us,) (bits)
|
||||
|
||||
#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
|
||||
|
||||
#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
|
||||
|
||||
int main () {
|
||||
int err_n = 0;
|
||||
int err_first = 0;
|
||||
DECL(I,8)
|
||||
DECL(U,8)
|
||||
DECL(I,16)
|
||||
DECL(U,16)
|
||||
DECL(I,32)
|
||||
DECL(U,32)
|
||||
#ifdef INT64_MAX
|
||||
DECL(I,64)
|
||||
DECL(U,64)
|
||||
#endif
|
||||
intmax_t imax = INTMAX_C(0);
|
||||
uintmax_t umax = UINTMAX_C(0);
|
||||
char str0[256], str1[256];
|
||||
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
|
||||
if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
|
||||
if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
|
||||
if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
|
||||
if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
#endif
|
||||
|
||||
sprintf (str0, "%d %x\n", 0, ~0);
|
||||
|
||||
sprintf (str1, "%d %x\n", i8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
|
||||
sprintf (str1, "%d %x\n", i16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
|
||||
#endif
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
|
||||
|
||||
TESTUMAX(8);
|
||||
TESTUMAX(16);
|
||||
TESTUMAX(32);
|
||||
#ifdef INT64_MAX
|
||||
TESTUMAX(64);
|
||||
#endif
|
||||
|
||||
#define STR(v) #v
|
||||
#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
|
||||
if (err_n) {
|
||||
printf ("pstdint.h is not correct. Please use sizes below to correct it:\n");
|
||||
}
|
||||
|
||||
Q(int)
|
||||
Q(unsigned)
|
||||
Q(long int)
|
||||
Q(short int)
|
||||
Q(int8_t)
|
||||
Q(int16_t)
|
||||
Q(int32_t)
|
||||
#ifdef INT64_MAX
|
||||
Q(int64_t)
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# pragma pack(push,1)
|
||||
# define PACK_STRUCT
|
||||
#elif defined( __GNUC__ )
|
||||
# if defined(__clang__)
|
||||
# if !defined(HOST_MINGW)
|
||||
# define PACK_STRUCT __attribute__((__packed__))
|
||||
# else
|
||||
# define PACK_STRUCT __attribute__((gcc_struct, __packed__))
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
// C4103: Packing was changed after the inclusion of the header, propably missing #pragma pop
|
||||
// C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
|
||||
# pragma warning (disable : 4103)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
/** @file DefaultLogger.h
|
||||
/** @file DefaultLogger.hpp
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_AI_DEFAULTLOGGER
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
// ----------------------------------------------------------------------
|
||||
/** @briefPrivate construction for internal use by create().
|
||||
* @param severity Logging granularity */
|
||||
DefaultLogger(LogSeverity severity);
|
||||
explicit DefaultLogger(LogSeverity severity);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** @briefDestructor */
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file export.hpp
|
||||
/** @file Exporter.hpp
|
||||
* @brief Defines the CPP-API for the Assimp export interface
|
||||
*/
|
||||
#ifndef AI_EXPORT_HPP_INC
|
||||
@@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||
|
||||
#include "cexport.h"
|
||||
#include <map>
|
||||
|
||||
namespace Assimp {
|
||||
class ExporterPimpl;
|
||||
@@ -72,6 +73,9 @@ namespace Assimp {
|
||||
* #ExportToBlob is especially useful if you intend to work
|
||||
* with the data in-memory.
|
||||
*/
|
||||
|
||||
class ASSIMP_API ExportProperties;
|
||||
|
||||
class ASSIMP_API Exporter
|
||||
// TODO: causes good ol' base class has no dll interface warning
|
||||
//#ifdef __cplusplus
|
||||
@@ -81,7 +85,7 @@ class ASSIMP_API Exporter
|
||||
public:
|
||||
|
||||
/** Function pointer type of a Export worker function */
|
||||
typedef void (*fpExportFunc)(const char*,IOSystem*,const aiScene*);
|
||||
typedef void (*fpExportFunc)(const char*, IOSystem*, const aiScene*, const ExportProperties*);
|
||||
|
||||
/** Internal description of an Assimp export format option */
|
||||
struct ExportFormatEntry
|
||||
@@ -105,7 +109,14 @@ public:
|
||||
mEnforcePP = pEnforcePP;
|
||||
}
|
||||
|
||||
ExportFormatEntry() : mExportFunction(), mEnforcePP() {}
|
||||
ExportFormatEntry() :
|
||||
mExportFunction()
|
||||
, mEnforcePP()
|
||||
{
|
||||
mDescription.id = NULL;
|
||||
mDescription.description = NULL;
|
||||
mDescription.fileExtension = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -171,8 +182,8 @@ public:
|
||||
* Any IO handlers set via #SetIOHandler are ignored here.
|
||||
* @note Use aiCopyScene() to get a modifiable copy of a previously
|
||||
* imported scene. */
|
||||
const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing = 0u );
|
||||
inline const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u );
|
||||
const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
|
||||
inline const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -181,7 +192,7 @@ public:
|
||||
* about the output data flow of the export process.
|
||||
* @param pBlob A data blob obtained from a previous call to #aiExportScene. Must not be NULL.
|
||||
* @param pPath Full target file name. Target must be accessible.
|
||||
* @param pPreprocessing Accepts any choice of the #aiPostProcessing enumerated
|
||||
* @param pPreprocessing Accepts any choice of the #aiPostProcessSteps enumerated
|
||||
* flags, but in reality only a subset of them makes sense here. Specifying
|
||||
* 'preprocessing' flags is useful if the input scene does not conform to
|
||||
* Assimp's default conventions as specified in the @link data Data Structures Page @endlink.
|
||||
@@ -208,8 +219,8 @@ public:
|
||||
* @return AI_SUCCESS if everything was fine.
|
||||
* @note Use aiCopyScene() to get a modifiable copy of a previously
|
||||
* imported scene.*/
|
||||
aiReturn Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing = 0u);
|
||||
inline aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing = 0u);
|
||||
aiReturn Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
|
||||
inline aiReturn Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = NULL);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -251,7 +262,11 @@ public:
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns the number of export file formats available in the current
|
||||
* Assimp build. Use #Exporter::GetExportFormatDescription to
|
||||
* retrieve infos of a specific export format */
|
||||
* retrieve infos of a specific export format.
|
||||
*
|
||||
* This includes built-in exporters as well as exporters registered
|
||||
* using #RegisterExporter.
|
||||
**/
|
||||
size_t GetExportFormatCount() const;
|
||||
|
||||
|
||||
@@ -259,6 +274,12 @@ public:
|
||||
/** Returns a description of the nth export file format. Use #
|
||||
* #Exporter::GetExportFormatCount to learn how many export
|
||||
* formats are supported.
|
||||
*
|
||||
* The returned pointer is of static storage duration iff the
|
||||
* pIndex pertains to a built-in exporter (i.e. one not registered
|
||||
* via #RegistrerExporter). It is restricted to the life-time of the
|
||||
* #Exporter instance otherwise.
|
||||
*
|
||||
* @param pIndex Index of the export format to retrieve information
|
||||
* for. Valid range is 0 to #Exporter::GetExportFormatCount
|
||||
* @return A description of that specific export format.
|
||||
@@ -269,7 +290,9 @@ public:
|
||||
// -------------------------------------------------------------------
|
||||
/** Register a custom exporter. Custom export formats are limited to
|
||||
* to the current #Exporter instance and do not affect the
|
||||
* library globally.
|
||||
* library globally. The indexes under which the format's
|
||||
* export format description can be queried are assigned
|
||||
* monotonously.
|
||||
* @param desc Exporter description.
|
||||
* @return aiReturn_SUCCESS if the export format was successfully
|
||||
* registered. A common cause that would prevent an exporter
|
||||
@@ -297,19 +320,185 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
inline const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const std::string& pFormatId,unsigned int pPreprocessing )
|
||||
class ASSIMP_API ExportProperties
|
||||
{
|
||||
return ExportToBlob(pScene,pFormatId.c_str(),pPreprocessing);
|
||||
public:
|
||||
// Data type to store the key hash
|
||||
typedef unsigned int KeyType;
|
||||
|
||||
// typedefs for our four configuration maps.
|
||||
// We don't need more, so there is no need for a generic solution
|
||||
typedef std::map<KeyType, int> IntPropertyMap;
|
||||
typedef std::map<KeyType, float> FloatPropertyMap;
|
||||
typedef std::map<KeyType, std::string> StringPropertyMap;
|
||||
typedef std::map<KeyType, aiMatrix4x4> MatrixPropertyMap;
|
||||
|
||||
public:
|
||||
|
||||
/** Standard constructor
|
||||
* @see ExportProperties()
|
||||
*/
|
||||
|
||||
ExportProperties();
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Copy constructor.
|
||||
*
|
||||
* This copies the configuration properties of another ExportProperties.
|
||||
* @see ExportProperties(const ExportProperties& other)
|
||||
*/
|
||||
ExportProperties(const ExportProperties& other);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set an integer configuration property.
|
||||
* @param szName Name of the property. All supported properties
|
||||
* are defined in the aiConfig.g header (all constants share the
|
||||
* prefix AI_CONFIG_XXX and are simple strings).
|
||||
* @param iValue New value of the property
|
||||
* @return true if the property was set before. The new value replaces
|
||||
* the previous value in this case.
|
||||
* @note Property of different types (float, int, string ..) are kept
|
||||
* on different stacks, so calling SetPropertyInteger() for a
|
||||
* floating-point property has no effect - the loader will call
|
||||
* GetPropertyFloat() to read the property, but it won't be there.
|
||||
*/
|
||||
bool SetPropertyInteger(const char* szName, int iValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a boolean configuration property. Boolean properties
|
||||
* are stored on the integer stack internally so it's possible
|
||||
* to set them via #SetPropertyBool and query them with
|
||||
* #GetPropertyBool and vice versa.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
bool SetPropertyBool(const char* szName, bool value) {
|
||||
return SetPropertyInteger(szName,value);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a floating-point configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
bool SetPropertyFloat(const char* szName, float fValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a string configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
bool SetPropertyString(const char* szName, const std::string& sValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a matrix configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
bool SetPropertyMatrix(const char* szName, const aiMatrix4x4& sValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a configuration property.
|
||||
* @param szName Name of the property. All supported properties
|
||||
* are defined in the aiConfig.g header (all constants share the
|
||||
* prefix AI_CONFIG_XXX).
|
||||
* @param iErrorReturn Value that is returned if the property
|
||||
* is not found.
|
||||
* @return Current value of the property
|
||||
* @note Property of different types (float, int, string ..) are kept
|
||||
* on different lists, so calling SetPropertyInteger() for a
|
||||
* floating-point property has no effect - the loader will call
|
||||
* GetPropertyFloat() to read the property, but it won't be there.
|
||||
*/
|
||||
int GetPropertyInteger(const char* szName,
|
||||
int iErrorReturn = 0xffffffff) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a boolean configuration property. Boolean properties
|
||||
* are stored on the integer stack internally so it's possible
|
||||
* to set them via #SetPropertyBool and query them with
|
||||
* #GetPropertyBool and vice versa.
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
bool GetPropertyBool(const char* szName, bool bErrorReturn = false) const {
|
||||
return GetPropertyInteger(szName,bErrorReturn)!=0;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a floating-point configuration property
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
float GetPropertyFloat(const char* szName,
|
||||
float fErrorReturn = 10e10f) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a string configuration property
|
||||
*
|
||||
* The return value remains valid until the property is modified.
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
const std::string GetPropertyString(const char* szName,
|
||||
const std::string& sErrorReturn = "") const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a matrix configuration property
|
||||
*
|
||||
* The return value remains valid until the property is modified.
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
const aiMatrix4x4 GetPropertyMatrix(const char* szName,
|
||||
const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Determine a integer configuration property has been set.
|
||||
* @see HasPropertyInteger()
|
||||
*/
|
||||
bool HasPropertyInteger(const char* szName) const;
|
||||
|
||||
/** Determine a boolean configuration property has been set.
|
||||
* @see HasPropertyBool()
|
||||
*/
|
||||
bool HasPropertyBool(const char* szName) const;
|
||||
|
||||
/** Determine a boolean configuration property has been set.
|
||||
* @see HasPropertyFloat()
|
||||
*/
|
||||
bool HasPropertyFloat(const char* szName) const;
|
||||
|
||||
/** Determine a String configuration property has been set.
|
||||
* @see HasPropertyString()
|
||||
*/
|
||||
bool HasPropertyString(const char* szName) const;
|
||||
|
||||
/** Determine a Matrix configuration property has been set.
|
||||
* @see HasPropertyMatrix()
|
||||
*/
|
||||
bool HasPropertyMatrix(const char* szName) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** List of integer properties */
|
||||
IntPropertyMap mIntProperties;
|
||||
|
||||
/** List of floating-point properties */
|
||||
FloatPropertyMap mFloatProperties;
|
||||
|
||||
/** List of string properties */
|
||||
StringPropertyMap mStringProperties;
|
||||
|
||||
/** List of Matrix properties */
|
||||
MatrixPropertyMap mMatrixProperties;
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
inline const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const std::string& pFormatId,unsigned int pPreprocessing, const ExportProperties* pProperties)
|
||||
{
|
||||
return ExportToBlob(pScene,pFormatId.c_str(),pPreprocessing, pProperties);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
inline aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing )
|
||||
inline aiReturn Exporter :: Export( const aiScene* pScene, const std::string& pFormatId, const std::string& pPath, unsigned int pPreprocessing, const ExportProperties* pProperties)
|
||||
{
|
||||
return Export(pScene,pFormatId.c_str(),pPath.c_str(),pPreprocessing);
|
||||
return Export(pScene,pFormatId.c_str(),pPath.c_str(),pPreprocessing, pProperties);
|
||||
}
|
||||
|
||||
} // namespace Assimp
|
||||
#endif // ASSIMP_BUILD_NO_EXPORT
|
||||
#endif // AI_EXPORT_HPP_INC
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -38,7 +38,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
/** @file IOStream.h
|
||||
/** @file IOStream.hpp
|
||||
* @brief File I/O wrappers for C++.
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file IOSystem.h
|
||||
/** @file IOSystem.hpp
|
||||
* @brief File system wrapper for C++. Inherit this class to supply
|
||||
* custom file handling logic to the Import library.
|
||||
*/
|
||||
@@ -53,6 +53,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Assimp {
|
||||
class IOStream;
|
||||
|
||||
@@ -102,18 +105,14 @@ public:
|
||||
* @param pFile Path to the file
|
||||
* @return true if there is a file with this path, else false.
|
||||
*/
|
||||
|
||||
virtual bool Exists( const char* pFile) const = 0;
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Returns the system specific directory separator
|
||||
* @return System specific directory separator
|
||||
*/
|
||||
virtual char getOsSeparator() const = 0;
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Open a new file with a given path.
|
||||
*
|
||||
@@ -139,8 +138,6 @@ public:
|
||||
inline IOStream* Open(const std::string& pFile,
|
||||
const std::string& pMode = std::string("rb"));
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Closes the given file and releases all resources
|
||||
* associated with it.
|
||||
@@ -170,10 +167,41 @@ public:
|
||||
*/
|
||||
inline bool ComparePaths (const std::string& one,
|
||||
const std::string& second) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Pushes a new directory onto the directory stack.
|
||||
* @param path Path to push onto the stack.
|
||||
* @return True, when push was successful, false if path is empty.
|
||||
*/
|
||||
virtual bool PushDirectory( const std::string &path );
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Returns the top directory from the stack.
|
||||
* @return The directory on the top of the stack.
|
||||
* Returns empty when no directory was pushed to the stack.
|
||||
*/
|
||||
virtual const std::string &CurrentDirectory() const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Returns the number of directories stored on the stack.
|
||||
* @return The number of directories of the stack.
|
||||
*/
|
||||
virtual size_t StackSize() const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Pops the top directory from the stack.
|
||||
* @return True, when a directory was on the stack. False if no
|
||||
* directory was on the stack.
|
||||
*/
|
||||
virtual bool PopDirectory();
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_pathStack;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
AI_FORCE_INLINE IOSystem::IOSystem()
|
||||
AI_FORCE_INLINE IOSystem::IOSystem() :
|
||||
m_pathStack()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
@@ -220,6 +248,43 @@ inline bool IOSystem::ComparePaths (const std::string& one,
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
inline bool IOSystem::PushDirectory( const std::string &path ) {
|
||||
if ( path.empty() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pathStack.push_back( path );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
inline const std::string &IOSystem::CurrentDirectory() const {
|
||||
if ( m_pathStack.empty() ) {
|
||||
static const std::string Dummy("");
|
||||
return Dummy;
|
||||
}
|
||||
return m_pathStack[ m_pathStack.size()-1 ];
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
inline size_t IOSystem::StackSize() const {
|
||||
return m_pathStack.size();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
inline bool IOSystem::PopDirectory() {
|
||||
if ( m_pathStack.empty() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pathStack.pop_back();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
} //!ns Assimp
|
||||
|
||||
#endif //AI_IOSYSTEM_H_INC
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file assimp.hpp
|
||||
/** @file Importer.hpp
|
||||
* @brief Defines the C++-API to the Open Asset Import Library.
|
||||
*/
|
||||
#ifndef INCLUDED_AI_ASSIMP_HPP
|
||||
@@ -114,6 +114,11 @@ namespace Assimp {
|
||||
* threads for loading, each thread should maintain its own Importer instance.
|
||||
*/
|
||||
class ASSIMP_API Importer {
|
||||
public:
|
||||
/**
|
||||
* @brief The upper limit for hints.
|
||||
*/
|
||||
static const unsigned int MaxLenHint = 200;
|
||||
|
||||
public:
|
||||
|
||||
@@ -194,16 +199,14 @@ public:
|
||||
* are defined in the aiConfig.g header (all constants share the
|
||||
* prefix AI_CONFIG_XXX and are simple strings).
|
||||
* @param iValue New value of the property
|
||||
* @param bWasExisting Optional pointer to receive true if the
|
||||
* property was set before. The new value replaces the previous value
|
||||
* in this case.
|
||||
* @return true if the property was set before. The new value replaces
|
||||
* the previous value in this case.
|
||||
* @note Property of different types (float, int, string ..) are kept
|
||||
* on different stacks, so calling SetPropertyInteger() for a
|
||||
* floating-point property has no effect - the loader will call
|
||||
* GetPropertyFloat() to read the property, but it won't be there.
|
||||
*/
|
||||
void SetPropertyInteger(const char* szName, int iValue,
|
||||
bool* bWasExisting = NULL);
|
||||
bool SetPropertyInteger(const char* szName, int iValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a boolean configuration property. Boolean properties
|
||||
@@ -212,30 +215,27 @@ public:
|
||||
* #GetPropertyBool and vice versa.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
void SetPropertyBool(const char* szName, bool value, bool* bWasExisting = NULL) {
|
||||
SetPropertyInteger(szName,value,bWasExisting);
|
||||
bool SetPropertyBool(const char* szName, bool value) {
|
||||
return SetPropertyInteger(szName,value);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a floating-point configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
void SetPropertyFloat(const char* szName, float fValue,
|
||||
bool* bWasExisting = NULL);
|
||||
bool SetPropertyFloat(const char* szName, float fValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a string configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
void SetPropertyString(const char* szName, const std::string& sValue,
|
||||
bool* bWasExisting = NULL);
|
||||
bool SetPropertyString(const char* szName, const std::string& sValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Set a matrix configuration property.
|
||||
* @see SetPropertyInteger()
|
||||
*/
|
||||
void SetPropertyMatrix(const char* szName, const aiMatrix4x4& sValue,
|
||||
bool* bWasExisting = NULL);
|
||||
bool SetPropertyMatrix(const char* szName, const aiMatrix4x4& sValue);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Get a configuration property.
|
||||
@@ -458,11 +458,13 @@ public:
|
||||
* to the #Importer instance. */
|
||||
const aiScene* ApplyPostProcessing(unsigned int pFlags);
|
||||
|
||||
const aiScene* ApplyCustomizedPostProcessing( BaseProcess *rootProcess, bool requestValidation );
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Reads the given file and returns its contents if successful.
|
||||
*
|
||||
* This function is provided for backward compatibility.
|
||||
* See the const char* version for detailled docs.
|
||||
* See the const char* version for detailed docs.
|
||||
* @see ReadFile(const char*, pFlags) */
|
||||
const aiScene* ReadFile(
|
||||
const std::string& pFile,
|
||||
@@ -624,8 +626,8 @@ public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Private, do not use. */
|
||||
ImporterPimpl* Pimpl() { return pimpl; };
|
||||
const ImporterPimpl* Pimpl() const { return pimpl; };
|
||||
ImporterPimpl* Pimpl() { return pimpl; }
|
||||
const ImporterPimpl* Pimpl() const { return pimpl; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -38,7 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file LogStream.h
|
||||
/** @file LogStream.hpp
|
||||
* @brief Abstract base class 'LogStream', representing an output log stream.
|
||||
*/
|
||||
#ifndef INCLUDED_AI_LOGSTREAM_H
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -160,7 +160,7 @@ protected:
|
||||
Logger();
|
||||
|
||||
/** Construction with a given log severity */
|
||||
Logger(LogSeverity severity);
|
||||
explicit Logger(LogSeverity severity);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
/** @brief Called as a request to write a specific debug message
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -38,7 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file NullLogger.h
|
||||
/** @file NullLogger.hpp
|
||||
* @brief Dummy logger
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -38,7 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file ProgressHandler.h
|
||||
/** @file ProgressHandler.hpp
|
||||
* @brief Abstract base class 'ProgressHandler'.
|
||||
*/
|
||||
#ifndef INCLUDED_AI_PROGRESSHANDLER_H
|
||||
@@ -81,13 +81,39 @@ public:
|
||||
* all needed cleanup tasks prior to returning control to the
|
||||
* caller). If the loading is aborted, #Importer::ReadFile()
|
||||
* returns always NULL.
|
||||
*
|
||||
* @note Currently, percentage is always -1.f because there is
|
||||
* no reliable way to compute it.
|
||||
* */
|
||||
virtual bool Update(float percentage = -1.f) = 0;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Progress callback for file loading steps
|
||||
* @param numberOfSteps The number of total post-processing
|
||||
* steps
|
||||
* @param currentStep The index of the current post-processing
|
||||
* step that will run, or equal to numberOfSteps if all of
|
||||
* them has finished. This number is always strictly monotone
|
||||
* increasing, although not necessarily linearly.
|
||||
*
|
||||
* @note This is currently only used at the start and the end
|
||||
* of the file parsing.
|
||||
* */
|
||||
virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
||||
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
|
||||
Update( f * 0.5f );
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** @brief Progress callback for post-processing steps
|
||||
* @param numberOfSteps The number of total post-processing
|
||||
* steps
|
||||
* @param currentStep The index of the current post-processing
|
||||
* step that will run, or equal to numberOfSteps if all of
|
||||
* them has finished. This number is always strictly monotone
|
||||
* increasing, although not necessarily linearly.
|
||||
* */
|
||||
virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
||||
float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f;
|
||||
Update( f * 0.5f + 0.5f );
|
||||
}
|
||||
|
||||
}; // !class ProgressHandler
|
||||
// ------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,43 @@
|
||||
/** @file assert.h
|
||||
*/
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef AI_DEBUG_H_INC
|
||||
#define AI_DEBUG_H_INC
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -409,7 +409,7 @@ namespace Assimp {
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief CPP-API: Utility class to simplify interpolations of various data types.
|
||||
*
|
||||
* The type of interpolation is choosen automatically depending on the
|
||||
* The type of interpolation is chosen automatically depending on the
|
||||
* types of the arguments. */
|
||||
template <typename T>
|
||||
struct Interpolator
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -86,13 +86,20 @@ ASSIMP_API size_t aiGetExportFormatCount(void);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Returns a description of the nth export file format. Use #aiGetExportFormatCount()
|
||||
* to learn how many export formats are supported.
|
||||
* to learn how many export formats are supported. The description must be released by
|
||||
* calling aiReleaseExportFormatDescription afterwards.
|
||||
* @param pIndex Index of the export format to retrieve information for. Valid range is
|
||||
* 0 to #aiGetExportFormatCount()
|
||||
* @return A description of that specific export format. NULL if pIndex is out of range.
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiExportFormatDesc* aiGetExportFormatDescription( size_t pIndex);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Release a description of the nth export file format. Must be returned by
|
||||
* aiGetExportFormatDescription
|
||||
* @param desc Pointer to the description
|
||||
*/
|
||||
ASSIMP_API void aiReleaseExportFormatDescription( const C_STRUCT aiExportFormatDesc *desc );
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Create a modifiable copy of a scene.
|
||||
@@ -122,10 +129,7 @@ ASSIMP_API void aiFreeScene(const C_STRUCT aiScene* pIn);
|
||||
* @param pFormatId ID string to specify to which format you want to export to. Use
|
||||
* aiGetExportFormatCount() / aiGetExportFormatDescription() to learn which export formats are available.
|
||||
* @param pFileName Output file to write
|
||||
* @param pIO custom IO implementation to be used. Use this if you use your own storage methods.
|
||||
* If none is supplied, a default implementation using standard file IO is used. Note that
|
||||
* #aiExportSceneToBlob is provided as convenience function to export to memory buffers.
|
||||
* @param pPreprocessing Accepts any choice of the #aiPostProcessing enumerated
|
||||
* @param pPreprocessing Accepts any choice of the #aiPostProcessSteps enumerated
|
||||
* flags, but in reality only a subset of them makes sense here. Specifying
|
||||
* 'preprocessing' flags is useful if the input scene does not conform to
|
||||
* Assimp's default conventions as specified in the @link data Data Structures Page @endlink.
|
||||
@@ -183,7 +187,7 @@ ASSIMP_API aiReturn aiExportSceneEx( const C_STRUCT aiScene* pScene,
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Describes a blob of exported scene data. Use #aiExportSceneToBlob() to create a blob containing an
|
||||
* exported scene. The memory referred by this structure is owned by Assimp. Use #aiReleaseExportedFile()
|
||||
* exported scene. The memory referred by this structure is owned by Assimp.
|
||||
* to free its resources. Don't try to free the memory on your side - it will crash for most build configurations
|
||||
* due to conflicting heaps.
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiFileIO.h
|
||||
/** @file cfileio.h
|
||||
* @brief Defines generic C routines to access memory-mapped files
|
||||
*/
|
||||
#ifndef AI_FILEIO_H_INC
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,12 +39,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file assimp.h
|
||||
/** @file cimport.h
|
||||
* @brief Defines the C-API to the Open Asset Import Library.
|
||||
*/
|
||||
#ifndef AI_ASSIMP_H_INC
|
||||
#define AI_ASSIMP_H_INC
|
||||
#include "types.h"
|
||||
#include "importerdesc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -139,7 +140,17 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileEx(
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Same as #aiImportFileEx, but adds an extra parameter containing importer settings.
|
||||
*
|
||||
* @param pFile Path and filename of the file to be imported,
|
||||
* expected to be a null-terminated c-string. NULL is not a valid value.
|
||||
* @param pFlags Optional post processing steps to be executed after
|
||||
* a successful import. Provide a bitwise combination of the
|
||||
* #aiPostProcessSteps flags.
|
||||
* @param pFS aiFileIO structure. Will be used to open the model file itself
|
||||
* and any other files the loader needs to open. Pass NULL to use the default
|
||||
* implementation.
|
||||
* @param pProps #aiPropertyStore instance containing import settings.
|
||||
* @return Pointer to the imported data or NULL if the import failed.
|
||||
* @note Include <aiFileIO.h> for the definition of #aiFileIO.
|
||||
* @see aiImportFileEx
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties(
|
||||
@@ -188,7 +199,29 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory(
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings.
|
||||
*
|
||||
* @param pBuffer Pointer to the file data
|
||||
* @param pLength Length of pBuffer, in bytes
|
||||
* @param pFlags Optional post processing steps to be executed after
|
||||
* a successful import. Provide a bitwise combination of the
|
||||
* #aiPostProcessSteps flags. If you wish to inspect the imported
|
||||
* scene first in order to fine-tune your post-processing setup,
|
||||
* consider to use #aiApplyPostProcessing().
|
||||
* @param pHint An additional hint to the library. If this is a non empty string,
|
||||
* the library looks for a loader to support the file extension specified by pHint
|
||||
* and passes the file to the first matching loader. If this loader is unable to
|
||||
* completely the request, the library continues and tries to determine the file
|
||||
* format on its own, a task that may or may not be successful.
|
||||
* Check the return value, and you'll know ...
|
||||
* @param pProps #aiPropertyStore instance containing import settings.
|
||||
* @return A pointer to the imported data, NULL if the import failed.
|
||||
*
|
||||
* @note This is a straightforward way to decode models from memory
|
||||
* buffers, but it doesn't handle model formats that spread their
|
||||
* data across multiple files or even directories. Examples include
|
||||
* OBJ or MD3, which outsource parts of their material info into
|
||||
* external scripts. If you need full functionality, provide
|
||||
* a custom IOSystem to make Assimp find these files and use
|
||||
* the regular aiImportFileEx()/aiImportFileExWithProperties() API.
|
||||
* @see aiImportFileFromMemory
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties(
|
||||
@@ -210,7 +243,7 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties(
|
||||
* meaning this is still the same #aiScene which you passed for pScene. However,
|
||||
* _if_ post-processing failed, the scene could now be NULL. That's quite a rare
|
||||
* case, post processing steps are not really designed to 'fail'. To be exact,
|
||||
* the #aiProcess_ValidateDS flag is currently the only post processing step
|
||||
* the #aiProcess_ValidateDataStructure flag is currently the only post processing step
|
||||
* which can actually cause the scene to be reset to NULL.
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing(
|
||||
@@ -247,7 +280,7 @@ ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream(
|
||||
* Attaching a log stream can slightly reduce Assimp's overall import
|
||||
* performance. Multiple log-streams can be attached.
|
||||
* @param stream Describes the new log stream.
|
||||
* @note To ensure proepr destruction of the logging system, you need to manually
|
||||
* @note To ensure proper destruction of the logging system, you need to manually
|
||||
* call aiDetachLogStream() on every single log stream you attach.
|
||||
* Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided.
|
||||
*/
|
||||
@@ -266,7 +299,7 @@ ASSIMP_API void aiEnableVerboseLogging(aiBool d);
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Detach a custom log stream from the libraries' logging system.
|
||||
*
|
||||
* This is the counterpart of #aiAttachPredefinedLogStream. If you attached a stream,
|
||||
* This is the counterpart of #aiAttachLogStream. If you attached a stream,
|
||||
* don't forget to detach it again.
|
||||
* @param stream The log stream to be detached.
|
||||
* @return AI_SUCCESS if the log stream has been detached successfully.
|
||||
@@ -356,8 +389,9 @@ ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p);
|
||||
* interface, properties are always shared by all imports. It is not possible to
|
||||
* specify them per import.
|
||||
*
|
||||
* @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param szName Name of the configuration property to be set. All supported
|
||||
* public properties are defined in the config.h header file (#AI_CONFIG_XXX).
|
||||
* public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
||||
* @param value New value for the property
|
||||
*/
|
||||
ASSIMP_API void aiSetImportPropertyInteger(
|
||||
@@ -372,8 +406,9 @@ ASSIMP_API void aiSetImportPropertyInteger(
|
||||
* interface, properties are always shared by all imports. It is not possible to
|
||||
* specify them per import.
|
||||
*
|
||||
* @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param szName Name of the configuration property to be set. All supported
|
||||
* public properties are defined in the config.h header file (#AI_CONFIG_XXX).
|
||||
* public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
||||
* @param value New value for the property
|
||||
*/
|
||||
ASSIMP_API void aiSetImportPropertyFloat(
|
||||
@@ -388,10 +423,10 @@ ASSIMP_API void aiSetImportPropertyFloat(
|
||||
* interface, properties are always shared by all imports. It is not possible to
|
||||
* specify them per import.
|
||||
*
|
||||
* @param property store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param szName Name of the configuration property to be set. All supported
|
||||
* public properties are defined in the config.h header file (#AI_CONFIG_XXX).
|
||||
* @param value New value for the property
|
||||
* public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
||||
* @param st New value for the property
|
||||
*/
|
||||
ASSIMP_API void aiSetImportPropertyString(
|
||||
C_STRUCT aiPropertyStore* store,
|
||||
@@ -405,10 +440,10 @@ ASSIMP_API void aiSetImportPropertyString(
|
||||
* interface, properties are always shared by all imports. It is not possible to
|
||||
* specify them per import.
|
||||
*
|
||||
* @param property store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param store Store to modify. Use #aiCreatePropertyStore to obtain a store.
|
||||
* @param szName Name of the configuration property to be set. All supported
|
||||
* public properties are defined in the config.h header file (#AI_CONFIG_XXX).
|
||||
* @param value New value for the property
|
||||
* public properties are defined in the config.h header file (AI_CONFIG_XXX).
|
||||
* @param mat New value for the property
|
||||
*/
|
||||
ASSIMP_API void aiSetImportPropertyMatrix(
|
||||
C_STRUCT aiPropertyStore* store,
|
||||
@@ -505,7 +540,20 @@ ASSIMP_API void aiIdentityMatrix3(
|
||||
ASSIMP_API void aiIdentityMatrix4(
|
||||
C_STRUCT aiMatrix4x4* mat);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Returns the number of import file formats available in the current Assimp build.
|
||||
* Use aiGetImportFormatDescription() to retrieve infos of a specific import format.
|
||||
*/
|
||||
ASSIMP_API size_t aiGetImportFormatCount(void);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Returns a description of the nth import file format. Use #aiGetImportFormatCount()
|
||||
* to learn how many import formats are supported.
|
||||
* @param pIndex Index of the import format to retrieve information for. Valid range is
|
||||
* 0 to #aiGetImportFormatCount()
|
||||
* @return A description of that specific import format. NULL if pIndex is out of range.
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -38,7 +38,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
/** @file aiColor4D.h
|
||||
/** @file color4.h
|
||||
* @brief RGBA color structure, including operators when compiling in C++
|
||||
*/
|
||||
#ifndef AI_COLOR4D_H_INC
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
aiColor4t () : r(), g(), b(), a() {}
|
||||
aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a)
|
||||
: r(_r), g(_g), b(_b), a(_a) {}
|
||||
aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
|
||||
explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {}
|
||||
aiColor4t (const aiColor4t& o)
|
||||
: r(o.r), g(o.g), b(o.b), a(o.a) {}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiColor4D.inl
|
||||
/** @file color4.inl
|
||||
* @brief Inline implementation of aiColor4t<TReal> operators
|
||||
*/
|
||||
#ifndef AI_COLOR4D_INL_INC
|
||||
@@ -175,7 +175,7 @@ template <typename TReal>
|
||||
inline bool aiColor4t<TReal> :: IsBlack() const {
|
||||
// The alpha component doesn't care here. black is black.
|
||||
static const TReal epsilon = 10e-3f;
|
||||
return fabs( r ) < epsilon && fabs( g ) < epsilon && fabs( b ) < epsilon;
|
||||
return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -209,7 +209,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"PP_RRM_EXCLUDE_LIST"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Configures the #aiProcess_PretransformVertices step to
|
||||
/** @brief Configures the #aiProcess_PreTransformVertices step to
|
||||
* keep the scene hierarchy. Meshes are moved to worldspace, but
|
||||
* no optimization is performed (read: meshes with equal materials are not
|
||||
* joined. The total number of meshes won't change).
|
||||
@@ -224,7 +224,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"PP_PTV_KEEP_HIERARCHY"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Configures the #aiProcess_PretransformVertices step to normalize
|
||||
/** @brief Configures the #aiProcess_PreTransformVertices step to normalize
|
||||
* all vertex components into the [-1,1] range. That is, a bounding box
|
||||
* for the whole scene is computed, the maximum component is taken and all
|
||||
* meshes are scaled appropriately (uniformly of course!).
|
||||
@@ -234,7 +234,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"PP_PTV_NORMALIZE"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Configures the #aiProcess_PretransformVertices step to use
|
||||
/** @brief Configures the #aiProcess_PreTransformVertices step to use
|
||||
* a users defined matrix as the scene root node transformation before
|
||||
* transforming vertices.
|
||||
* Property type: bool. Default value: false.
|
||||
@@ -243,7 +243,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"PP_PTV_ADD_ROOT_TRANSFORMATION"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Configures the #aiProcess_PretransformVertices step to use
|
||||
/** @brief Configures the #aiProcess_PreTransformVertices step to use
|
||||
* a users defined matrix as the scene root node transformation before
|
||||
* transforming vertices. This property correspond to the 'a1' component
|
||||
* of the transformation matrix.
|
||||
@@ -376,7 +376,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Enumerates components of the aiScene and aiMesh data structures
|
||||
* that can be excluded from the import using the #aiPrpcess_RemoveComponent step.
|
||||
* that can be excluded from the import using the #aiProcess_RemoveComponent step.
|
||||
*
|
||||
* See the documentation to #aiProcess_RemoveComponent for more details.
|
||||
*/
|
||||
@@ -561,6 +561,15 @@ enum aiComponent
|
||||
#define AI_CONFIG_IMPORT_FBX_READ_MATERIALS \
|
||||
"IMPORT_FBX_READ_MATERIALS"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Set whether the fbx importer will read embedded textures.
|
||||
*
|
||||
* The default value is true (1)
|
||||
* Property type: bool
|
||||
*/
|
||||
#define AI_CONFIG_IMPORT_FBX_READ_TEXTURES \
|
||||
"IMPORT_FBX_READ_TEXTURES"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Set whether the fbx importer will read cameras.
|
||||
*
|
||||
@@ -715,7 +724,7 @@ enum aiComponent
|
||||
/** @brief Tells the MD3 loader which skin files to load.
|
||||
*
|
||||
* When loading MD3 files, Assimp checks whether a file
|
||||
* <md3_file_name>_<skin_name>.skin is existing. These files are used by
|
||||
* [md3_file_name]_[skin_name].skin is existing. These files are used by
|
||||
* Quake III to be able to assign different skins (e.g. red and blue team)
|
||||
* to models. 'default', 'red', 'blue' are typical skin names.
|
||||
* Property type: String. Default value: "default".
|
||||
@@ -728,14 +737,14 @@ enum aiComponent
|
||||
* MD3 file. This can also be a search path.
|
||||
*
|
||||
* By default Assimp's behaviour is as follows: If a MD3 file
|
||||
* <tt><any_path>/models/<any_q3_subdir>/<model_name>/<file_name>.md3</tt> is
|
||||
* <tt>any_path/models/any_q3_subdir/model_name/file_name.md3</tt> is
|
||||
* loaded, the library tries to locate the corresponding shader file in
|
||||
* <tt><any_path>/scripts/<model_name>.shader</tt>. This property overrides this
|
||||
* <tt>any_path/scripts/model_name.shader</tt>. This property overrides this
|
||||
* behaviour. It can either specify a full path to the shader to be loaded
|
||||
* or alternatively the path (relative or absolute) to the directory where
|
||||
* the shaders for all MD3s to be loaded reside. Assimp attempts to open
|
||||
* <tt><dir>/<model_name>.shader</tt> first, <tt><dir>/<file_name>.shader</tt>
|
||||
* is the fallback file. Note that <dir> should have a terminal (back)slash.
|
||||
* <tt>IMPORT_MD3_SHADER_SRC/model_name.shader</tt> first, <tt>IMPORT_MD3_SHADER_SRC/file_name.shader</tt>
|
||||
* is the fallback file. Note that IMPORT_MD3_SHADER_SRC should have a terminal (back)slash.
|
||||
* Property type: String. Default value: n/a.
|
||||
*/
|
||||
#define AI_CONFIG_IMPORT_MD3_SHADER_SRC \
|
||||
@@ -818,12 +827,13 @@ enum aiComponent
|
||||
/** @brief Ogre Importer detect the texture usage from its filename.
|
||||
*
|
||||
* Ogre material texture units do not define texture type, the textures usage
|
||||
* depends on the used shader or Ogres fixed pipeline. If this config property
|
||||
* depends on the used shader or Ogre's fixed pipeline. If this config property
|
||||
* is true Assimp will try to detect the type from the textures filename postfix:
|
||||
* _n, _nrm, _nrml, _normal, _normals and _normalmap for normal map, _s, _spec,
|
||||
* _specular and _specularmap for specular map, _l, _light, _lightmap, _occ
|
||||
* and _occlusion for light map, _disp and _displacement for displacement map.
|
||||
* The matching is case insensitive. Post fix is taken between last "_" and last ".".
|
||||
* The matching is case insensitive. Post fix is taken between the last
|
||||
* underscore and the last period.
|
||||
* Default behavior is to detect type from lower cased texture unit name by
|
||||
* matching against: normalmap, specularmap, lightmap and displacementmap.
|
||||
* For both cases if no match is found aiTextureType_DIFFUSE is used.
|
||||
@@ -841,6 +851,14 @@ enum aiComponent
|
||||
*/
|
||||
#define AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS "IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS"
|
||||
|
||||
/** @brief Specifies whether the Android JNI asset extraction is supported.
|
||||
*
|
||||
* Turn on this option if you want to manage assets in native
|
||||
* Android application without having to keep the internal directory and asset
|
||||
* manager pointer.
|
||||
*/
|
||||
#define AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT "AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Specifies whether the IFC loader skips over
|
||||
@@ -868,6 +886,22 @@ enum aiComponent
|
||||
*/
|
||||
#define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Specifies whether the Collada loader will ignore the provided up direction.
|
||||
*
|
||||
* If this property is set to true, the up direction provided in the file header will
|
||||
* be ignored and the file will be loaded as is.
|
||||
* Property type: Bool. Default value: false.
|
||||
*/
|
||||
#define AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION "IMPORT_COLLADA_IGNORE_UP_DIRECTION"
|
||||
|
||||
// ---------- All the Export defines ------------
|
||||
|
||||
/** @brief Specifies the xfile use double for real values of float
|
||||
*
|
||||
* Property type: Bool. Default value: false.
|
||||
*/
|
||||
|
||||
#define AI_CONFIG_EXPORT_XFILE_64BIT "EXPORT_XFILE_64BIT"
|
||||
|
||||
#endif // !! AI_CONFIG_H_INC
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiDefines.h
|
||||
/** @file defs.h
|
||||
* @brief Assimp build configuration setup. See the notes in the comment
|
||||
* blocks to find out how to customize _your_ Assimp build.
|
||||
*/
|
||||
@@ -162,8 +162,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# define AI_FORCE_INLINE inline
|
||||
#endif // (defined _MSC_VER)
|
||||
|
||||
#ifdef __clang__
|
||||
# define AI_WONT_RETURN_SUFFIX __attribute__((analyzer_noreturn))
|
||||
#ifdef __GNUC__
|
||||
# define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
|
||||
#else
|
||||
# define AI_WONT_RETURN_SUFFIX
|
||||
#endif // (defined __clang__)
|
||||
@@ -209,30 +209,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
|
||||
#error Currently, Borland is unsupported. Feel free to port Assimp.
|
||||
|
||||
// "W8059 Packgr<67><72>e der Struktur ge<67>ndert"
|
||||
// "W8059 Packgr<67><72>e der Struktur ge<67>ndert"
|
||||
|
||||
#endif
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
|
||||
* without boost. This is done by using a few workaround
|
||||
* classes and brings some limitations (e.g. some logging won't be done,
|
||||
* the library won't utilize threads or be threadsafe at all).
|
||||
* This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
|
||||
|
||||
// threading support requires boost
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
# define ASSIMP_BUILD_SINGLETHREADED
|
||||
#endif
|
||||
|
||||
#endif // !! ASSIMP_BUILD_BOOST_WORKAROUND
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
|
||||
* without threading support. The library doesn't utilize
|
||||
* threads then and is itself not threadsafe.
|
||||
* If this flag is specified boost::threads is *not* required. */
|
||||
* threads then and is itself not threadsafe. */
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
# define ASSIMP_BUILD_SINGLETHREADED
|
||||
@@ -257,8 +242,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
|
||||
|
||||
/* Tiny macro to convert from radians to degrees and back */
|
||||
#define AI_DEG_TO_RAD(x) (x*0.0174532925f)
|
||||
#define AI_RAD_TO_DEG(x) (x*57.2957795f)
|
||||
#define AI_DEG_TO_RAD(x) ((x)*0.0174532925f)
|
||||
#define AI_RAD_TO_DEG(x) ((x)*57.2957795f)
|
||||
|
||||
/* Support for big-endian builds */
|
||||
#if defined(__BYTE_ORDER__)
|
||||
@@ -276,4 +261,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# define AI_BUILD_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
|
||||
/* To avoid running out of memory
|
||||
* This can be adjusted for specific use cases
|
||||
* It's NOT a total limit, just a limit for individual allocations
|
||||
*/
|
||||
#define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type))
|
||||
|
||||
|
||||
#endif // !! INCLUDED_AI_DEFINES_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -72,7 +72,7 @@ enum aiImporterFlags
|
||||
* should be used with care. This only happens for trunk
|
||||
* (i.e. SVN) versions, experimental code is not included
|
||||
* in releases. */
|
||||
aiImporterFlags_Experimental = 0x10,
|
||||
aiImporterFlags_Experimental = 0x10
|
||||
};
|
||||
|
||||
|
||||
@@ -98,8 +98,7 @@ struct aiImporterDesc
|
||||
/** Implementation comments, i.e. unimplemented features*/
|
||||
const char* mComments;
|
||||
|
||||
/** Any combination of the #aiLoaderFlags enumerated values.
|
||||
These flags indicate some characteristics common to many
|
||||
/** These flags indicate some characteristics common to many
|
||||
importers. */
|
||||
unsigned int mFlags;
|
||||
|
||||
@@ -133,4 +132,12 @@ struct aiImporterDesc
|
||||
const char* mFileExtensions;
|
||||
};
|
||||
|
||||
/** \brief Returns the Importer description for a given extension.
|
||||
|
||||
Will return a NULL-pointer if no assigned importer desc. was found for the given extension
|
||||
\param extension [in] The extension to look for
|
||||
\return A pointer showing to the ImporterDesc, \see aiImporterDesc.
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -75,6 +75,17 @@ enum aiLightSourceType
|
||||
//! sport arenas.
|
||||
aiLightSource_SPOT = 0x3,
|
||||
|
||||
//! The generic light level of the world, including the bounces
|
||||
//! of all other light sources.
|
||||
//! Typically, there's at most one ambient light in a scene.
|
||||
//! This light type doesn't have a valid position, direction, or
|
||||
//! other properties, just a color.
|
||||
aiLightSource_AMBIENT = 0x4,
|
||||
|
||||
//! An area light is a rectangle with predefined size that uniformly
|
||||
//! emits light from one of its sides. The position is center of the
|
||||
//! rectangle and direction is its normal vector.
|
||||
aiLightSource_AREA = 0x5,
|
||||
|
||||
/** This value is not used. It is just there to force the
|
||||
* compiler to map this enum to a 32 Bit integer.
|
||||
@@ -128,6 +139,14 @@ struct aiLight
|
||||
*/
|
||||
C_STRUCT aiVector3D mDirection;
|
||||
|
||||
/** Up direction of the light source in space. Relative to the
|
||||
* transformation of the node corresponding to the light.
|
||||
*
|
||||
* The direction is undefined for point lights. The vector
|
||||
* may be normalized, but it needn't.
|
||||
*/
|
||||
C_STRUCT aiVector3D mUp;
|
||||
|
||||
/** Constant light attenuation factor.
|
||||
*
|
||||
* The intensity of the light source at a given distance 'd' from
|
||||
@@ -210,6 +229,9 @@ struct aiLight
|
||||
*/
|
||||
float mAngleOuterCone;
|
||||
|
||||
/** Size of area light source. */
|
||||
C_STRUCT aiVector2D mSize;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
aiLight()
|
||||
@@ -219,6 +241,7 @@ struct aiLight
|
||||
, mAttenuationQuadratic (0.f)
|
||||
, mAngleInnerCone ((float)AI_MATH_TWO_PI)
|
||||
, mAngleOuterCone ((float)AI_MATH_TWO_PI)
|
||||
, mSize (0.f, 0.f)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -95,20 +95,15 @@ enum aiTextureOp
|
||||
aiTextureOp_SignedAdd = 0x5,
|
||||
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiTextureOp_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Defines how UV coordinates outside the [0...1] range are handled.
|
||||
*
|
||||
* Commonly refered to as 'wrapping mode'.
|
||||
* Commonly referred to as 'wrapping mode'.
|
||||
*/
|
||||
enum aiTextureMapMode
|
||||
{
|
||||
@@ -131,14 +126,9 @@ enum aiTextureMapMode
|
||||
*/
|
||||
aiTextureMapMode_Mirror = 0x2,
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiTextureMapMode_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -176,14 +166,9 @@ enum aiTextureMapping
|
||||
aiTextureMapping_OTHER = 0x5,
|
||||
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiTextureMapping_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -296,14 +281,9 @@ enum aiTextureType
|
||||
aiTextureType_UNKNOWN = 0xC,
|
||||
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiTextureType_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
#define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
|
||||
@@ -374,14 +354,9 @@ enum aiShadingMode
|
||||
aiShadingMode_Fresnel = 0xa,
|
||||
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiShadingMode_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
|
||||
@@ -420,14 +395,9 @@ enum aiTextureFlags
|
||||
*/
|
||||
aiTextureFlags_IgnoreAlpha = 0x4,
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiTextureFlags_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
|
||||
@@ -442,8 +412,8 @@ enum aiTextureFlags
|
||||
* @code
|
||||
* SourceColor * SourceBlend + DestColor * DestBlend
|
||||
* @endcode
|
||||
* where <DestColor> is the previous color in the framebuffer at this
|
||||
* position and <SourceColor> is the material colro before the transparency
|
||||
* where DestColor is the previous color in the framebuffer at this
|
||||
* position and SourceColor is the material colro before the transparency
|
||||
* calculation.<br>
|
||||
* This corresponds to the #AI_MATKEY_BLEND_FUNC property.
|
||||
*/
|
||||
@@ -469,14 +439,9 @@ enum aiBlendMode
|
||||
// we don't need more for the moment, but we might need them
|
||||
// in future versions ...
|
||||
|
||||
/** @cond never
|
||||
* This value is not used. It forces the compiler to use at least
|
||||
* 32 Bit integers to represent this enum.
|
||||
*/
|
||||
#ifndef SWIG
|
||||
_aiBlendMode_Force32Bit = INT_MAX
|
||||
#endif
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
|
||||
@@ -862,7 +827,9 @@ public:
|
||||
/** @brief Remove a given key from the list.
|
||||
*
|
||||
* The function fails if the key isn't found
|
||||
* @param pKey Key to be deleted */
|
||||
* @param pKey Key to be deleted
|
||||
* @param type Set by the AI_MATKEY_XXX macro
|
||||
* @param index Set by the AI_MATKEY_XXX macro */
|
||||
aiReturn RemoveProperty (const char* pKey,
|
||||
unsigned int type = 0,
|
||||
unsigned int index = 0);
|
||||
@@ -1330,6 +1297,8 @@ extern "C" {
|
||||
#define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
|
||||
AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
|
||||
|
||||
//! @endcond
|
||||
//!
|
||||
// ---------------------------------------------------------------------------
|
||||
/** @brief Retrieve a material property with a specific key from the material
|
||||
*
|
||||
@@ -1537,6 +1506,7 @@ ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMa
|
||||
* Pass NULL if you're not interested in this information. Otherwise,
|
||||
* pass a pointer to an array of two aiTextureMapMode's (one for each
|
||||
* axis, UV order).
|
||||
* @param[out] flags Receives the the texture flags.
|
||||
* @return AI_SUCCESS on success, otherwise something else. Have fun.*/
|
||||
// ---------------------------------------------------------------------------
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiMaterial.inl
|
||||
/** @file material.inl
|
||||
* @brief Defines the C++ getters for the material system
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
* vector called "from" into another vector called "to".
|
||||
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
||||
* Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
||||
* Journal of Graphics Tools, 4(4):1-4, 1999
|
||||
*/
|
||||
@@ -160,8 +160,6 @@ public:
|
||||
const aiVector3t<TReal>& to, aiMatrix3x3t& out);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
TReal a1, a2, a3;
|
||||
TReal b1, b2, b3;
|
||||
TReal c1, c2, c3;
|
||||
@@ -172,13 +170,12 @@ typedef aiMatrix3x3t<float> aiMatrix3x3;
|
||||
#else
|
||||
|
||||
struct aiMatrix3x3 {
|
||||
|
||||
float a1, a2, a3;
|
||||
float b1, b2, b3;
|
||||
float c1, c2, c3;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#endif
|
||||
#endif // __cplusplus
|
||||
|
||||
#include "./Compiler/poppack1.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiMatrix3x3.inl
|
||||
/** @file matrix3x3.inl
|
||||
* @brief Inline implementation of the 3x3 matrix operators
|
||||
*/
|
||||
#ifndef AI_MATRIX3x3_INL_INC
|
||||
@@ -200,8 +200,8 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Inverse()
|
||||
template <typename TReal>
|
||||
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t<TReal>& out)
|
||||
{
|
||||
out.a1 = out.b2 = ::cos(a);
|
||||
out.b1 = ::sin(a);
|
||||
out.a1 = out.b2 = std::cos(a);
|
||||
out.b1 = std::sin(a);
|
||||
out.a2 = - out.b1;
|
||||
|
||||
out.a3 = out.b3 = out.c1 = out.c2 = 0.f;
|
||||
@@ -215,7 +215,7 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::RotationZ(TReal a, aiMatrix3x3t
|
||||
template <typename TReal>
|
||||
inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix3x3t<TReal>& out)
|
||||
{
|
||||
TReal c = cos( a), s = sin( a), t = 1 - c;
|
||||
TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
|
||||
TReal x = axis.x, y = axis.y, z = axis.z;
|
||||
|
||||
// Many thanks to MathWorld and Wikipedia
|
||||
@@ -241,7 +241,7 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::Translation( const aiVector2t<T
|
||||
* "from" into another vector called "to".
|
||||
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
||||
* Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
||||
* Journal of Graphics Tools, 4(4):1-4, 1999
|
||||
*/
|
||||
@@ -266,22 +266,26 @@ inline aiMatrix3x3t<TReal>& aiMatrix3x3t<TReal>::FromToMatrix(const aiVector3t<T
|
||||
{
|
||||
if (x.x < x.z)
|
||||
{
|
||||
x.x = static_cast<TReal>(1.0); x.y = x.z = static_cast<TReal>(0.0);
|
||||
x.x = static_cast<TReal>(1.0);
|
||||
x.y = x.z = static_cast<TReal>(0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
x.z = static_cast<TReal>(1.0); x.y = x.z = static_cast<TReal>(0.0);
|
||||
x.z = static_cast<TReal>(1.0);
|
||||
x.x = x.y = static_cast<TReal>(0.0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x.y < x.z)
|
||||
{
|
||||
x.y = static_cast<TReal>(1.0); x.x = x.z = static_cast<TReal>(0.0);
|
||||
x.y = static_cast<TReal>(1.0);
|
||||
x.x = x.z = static_cast<TReal>(0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
x.z = static_cast<TReal>(1.0); x.x = x.y = static_cast<TReal>(0.0);
|
||||
x.z = static_cast<TReal>(1.0);
|
||||
x.x = x.y = static_cast<TReal>(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_MATRIX4X4_H_INC
|
||||
#define AI_MATRIX4X4_H_INC
|
||||
|
||||
#include "vector3.h"
|
||||
#include "./Compiler/pushpack1.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -212,8 +213,8 @@ public:
|
||||
/** @brief A function for creating a rotation matrix that rotates a
|
||||
* vector called "from" into another vector called "to".
|
||||
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
||||
* Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
||||
* Authors: Tomas M<EFBFBD>ller, John Hughes
|
||||
* Output: mtx[3][3] -- a 3x3 matrix in column-major form
|
||||
* Authors: Tomas Mueller, John Hughes
|
||||
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
||||
* Journal of Graphics Tools, 4(4):1-4, 1999
|
||||
*/
|
||||
@@ -221,12 +222,10 @@ public:
|
||||
const aiVector3t<TReal>& to, aiMatrix4x4t& out);
|
||||
|
||||
public:
|
||||
|
||||
TReal a1, a2, a3, a4;
|
||||
TReal b1, b2, b3, b4;
|
||||
TReal c1, c2, c3, c4;
|
||||
TReal d1, d2, d3, d4;
|
||||
|
||||
} PACK_STRUCT;
|
||||
|
||||
typedef aiMatrix4x4t<float> aiMatrix4x4;
|
||||
@@ -238,7 +237,7 @@ struct aiMatrix4x4 {
|
||||
float b1, b2, b3, b4;
|
||||
float c1, c2, c3, c4;
|
||||
float d1, d2, d3, d4;
|
||||
};
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiMatrix4x4t<TReal>.inl
|
||||
/** @file matrix4x4.inl
|
||||
* @brief Inline implementation of the 4x4 matrix operators
|
||||
*/
|
||||
#ifndef AI_MATRIX4x4_INL_INC
|
||||
@@ -53,12 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <cmath>
|
||||
#else
|
||||
# include <math.h>
|
||||
#endif
|
||||
#include <cmath>
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
@@ -243,16 +238,22 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Inverse()
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
inline TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex)
|
||||
{
|
||||
inline TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) {
|
||||
if (p_iIndex > 3) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// XXX this is UB. Has been for years. The fact that it works now does not make it better.
|
||||
return &this->a1 + p_iIndex * 4;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
inline const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const
|
||||
{
|
||||
inline const TReal* aiMatrix4x4t<TReal>::operator[](unsigned int p_iIndex) const {
|
||||
if (p_iIndex > 3) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// XXX same
|
||||
return &this->a1 + p_iIndex * 4;
|
||||
}
|
||||
@@ -379,12 +380,12 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::FromEulerAnglesXYZ(TReal x, TRe
|
||||
{
|
||||
aiMatrix4x4t<TReal>& _this = *this;
|
||||
|
||||
TReal cr = cos( x );
|
||||
TReal sr = sin( x );
|
||||
TReal cp = cos( y );
|
||||
TReal sp = sin( y );
|
||||
TReal cy = cos( z );
|
||||
TReal sy = sin( z );
|
||||
TReal cr = std::cos( x );
|
||||
TReal sr = std::sin( x );
|
||||
TReal cp = std::cos( y );
|
||||
TReal sp = std::sin( y );
|
||||
TReal cy = std::cos( z );
|
||||
TReal sy = std::sin( z );
|
||||
|
||||
_this.a1 = cp*cy ;
|
||||
_this.a2 = cp*sy;
|
||||
@@ -439,8 +440,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationX(TReal a, aiMatrix4x4t
|
||||
| 0 sin(A) cos(A) 0 |
|
||||
| 0 0 0 1 | */
|
||||
out = aiMatrix4x4t<TReal>();
|
||||
out.b2 = out.c3 = cos(a);
|
||||
out.b3 = -(out.c2 = sin(a));
|
||||
out.b2 = out.c3 = std::cos(a);
|
||||
out.b3 = -(out.c2 = std::sin(a));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -455,8 +456,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationY(TReal a, aiMatrix4x4t
|
||||
| 0 0 0 1 |
|
||||
*/
|
||||
out = aiMatrix4x4t<TReal>();
|
||||
out.a1 = out.c3 = cos(a);
|
||||
out.c1 = -(out.a3 = sin(a));
|
||||
out.a1 = out.c3 = std::cos(a);
|
||||
out.c1 = -(out.a3 = std::sin(a));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -470,8 +471,8 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t
|
||||
| 0 0 1 0 |
|
||||
| 0 0 0 1 | */
|
||||
out = aiMatrix4x4t<TReal>();
|
||||
out.a1 = out.b2 = cos(a);
|
||||
out.a2 = -(out.b1 = sin(a));
|
||||
out.a1 = out.b2 = std::cos(a);
|
||||
out.a2 = -(out.b1 = std::sin(a));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -480,7 +481,7 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::RotationZ(TReal a, aiMatrix4x4t
|
||||
template <typename TReal>
|
||||
inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Rotation( TReal a, const aiVector3t<TReal>& axis, aiMatrix4x4t<TReal>& out)
|
||||
{
|
||||
TReal c = cos( a), s = sin( a), t = 1 - c;
|
||||
TReal c = std::cos( a), s = std::sin( a), t = 1 - c;
|
||||
TReal x = axis.x, y = axis.y, z = axis.z;
|
||||
|
||||
// Many thanks to MathWorld and Wikipedia
|
||||
@@ -521,7 +522,7 @@ inline aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Scaling( const aiVector3t<TReal
|
||||
* "from" into another vector called "to".
|
||||
* Input : from[3], to[3] which both must be *normalized* non-zero vectors
|
||||
* Output: mtx[3][3] -- a 3x3 matrix in colum-major form
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* Authors: Tomas M<>ller, John Hughes
|
||||
* "Efficiently Building a Matrix to Rotate One Vector to Another"
|
||||
* Journal of Graphics Tools, 4(4):1-4, 1999
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -249,7 +249,8 @@ struct aiBone
|
||||
|
||||
//! Default constructor
|
||||
aiBone()
|
||||
: mNumWeights( 0 )
|
||||
: mName()
|
||||
, mNumWeights( 0 )
|
||||
, mWeights( NULL )
|
||||
{
|
||||
}
|
||||
@@ -521,7 +522,7 @@ struct aiMesh
|
||||
* mixed primitive types (i.e. lines and triangles) may have
|
||||
* normals, but the normals for vertices that are only referenced by
|
||||
* point or line primitives are undefined and set to qNaN. See
|
||||
* the #mNormals member for a detailled discussion of qNaNs.
|
||||
* the #mNormals member for a detailed discussion of qNaNs.
|
||||
* @note If the mesh contains tangents, it automatically also
|
||||
* contains bitangents.
|
||||
*/
|
||||
@@ -578,7 +579,7 @@ struct aiMesh
|
||||
C_STRUCT aiBone** mBones;
|
||||
|
||||
/** The material used by this mesh.
|
||||
* A mesh does use only a single material. If an imported model uses
|
||||
* A mesh uses only a single material. If an imported model uses
|
||||
* multiple materials, the import splits up the mesh. Use this value
|
||||
* as index into the scene's material list.
|
||||
*/
|
||||
@@ -668,8 +669,7 @@ struct aiMesh
|
||||
}
|
||||
|
||||
//! Check whether the mesh contains positions. Provided no special
|
||||
//! scene flags are set (such as #AI_SCENE_FLAGS_ANIM_SKELETON_ONLY),
|
||||
//! this will always be true
|
||||
//! scene flags are set, this will always be true
|
||||
bool HasPositions() const
|
||||
{ return mVertices != NULL && mNumVertices > 0; }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1500)
|
||||
#include "Compiler/pstdint.h"
|
||||
#else
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
@@ -176,6 +177,9 @@ struct aiMetadata
|
||||
case AI_AIVECTOR3D:
|
||||
delete static_cast<aiVector3D*>(data);
|
||||
break;
|
||||
#ifndef SWIG
|
||||
case FORCE_32BIT:
|
||||
#endif
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
92
includes/assimp/port/AndroidJNI/AndroidJNIIOSystem.h
Normal file
92
includes/assimp/port/AndroidJNI/AndroidJNIIOSystem.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Android implementation of IOSystem using the standard C file functions.
|
||||
* Aimed to ease the access to android assets */
|
||||
|
||||
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
#ifndef AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#define AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
|
||||
#include "../code/DefaultIOSystem.h"
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/asset_manager_jni.h>
|
||||
#include <android/native_activity.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** Android extension to DefaultIOSystem using the standard C file functions */
|
||||
class ASSIMP_API AndroidJNIIOSystem : public DefaultIOSystem
|
||||
{
|
||||
public:
|
||||
|
||||
/** Initialize android activity data */
|
||||
std::string mApkWorkspacePath;
|
||||
AAssetManager* mApkAssetManager;
|
||||
|
||||
/** Constructor. */
|
||||
AndroidJNIIOSystem(ANativeActivity* activity);
|
||||
|
||||
/** Destructor. */
|
||||
~AndroidJNIIOSystem();
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Tests for the existence of a file at the given path. */
|
||||
bool Exists( const char* pFile) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Opens a file at the given path, with given mode */
|
||||
IOStream* Open( const char* strFile, const char* strMode);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Inits Android extractor
|
||||
void AndroidActivityInit(ANativeActivity* activity);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Extracts android asset
|
||||
bool AndroidExtractAsset(std::string name);
|
||||
|
||||
};
|
||||
|
||||
} //!ns Assimp
|
||||
|
||||
#endif //AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -282,7 +282,7 @@ enum aiPostProcessSteps
|
||||
/** <hr>Searches for redundant/unreferenced materials and removes them.
|
||||
*
|
||||
* This is especially useful in combination with the
|
||||
* #aiProcess_PretransformVertices and #aiProcess_OptimizeMeshes flags.
|
||||
* #aiProcess_PreTransformVertices and #aiProcess_OptimizeMeshes flags.
|
||||
* Both join small meshes with equal characteristics, but they can't do
|
||||
* their work if two meshes have different materials. Because several
|
||||
* material settings are lost during Assimp's import filters,
|
||||
@@ -335,7 +335,7 @@ enum aiPostProcessSteps
|
||||
* To have the degenerate stuff not only detected and collapsed but
|
||||
* removed, try one of the following procedures:
|
||||
* <br><b>1.</b> (if you support lines and points for rendering but don't
|
||||
* want the degenerates)</br>
|
||||
* want the degenerates)<br>
|
||||
* <ul>
|
||||
* <li>Specify the #aiProcess_FindDegenerates flag.
|
||||
* </li>
|
||||
@@ -345,7 +345,7 @@ enum aiPostProcessSteps
|
||||
* pipeline steps.
|
||||
* </li>
|
||||
* </ul>
|
||||
* <br><b>2.</b>(if you don't support lines and points at all)</br>
|
||||
* <br><b>2.</b>(if you don't support lines and points at all)<br>
|
||||
* <ul>
|
||||
* <li>Specify the #aiProcess_FindDegenerates flag.
|
||||
* </li>
|
||||
@@ -550,7 +550,7 @@ enum aiPostProcessSteps
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
/** @def aiProcessPreset_TargetRealtimeUse_Fast
|
||||
/** @def aiProcessPreset_TargetRealtime_Fast
|
||||
* @brief Default postprocess configuration optimizing the data for real-time rendering.
|
||||
*
|
||||
* Applications would want to use this preset to load models on end-user PCs,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
: w(pw), x(px), y(py), z(pz) {}
|
||||
|
||||
/** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */
|
||||
aiQuaterniont( const aiMatrix3x3t<TReal>& pRotMatrix);
|
||||
explicit aiQuaterniont( const aiMatrix3x3t<TReal>& pRotMatrix);
|
||||
|
||||
/** Construct from euler angles */
|
||||
aiQuaterniont( TReal rotx, TReal roty, TReal rotz);
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
aiQuaterniont( aiVector3t<TReal> axis, TReal angle);
|
||||
|
||||
/** Construct from a normalized quaternion stored in a vec3 */
|
||||
aiQuaterniont( aiVector3t<TReal> normalized);
|
||||
explicit aiQuaterniont( aiVector3t<TReal> normalized);
|
||||
|
||||
/** Returns a matrix representation of the quaternion */
|
||||
aiMatrix3x3t<TReal> GetMatrix() const;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiQuaterniont.inl
|
||||
/** @file quaternion.inl
|
||||
* @brief Inline implementation of aiQuaterniont<TReal> operators
|
||||
*/
|
||||
#ifndef AI_QUATERNION_INL_INC
|
||||
@@ -84,7 +84,7 @@ inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatri
|
||||
// large enough
|
||||
if( t > static_cast<TReal>(0))
|
||||
{
|
||||
TReal s = sqrt(1 + t) * static_cast<TReal>(2.0);
|
||||
TReal s = std::sqrt(1 + t) * static_cast<TReal>(2.0);
|
||||
x = (pRotMatrix.c2 - pRotMatrix.b3) / s;
|
||||
y = (pRotMatrix.a3 - pRotMatrix.c1) / s;
|
||||
z = (pRotMatrix.b1 - pRotMatrix.a2) / s;
|
||||
@@ -93,7 +93,7 @@ inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatri
|
||||
else if( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 )
|
||||
{
|
||||
// Column 0:
|
||||
TReal s = sqrt( static_cast<TReal>(1.0) + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * static_cast<TReal>(2.0);
|
||||
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * static_cast<TReal>(2.0);
|
||||
x = static_cast<TReal>(0.25) * s;
|
||||
y = (pRotMatrix.b1 + pRotMatrix.a2) / s;
|
||||
z = (pRotMatrix.a3 + pRotMatrix.c1) / s;
|
||||
@@ -102,7 +102,7 @@ inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatri
|
||||
else if( pRotMatrix.b2 > pRotMatrix.c3)
|
||||
{
|
||||
// Column 1:
|
||||
TReal s = sqrt( static_cast<TReal>(1.0) + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * static_cast<TReal>(2.0);
|
||||
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * static_cast<TReal>(2.0);
|
||||
x = (pRotMatrix.b1 + pRotMatrix.a2) / s;
|
||||
y = static_cast<TReal>(0.25) * s;
|
||||
z = (pRotMatrix.c2 + pRotMatrix.b3) / s;
|
||||
@@ -110,7 +110,7 @@ inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatri
|
||||
} else
|
||||
{
|
||||
// Column 2:
|
||||
TReal s = sqrt( static_cast<TReal>(1.0) + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * static_cast<TReal>(2.0);
|
||||
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * static_cast<TReal>(2.0);
|
||||
x = (pRotMatrix.a3 + pRotMatrix.c1) / s;
|
||||
y = (pRotMatrix.c2 + pRotMatrix.b3) / s;
|
||||
z = static_cast<TReal>(0.25) * s;
|
||||
@@ -123,12 +123,12 @@ inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatri
|
||||
template<typename TReal>
|
||||
inline aiQuaterniont<TReal>::aiQuaterniont( TReal fPitch, TReal fYaw, TReal fRoll )
|
||||
{
|
||||
const TReal fSinPitch(sin(fPitch*static_cast<TReal>(0.5)));
|
||||
const TReal fCosPitch(cos(fPitch*static_cast<TReal>(0.5)));
|
||||
const TReal fSinYaw(sin(fYaw*static_cast<TReal>(0.5)));
|
||||
const TReal fCosYaw(cos(fYaw*static_cast<TReal>(0.5)));
|
||||
const TReal fSinRoll(sin(fRoll*static_cast<TReal>(0.5)));
|
||||
const TReal fCosRoll(cos(fRoll*static_cast<TReal>(0.5)));
|
||||
const TReal fSinPitch(std::sin(fPitch*static_cast<TReal>(0.5)));
|
||||
const TReal fCosPitch(std::cos(fPitch*static_cast<TReal>(0.5)));
|
||||
const TReal fSinYaw(std::sin(fYaw*static_cast<TReal>(0.5)));
|
||||
const TReal fCosYaw(std::cos(fYaw*static_cast<TReal>(0.5)));
|
||||
const TReal fSinRoll(std::sin(fRoll*static_cast<TReal>(0.5)));
|
||||
const TReal fCosRoll(std::cos(fRoll*static_cast<TReal>(0.5)));
|
||||
const TReal fCosPitchCosYaw(fCosPitch*fCosYaw);
|
||||
const TReal fSinPitchSinYaw(fSinPitch*fSinYaw);
|
||||
x = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw;
|
||||
@@ -163,8 +163,8 @@ inline aiQuaterniont<TReal>::aiQuaterniont( aiVector3t<TReal> axis, TReal angle)
|
||||
{
|
||||
axis.Normalize();
|
||||
|
||||
const TReal sin_a = sin( angle / 2 );
|
||||
const TReal cos_a = cos( angle / 2 );
|
||||
const TReal sin_a = std::sin( angle / 2 );
|
||||
const TReal cos_a = std::cos( angle / 2 );
|
||||
x = axis.x * sin_a;
|
||||
y = axis.y * sin_a;
|
||||
z = axis.z * sin_a;
|
||||
@@ -184,7 +184,7 @@ inline aiQuaterniont<TReal>::aiQuaterniont( aiVector3t<TReal> normalized)
|
||||
if (t < static_cast<TReal>(0.0)) {
|
||||
w = static_cast<TReal>(0.0);
|
||||
}
|
||||
else w = sqrt (t);
|
||||
else w = std::sqrt (t);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -214,10 +214,10 @@ inline void aiQuaterniont<TReal>::Interpolate( aiQuaterniont& pOut, const aiQuat
|
||||
{
|
||||
// Standard case (slerp)
|
||||
TReal omega, sinom;
|
||||
omega = acos( cosom); // extract theta from dot product's cos theta
|
||||
sinom = sin( omega);
|
||||
sclp = sin( (static_cast<TReal>(1.0) - pFactor) * omega) / sinom;
|
||||
sclq = sin( pFactor * omega) / sinom;
|
||||
omega = std::acos( cosom); // extract theta from dot product's cos theta
|
||||
sinom = std::sin( omega);
|
||||
sclp = std::sin( (static_cast<TReal>(1.0) - pFactor) * omega) / sinom;
|
||||
sclq = std::sin( pFactor * omega) / sinom;
|
||||
} else
|
||||
{
|
||||
// Very close, do linear interp (because it's faster)
|
||||
@@ -236,7 +236,7 @@ template<typename TReal>
|
||||
inline aiQuaterniont<TReal>& aiQuaterniont<TReal>::Normalize()
|
||||
{
|
||||
// compute the magnitude and divide through it
|
||||
const TReal mag = sqrt(x*x + y*y + z*z + w*w);
|
||||
const TReal mag = std::sqrt(x*x + y*y + z*z + w*w);
|
||||
if (mag)
|
||||
{
|
||||
const TReal invMag = static_cast<TReal>(1.0)/mag;
|
||||
@@ -273,11 +273,10 @@ template<typename TReal>
|
||||
inline aiVector3t<TReal> aiQuaterniont<TReal>::Rotate (const aiVector3t<TReal>& v)
|
||||
{
|
||||
aiQuaterniont q2(0.f,v.x,v.y,v.z), q = *this, qinv = q;
|
||||
q.Conjugate();
|
||||
qinv.Conjugate();
|
||||
|
||||
q = q*q2*qinv;
|
||||
return aiVector3t<TReal>(q.x,q.y,q.z);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiScene.h
|
||||
/** @file scene.h
|
||||
* @brief Defines the data structures in which the imported scene is returned.
|
||||
*/
|
||||
#ifndef __AI_SCENE_H_INC__
|
||||
@@ -109,7 +109,9 @@ struct aiNode
|
||||
/** The number of meshes of this node. */
|
||||
unsigned int mNumMeshes;
|
||||
|
||||
/** The meshes of this node. Each entry is an index into the mesh */
|
||||
/** The meshes of this node. Each entry is an index into the
|
||||
* mesh list of the #aiScene.
|
||||
*/
|
||||
unsigned int* mMeshes;
|
||||
|
||||
/** Metadata associated with this node or NULL if there is no metadata.
|
||||
@@ -135,7 +137,7 @@ struct aiNode
|
||||
|
||||
|
||||
/** Construction from a specific name */
|
||||
aiNode(const std::string& name)
|
||||
explicit aiNode(const std::string& name)
|
||||
// set all members to zero by default
|
||||
: mName(name)
|
||||
, mParent(NULL)
|
||||
@@ -182,8 +184,6 @@ struct aiNode
|
||||
}
|
||||
|
||||
|
||||
/** @override
|
||||
*/
|
||||
inline const aiNode* FindNode(const char* name) const
|
||||
{
|
||||
if (!::strcmp( mName.data,name))return this;
|
||||
@@ -217,7 +217,7 @@ struct aiNode
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
/** @def AI_SCENE_FLAGS_INCOMPLETE
|
||||
/**
|
||||
* Specifies that the scene data structure that was imported is not complete.
|
||||
* This flag bypasses some internal validations and allows the import
|
||||
* of animation skeletons, material libraries or camera animation paths
|
||||
@@ -225,14 +225,14 @@ struct aiNode
|
||||
*/
|
||||
#define AI_SCENE_FLAGS_INCOMPLETE 0x1
|
||||
|
||||
/** @def AI_SCENE_FLAGS_VALIDATED
|
||||
/**
|
||||
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
|
||||
* if the validation is successful. In a validated scene you can be sure that
|
||||
* any cross references in the data structure (e.g. vertex indices) are valid.
|
||||
*/
|
||||
#define AI_SCENE_FLAGS_VALIDATED 0x2
|
||||
|
||||
/** @def AI_SCENE_FLAGS_VALIDATION_WARNING
|
||||
/**
|
||||
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
|
||||
* if the validation is successful but some issues have been found.
|
||||
* This can for example mean that a texture that does not exist is referenced
|
||||
@@ -242,7 +242,7 @@ struct aiNode
|
||||
*/
|
||||
#define AI_SCENE_FLAGS_VALIDATION_WARNING 0x4
|
||||
|
||||
/** @def AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
|
||||
/**
|
||||
* This flag is currently only set by the aiProcess_JoinIdenticalVertices step.
|
||||
* It indicates that the vertices of the output meshes aren't in the internal
|
||||
* verbose format anymore. In the verbose format all vertices are unique,
|
||||
@@ -250,7 +250,7 @@ struct aiNode
|
||||
*/
|
||||
#define AI_SCENE_FLAGS_NON_VERBOSE_FORMAT 0x8
|
||||
|
||||
/** @def AI_SCENE_FLAGS_TERRAIN
|
||||
/**
|
||||
* Denotes pure height-map terrain data. Pure terrains usually consist of quads,
|
||||
* sometimes triangles, in a regular grid. The x,y coordinates of all vertex
|
||||
* positions refer to the x,y coordinates on the terrain height map, the z-axis
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -116,6 +116,10 @@ struct aiTexel
|
||||
* 2. Compressed textures stored in a file format like png or jpg. The raw file
|
||||
* bytes are given so the application must utilize an image decoder (e.g. DevIL) to
|
||||
* get access to the actual color data.
|
||||
*
|
||||
* Embedded textures are referenced from materials using strings like "*0", "*1", etc.
|
||||
* as the texture paths (a single asterisk character followed by the
|
||||
* zero-based index of the texture in the aiScene::mTextures array).
|
||||
*/
|
||||
struct aiTexture
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -47,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Some runtime headers
|
||||
#include <sys/types.h>
|
||||
#include <memory.h>
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -161,7 +160,7 @@ struct aiColor3D
|
||||
#ifdef __cplusplus
|
||||
aiColor3D () : r(0.0f), g(0.0f), b(0.0f) {}
|
||||
aiColor3D (float _r, float _g, float _b) : r(_r), g(_g), b(_b) {}
|
||||
aiColor3D (float _r) : r(_r), g(_r), b(_r) {}
|
||||
explicit aiColor3D (float _r) : r(_r), g(_r), b(_r) {}
|
||||
aiColor3D (const aiColor3D& o) : r(o.r), g(o.g), b(o.b) {}
|
||||
|
||||
/** Component-wise comparison */
|
||||
@@ -217,7 +216,7 @@ struct aiColor3D
|
||||
/** Check whether a color is black */
|
||||
bool IsBlack() const {
|
||||
static const float epsilon = 10e-3f;
|
||||
return fabs( r ) < epsilon && fabs( g ) < epsilon && fabs( b ) < epsilon;
|
||||
return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon;
|
||||
}
|
||||
|
||||
#endif // !__cplusplus
|
||||
@@ -241,7 +240,7 @@ struct aiColor3D
|
||||
* For most applications, it will be absolutely sufficient to interpret the
|
||||
* aiString as ASCII data and work with it as one would work with a plain char*.
|
||||
* Windows users in need of proper support for i.e asian characters can use the
|
||||
* #MultiByteToWideChar(), #WideCharToMultiByte() WinAPI functionality to convert the
|
||||
* MultiByteToWideChar(), WideCharToMultiByte() WinAPI functionality to convert the
|
||||
* UTF-8 strings to their working character set (i.e. MBCS, WideChar).
|
||||
*
|
||||
* We use this representation instead of std::string to be C-compatible. The
|
||||
@@ -388,6 +387,8 @@ typedef enum aiReturn
|
||||
* Force 32-bit size enum
|
||||
*/
|
||||
_AI_ENFORCE_ENUM_SIZE = 0x7fffffff
|
||||
|
||||
/// @endcond
|
||||
} aiReturn; // !enum aiReturn
|
||||
|
||||
// just for backwards compatibility, don't use these constants anymore
|
||||
@@ -414,13 +415,14 @@ enum aiOrigin
|
||||
* Force 32-bit size enum
|
||||
*/
|
||||
_AI_ORIGIN_ENFORCE_ENUM_SIZE = 0x7fffffff
|
||||
|
||||
/// @endcond
|
||||
}; // !enum aiOrigin
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
/** @brief Enumerates predefined log streaming destinations.
|
||||
* Logging to these streams can be enabled with a single call to
|
||||
* #LogStream::createDefaultStream or #aiAttachPredefinedLogStream(),
|
||||
* respectively.
|
||||
* #LogStream::createDefaultStream.
|
||||
*/
|
||||
enum aiDefaultLogStream
|
||||
{
|
||||
@@ -442,6 +444,7 @@ enum aiDefaultLogStream
|
||||
* Force 32-bit size enum
|
||||
*/
|
||||
_AI_DLS_ENFORCE_ENUM_SIZE = 0x7fffffff
|
||||
/// @endcond
|
||||
}; // !enum aiDefaultLogStream
|
||||
|
||||
// just for backwards compatibility, don't use these constants anymore
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -38,7 +38,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
/** @file aiVector2t.h
|
||||
/** @file vector2.h
|
||||
* @brief 2D vector structure, including operators when compiling in C++
|
||||
*/
|
||||
#ifndef AI_VECTOR2D_H_INC
|
||||
@@ -103,7 +103,7 @@ typedef aiVector2t<float> aiVector2D;
|
||||
#else
|
||||
|
||||
struct aiVector2D {
|
||||
float x,y;
|
||||
float x, y;
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiVector2D.inl
|
||||
/** @file vector2.inl
|
||||
* @brief Inline implementation of aiVector2t<TReal> operators
|
||||
*/
|
||||
#ifndef AI_VECTOR2D_INL_INC
|
||||
@@ -71,7 +71,7 @@ TReal aiVector2t<TReal>::SquareLength() const {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
TReal aiVector2t<TReal>::Length() const {
|
||||
return ::sqrt( SquareLength());
|
||||
return std::sqrt( SquareLength());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -38,7 +38,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
/** @file aiVector3D.h
|
||||
/** @file vector3.h
|
||||
* @brief 3D vector structure, including operators when compiling in C++
|
||||
*/
|
||||
#ifndef AI_VECTOR3D_H_INC
|
||||
@@ -116,6 +116,8 @@ public:
|
||||
/** @brief Normalize the vector */
|
||||
aiVector3t& Normalize();
|
||||
|
||||
/** @brief Normalize the vector with extra check for zero vectors */
|
||||
aiVector3t& NormalizeSafe();
|
||||
|
||||
/** @brief Componentwise multiplication of two vectors
|
||||
*
|
||||
@@ -132,8 +134,7 @@ typedef aiVector3t<float> aiVector3D;
|
||||
#else
|
||||
|
||||
struct aiVector3D {
|
||||
|
||||
float x,y,z;
|
||||
float x, y, z;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiVector3D.inl
|
||||
/** @file vector3.inl
|
||||
* @brief Inline implementation of aiVector3t<TReal> operators
|
||||
*/
|
||||
#ifndef AI_VECTOR3D_INL_INC
|
||||
@@ -92,7 +92,7 @@ AI_FORCE_INLINE TReal aiVector3t<TReal>::SquareLength() const {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
AI_FORCE_INLINE TReal aiVector3t<TReal>::Length() const {
|
||||
return ::sqrt( SquareLength());
|
||||
return std::sqrt( SquareLength());
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
@@ -101,6 +101,14 @@ AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::Normalize() {
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::NormalizeSafe() {
|
||||
TReal len = Length();
|
||||
if (len > static_cast<TReal>(0))
|
||||
*this /= len;
|
||||
return *this;
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename TReal>
|
||||
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator += (const aiVector3t<TReal>& o) {
|
||||
x += o.x; y += o.y; z += o.z; return *this;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
Copyright (c) 2006-2016, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -39,13 +39,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file aiVersion.h
|
||||
/** @file version.h
|
||||
* @brief Functions to query the version of the Assimp runtime, check
|
||||
* compile flags, ...
|
||||
*/
|
||||
#ifndef INCLUDED_AI_VERSION_H
|
||||
#define INCLUDED_AI_VERSION_H
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BIN
lib/assimp.lib
BIN
lib/assimp.lib
Binary file not shown.
BIN
lib/glfw3.lib
BIN
lib/glfw3.lib
Binary file not shown.
Reference in New Issue
Block a user