Blender V4.3
instancer.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 NVIDIA Corporation
2 * SPDX-FileCopyrightText: 2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: Apache-2.0 */
5
6#pragma once
7
8#include "hydra/config.h"
9
10#include <pxr/base/gf/matrix4d.h>
11#include <pxr/base/gf/vec3f.h>
12#include <pxr/base/gf/vec4f.h>
13#include <pxr/base/vt/array.h>
14#include <pxr/imaging/hd/instancer.h>
15
17
18class HdCyclesInstancer final : public PXR_NS::HdInstancer {
19 public:
20 HdCyclesInstancer(PXR_NS::HdSceneDelegate *delegate,
21 const PXR_NS::SdfPath &instancerId
22#if PXR_VERSION <= 2011
23 ,
24 const PXR_NS::SdfPath &parentId
25#endif
26 );
27 ~HdCyclesInstancer() override;
28
29#if PXR_VERSION > 2011
30 void Sync(PXR_NS::HdSceneDelegate *sceneDelegate,
31 PXR_NS::HdRenderParam *renderParam,
32 PXR_NS::HdDirtyBits *dirtyBits) override;
33#endif
34
35 PXR_NS::VtMatrix4dArray ComputeInstanceTransforms(const PXR_NS::SdfPath &prototypeId);
36
37 private:
38 void SyncPrimvars();
39
40 PXR_NS::VtVec3fArray _translate;
41 PXR_NS::VtVec4fArray _rotate;
42 PXR_NS::VtVec3fArray _scale;
43 PXR_NS::VtMatrix4dArray _instanceTransform;
44};
45
HdCyclesInstancer(PXR_NS::HdSceneDelegate *delegate, const PXR_NS::SdfPath &instancerId, const PXR_NS::SdfPath &parentId)
Definition instancer.cpp:13
PXR_NS::VtMatrix4dArray ComputeInstanceTransforms(const PXR_NS::SdfPath &prototypeId)
Definition instancer.cpp:95
~HdCyclesInstancer() override
Definition instancer.cpp:30
#define HDCYCLES_NAMESPACE_CLOSE_SCOPE