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

Function initializeClothPositions

tutorials/collide/collide_device.cpp:166–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void initializeClothPositions (collide2::ClothModel & cloth) {
167
168 sim_collisions.clear();
169
170 for (size_t i=0; i<NX; ++i) {
171 for (size_t j=0; j<NZ; ++j) {
172 cloth.x_0_[NX*i+j].x = -(.5f*width) + (float)i*(width/(float)(NX-1));
173 cloth.x_0_[NX*i+j].y = +1.5f;
174 cloth.x_0_[NX*i+j].z = -(.5f*height) + (float)j*(height/(float)(NZ-1));
175 }
176 }
177 cloth.x_ = cloth.x_0_;
178 cloth.x_old_ = cloth.x_0_;
179 cloth.x_last_ = cloth.x_0_;
180 collide2::vec_t nullvec(0.f, 0.f, 0.f);
181 std::fill (cloth.v_.begin (), cloth.v_.end (), nullvec);
182
183 cur_time = 0;
184 cloth.clearCollisionConstraints();
185}
186
187unsigned int createClothSheet (RTCScene scene)
188{

Callers 2

keypressedMethod · 0.85
createClothSheetFunction · 0.85

Calls 4

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected