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