| 1348 | } |
| 1349 | |
| 1350 | void 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 | |
| 1366 | static void asMaterialParticle(MovementObject* mo, const std::string& type, const vec3& pos, const vec3& vel) { |
| 1367 | const MaterialParticle* mp = mo->scenegraph_->GetMaterialParticle(type, pos); |
nothing calls this directly
no test coverage detected