-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathUsdWorld.h
51 lines (39 loc) · 1.4 KB
/
UsdWorld.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2020 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "UsdBridgedBaseObject.h"
class UsdDataArray;
enum class UsdWorldComponents
{
INSTANCES = 0,
SURFACES,
VOLUMES
};
struct UsdWorldData
{
UsdSharedString* name = nullptr;
UsdSharedString* usdName = nullptr;
int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying.
UsdDataArray* instances = nullptr;
UsdDataArray* surfaces = nullptr;
UsdDataArray* volumes = nullptr;
};
class UsdWorld : public UsdBridgedBaseObject<UsdWorld, UsdWorldData, UsdWorldHandle, UsdWorldComponents>
{
public:
UsdWorld(const char* name, UsdDevice* device);
~UsdWorld();
void remove(UsdDevice* device) override;
static constexpr ComponentPair componentParamNames[] = {
ComponentPair(UsdWorldComponents::INSTANCES, "instance"),
ComponentPair(UsdWorldComponents::SURFACES, "surface"),
ComponentPair(UsdWorldComponents::VOLUMES, "volume")};
protected:
bool deferCommit(UsdDevice* device) override;
bool doCommitData(UsdDevice* device) override;
void doCommitRefs(UsdDevice* device) override;
std::vector<UsdInstanceHandle> instanceHandles; // for convenience
std::vector<UsdSurfaceHandle> surfaceHandles; // for convenience
std::vector<UsdVolumeHandle> volumeHandles; // for convenience
std::vector<int> instanceableValues; // for convenience
};