Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/gltf/structures/gltf_buffer_view.h
10278 views
1
/**************************************************************************/
2
/* gltf_buffer_view.h */
3
/**************************************************************************/
4
/* This file is part of: */
5
/* GODOT ENGINE */
6
/* https://godotengine.org */
7
/**************************************************************************/
8
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10
/* */
11
/* Permission is hereby granted, free of charge, to any person obtaining */
12
/* a copy of this software and associated documentation files (the */
13
/* "Software"), to deal in the Software without restriction, including */
14
/* without limitation the rights to use, copy, modify, merge, publish, */
15
/* distribute, sublicense, and/or sell copies of the Software, and to */
16
/* permit persons to whom the Software is furnished to do so, subject to */
17
/* the following conditions: */
18
/* */
19
/* The above copyright notice and this permission notice shall be */
20
/* included in all copies or substantial portions of the Software. */
21
/* */
22
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29
/**************************************************************************/
30
31
#pragma once
32
33
#include "../gltf_defines.h"
34
35
#include "core/io/resource.h"
36
37
class GLTFBufferView : public Resource {
38
GDCLASS(GLTFBufferView, Resource);
39
friend class GLTFDocument;
40
41
private:
42
GLTFBufferIndex buffer = -1;
43
int64_t byte_offset = 0;
44
int64_t byte_length = 0;
45
int64_t byte_stride = -1;
46
bool indices = false;
47
bool vertex_attributes = false;
48
49
protected:
50
static void _bind_methods();
51
52
#ifndef DISABLE_DEPRECATED
53
// Non-const versions for compatibility.
54
GLTFBufferIndex _get_buffer_bind_compat_86907();
55
int _get_byte_offset_bind_compat_86907();
56
int _get_byte_length_bind_compat_86907();
57
int _get_byte_stride_bind_compat_86907();
58
bool _get_indices_bind_compat_86907();
59
static void _bind_compatibility_methods();
60
#endif // DISABLE_DEPRECATED
61
62
public:
63
GLTFBufferIndex get_buffer() const;
64
void set_buffer(GLTFBufferIndex p_buffer);
65
66
int64_t get_byte_offset() const;
67
void set_byte_offset(int64_t p_byte_offset);
68
69
int64_t get_byte_length() const;
70
void set_byte_length(int64_t p_byte_length);
71
72
int64_t get_byte_stride() const;
73
void set_byte_stride(int64_t p_byte_stride);
74
75
bool get_indices() const;
76
void set_indices(bool p_indices);
77
78
bool get_vertex_attributes() const;
79
void set_vertex_attributes(bool p_attributes);
80
81
Vector<uint8_t> load_buffer_view_data(const Ref<GLTFState> p_state) const;
82
};
83
84