MCPcopy Create free account
hub / github.com/RenderKit/embree / addHair

Function addHair

tutorials/bvh_access/bvh_access.cpp:113–130  ·  view source on GitHub ↗

adds a hair to the scene */

Source from the content-addressed store, hash-verified

111
112 /* adds a hair to the scene */
113 unsigned int addHair(RTCDevice device_i, RTCScene scene_i)
114 {
115 RTCGeometry geom = rtcNewGeometry (device_i, RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE);
116
117 vfloat4* pos = (vfloat4*) rtcSetNewGeometryBuffer(geom, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT4, sizeof(vfloat4), 4);
118 pos[0] = vfloat4(0.0f,0.0f,0.0f,0.1f);
119 pos[1] = vfloat4(0.0f,1.0f,0.0f,0.1f);
120 pos[2] = vfloat4(0.0f,2.0f,0.0f,0.1f);
121 pos[3] = vfloat4(0.0f,3.0f,0.0f,0.1f);
122
123 int* index = (int*) rtcSetNewGeometryBuffer(geom, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT, sizeof(int), 1);
124 index[0] = 0;
125
126 rtcCommitGeometry(geom);
127 unsigned int geomID = rtcAttachGeometry(scene_i,geom);
128 rtcReleaseGeometry(geom);
129 return geomID;
130 }
131
132 /* prints the bvh4.triangle4v data structure */
133 void print_bvh4_triangle4v(BVH4::NodeRef node, size_t depth)

Callers 1

mainFunction · 0.85

Calls 4

rtcSetNewGeometryBufferFunction · 0.85
rtcCommitGeometryFunction · 0.85
rtcAttachGeometryFunction · 0.85
rtcReleaseGeometryFunction · 0.85

Tested by

no test coverage detected