Page MenuHome

Integrate hair collisions with cloth collision
ClosedPublic

Authored by Luca Rood (LucaRood) on Tue, Jan 7, 11:51 PM.
Tokens
"Love" token, awarded by TheAngerSpecialist."Pirate Logo" token, awarded by shader."Love" token, awarded by billreynish."Mountain of Wealth" token, awarded by duarteframos."Love" token, awarded by 0o00o0oo."Love" token, awarded by jc4d."Like" token, awarded by amonpaike."Love" token, awarded by ace_dragon."Love" token, awarded by bassamk."Love" token, awarded by zuntrix."Love" token, awarded by bblanimation."Love" token, awarded by craig_jones."Love" token, awarded by dbystedt."Love" token, awarded by vklidu."Yellow Medal" token, awarded by Raimund58."Like" token, awarded by slumber."Burninate" token, awarded by shotalot."Love" token, awarded by McHannemann."Love" token, awarded by negativecitizen."Love" token, awarded by pjmdesi."Love" token, awarded by monio."Love" token, awarded by julperado."Love" token, awarded by wo262."Love" token, awarded by astrand130."Love" token, awarded by andruxa696."Love" token, awarded by danielgamage."Love" token, awarded by DerpyIsAlive."Like" token, awarded by Aryeth."Like" token, awarded by Mizukuroi."Love" token, awarded by MizManFryingP."Love" token, awarded by ish_bosamiya."Love" token, awarded by enenra."Love" token, awarded by dark999."Love" token, awarded by symstract."Love" token, awarded by lordodin."Love" token, awarded by DrawingistMusashi."Love" token, awarded by valera."Love" token, awarded by Scio."Like" token, awarded by dballesg."Love" token, awarded by TACarp."Love" token, awarded by mistajuliax."Love" token, awarded by miclack."Love" token, awarded by Blendork."Love" token, awarded by koko_ze."Like" token, awarded by tintwotin."Love" token, awarded by fin.eskimo."Love" token, awarded by activemotionpictures."Love" token, awarded by SecuoyaEx."Love" token, awarded by sooloDev."Like" token, awarded by Forshu."Love" token, awarded by lopoIsaac."Love" token, awarded by RC12."Like" token, awarded by TobiasEinarsson."Love" token, awarded by creamsurfer."Yellow Medal" token, awarded by franMarz."Like" token, awarded by funisfun8."Love" token, awarded by CobraA."Love" token, awarded by v01tech."Party Time" token, awarded by mrpendulum."Burninate" token, awarded by mywa880."Love" token, awarded by eversimo."Like" token, awarded by Loner."Love" token, awarded by Alumx."Love" token, awarded by EitanSomething."Love" token, awarded by EAW."Love" token, awarded by wilBr."Love" token, awarded by vitos1k."Love" token, awarded by xrg."Love" token, awarded by Dimaiomus."Love" token, awarded by Draise."Love" token, awarded by LapisSea."Love" token, awarded by Schamph."Love" token, awarded by hitrpr."Love" token, awarded by Andrea_Monzini."Love" token, awarded by Yegor."Love" token, awarded by arc4g."Evil Spooky Haunted Tree" token, awarded by MasterNurmi."Yellow Medal" token, awarded by Thane5."Burninate" token, awarded by Scaredyfish."Like" token, awarded by erickblender.

Details

Summary

This integrates hair collisions with the new cloth collision system, greatly improving reliability, and reducing the amount of hair-specific code paths in the cloth code.
The removes all the point constraint based collision stuff, instead implementing segment impulse based collisions, using the same collision response code as the normal cloth solver.

Here is a comparison of the constraint based system (left), and the impulse based system (right):

Diff Detail

Repository
rB Blender

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
AR (arc4g) added a subscriber: AR (arc4g).
For (Forshu) added a subscriber: For (Forshu).

Just a little remark about the code.
When exploring this code, one thing that confuses me a bit is the name of the functions.
compute_collision_point, compute_collision_point_hair are not very descriptive.
I would prefer names like compute_collision_point_tri_tri and compute_collision_point_edge_tri.
Maybe edge_tri might be used as a cloth parameter some day too.
The same goes for the name of other variables.

LGTM, I've updated the code to apply on master and integrated mano's feedback.

I also added a oneliner to make it possible to have the hair collide with the emitter object.

Here is video of it in action:

I'll commit this to master shortly.

This revision is now accepted and ready to land.Thu, Jan 16, 6:51 PM