MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / MaterialParticleAtBone

Method MaterialParticleAtBone

Source/Objects/movementobject.cpp:1350–1364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1348}
1349
1350void MovementObject::MaterialParticleAtBone(std::string type, std::string bone_name) {
1351 int bone = rigged_object_->skeleton_.simple_ik_bones[bone_name].bone_id;
1352 vec3 pos = rigged_object_->GetBonePosition(bone);
1353 vec3 vel = rigged_object_->GetBoneLinearVel(bone);
1354
1355 const MaterialParticle* mp = scenegraph_->GetMaterialParticle(type, pos);
1356 if (!mp || mp->particle_path.empty()) {
1357 return;
1358 }
1359 pos += vec3(0.0f, -0.1f, 0.0f);
1360 vel = vec3(0.0f, 1.0f * min(1.0f, length(vel)), 0.0f);
1361 vec3 tint = scenegraph_->GetColorAtPoint(pos);
1362 scenegraph_->particle_system->MakeParticle(
1363 scenegraph_, mp->particle_path, pos, vel, tint);
1364}
1365
1366static void asMaterialParticle(MovementObject* mo, const std::string& type, const vec3& pos, const vec3& vel) {
1367 const MaterialParticle* mp = mo->scenegraph_->GetMaterialParticle(type, pos);

Callers

nothing calls this directly

Calls 9

GetBonePositionMethod · 0.80
GetBoneLinearVelMethod · 0.80
GetMaterialParticleMethod · 0.80
MakeParticleMethod · 0.80
vec3Class · 0.50
minFunction · 0.50
lengthFunction · 0.50
emptyMethod · 0.45
GetColorAtPointMethod · 0.45

Tested by

no test coverage detected