HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GLTF_Util.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) COPYRIGHTYEAR
3
* Side Effects Software Inc. All rights reserved.
4
*
5
* Redistribution and use of Houdini Development Kit samples in source and
6
* binary forms, with or without modification, are permitted provided that the
7
* following conditions are met:
8
* 1. Redistributions of source code must retain the above copyright notice,
9
* this list of conditions and the following disclaimer.
10
* 2. The name of Side Effects Software may not be used to endorse or
11
* promote products derived from this software without specific prior
12
* written permission.
13
*
14
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
*
25
*----------------------------------------------------------------------------
26
*/
27
28
#ifndef __SOP_GLTFUTIL_H__
29
#define __SOP_GLTFUTIL_H__
30
31
#include "
GLTF_API.h
"
32
#include "
GLTF_Types.h
"
33
34
namespace
GLTF_NAMESPACE
35
{
36
37
class
GLTF_API
GLTF_Util
38
{
39
public
:
40
template
<
typename
T>
41
static
T
42
readInterleavedElement
(
unsigned
char
*
data
,
uint32
stride
,
uint32
index
)
43
{
44
return
*
reinterpret_cast<
T
*
>
(data + stride * index);
45
}
46
47
static
const
char
*typeGetName(
GLTF_Type
type
);
48
static
GLTF_Int
componentTypeGetBytes(
GLTF_ComponentType
type
);
49
static
GLTF_Int
typeGetElements(
GLTF_Type
type
);
50
static
GLTF_Int
51
getDefaultStride(
GLTF_Type
type
,
GLTF_ComponentType
component_type);
52
53
///
54
/// Returns 0 if previous_stride == 0 and GetDefaultStride otherwise.
55
///
56
static
GLTF_Int
getStride(
uint32
previous_stride,
GLTF_Type
type
,
57
GLTF_ComponentType
component_type);
58
59
static
GLTF_Type
getTypeForTupleSize(
uint32
tuplesize);
60
61
///
62
/// Returns a list of the scene names in the given filename,
63
/// where the index in the returned array corrosponds to the
64
/// scene index, and the value corrosponds to the name if one
65
/// exists, and "" othewise.
66
///
67
static
UT_Array<UT_String>
getSceneList(
const
UT_String
&
filename
);
68
69
static
bool
70
DecomposeMatrixToTRS(
const
UT_Matrix4F
&mat,
UT_Vector3F
&translation,
71
UT_Quaternion
&
rotation
,
UT_Vector3F
scale
);
72
73
static
const
char
*getLightTypeName(
GLTF_LightType
type
);
74
};
75
76
}
// end GLTF_NAMESPACE
77
78
#endif
GLTF_NAMESPACE::GLTF_Int
uint32 GLTF_Int
Definition:
GLTF_Types.h:46
UT_Matrix4T< fpreal32 >
GLTF_API
#define GLTF_API
Definition:
GLTF_API.h:37
GT_Names::filename
GT_API const UT_StringHolder filename
scale
GLenum GLenum GLenum GLenum GLenum scale
Definition:
glew.h:14163
GLTF_NAMESPACE::GLTF_Util
Definition:
GLTF_Util.h:37
UT_Vector3T< fpreal32 >
UT_Array< UT_String >
GLTF_Types.h
GLTF_API.h
GLTF_NAMESPACE
#define GLTF_NAMESPACE
Definition:
GLTF_API.h:42
OBJ_MatchTransform::T
UT_QuaternionT< fpreal32 >
GLTF_NAMESPACE::GLTF_Type
GLTF_Type
Definition:
GLTF_Types.h:117
GLTF_NAMESPACE::GLTF_ComponentType
GLTF_ComponentType
Definition:
GLTF_Types.h:77
index
GLuint index
Definition:
glcorearb.h:786
uint32
unsigned int uint32
Definition:
SYS_Types.h:40
UT_String
Definition:
UT_String.h:72
GLTF_NAMESPACE::GLTF_LightType
GLTF_LightType
Definition:
GLTF_Types.h:151
stride
GLint GLenum GLboolean GLsizei stride
Definition:
glcorearb.h:872
type
type
Definition:
core.h:1059
GLTF_NAMESPACE::GLTF_Util::readInterleavedElement
static T readInterleavedElement(unsigned char *data, uint32 stride, uint32 index)
Definition:
GLTF_Util.h:42
data
Definition:
format.h:895
openvdb::OPENVDB_VERSION_NAME::math::rotation
MatType rotation(const Quat< typename MatType::value_type > &q, typename MatType::value_type eps=static_cast< typename MatType::value_type >(1.0e-8))
Return the rotation matrix specified by the given quaternion.
Definition:
Mat.h:194
GLTF
GLTF_Util.h
Generated on Sat Sep 23 2023 02:47:43 for HDK by
1.8.6