A computer-implemented method for animating hair, the method comprising: receiving data representing a plurality of hairs and a plurality of objects in a timestep of a frame of animation; populating a first tree to represent kinematic objects of the plurality of objects based on the received data; populating a second tree to represent dynamic objects of the plurality of objects based on the received data; creating a first elasticity preconditioner representing internal elastic energy of the plurality of hairs based on the received data; determining based on the first tree and the second tree, a first set of potential contacts between two or more hairs of the plurality of hairs or between one or more hairs of the plurality of hairs and one or more objects of the plurality of objects; and determining [410,412,414,416,418] positions of the plurality of hairs based on the determined first set of potential contacts and the first elasticity preconditioner, wherein determining positions of the plurality of hairs based on the determined first set of potential contacts and the first elasticity preconditioner comprises iteratively: (i) performing a Projected Gauss-Seidel algorithm using the first elasticity preconditioner to determine magnitudes of normal forces and friction forces for the first set of potential contacts; (ii) performing Cholesky back-substitution using the determined magnitudes of normal forces and friction forces for the first set of potential contacts to determine the positions of the plurality of hairs; and (iii) for iterations of (i)-(iii) after the first iteration of (i)-(iii), employing temporal collision detection to detect collision contacts between two or more hairs of the plurality of hairs or between one or more hairs of the plurality of hairs and one or more objects of the plurality of objects. receiving data representing a plurality of hairs and a plurality of objects in a timestep of a frame of animation; populating a first tree to represent kinematic objects of the plurality of objects based on the received data; populating a second tree to represent dynamic objects of the plurality of objects based on the received data; creating a first elasticity preconditioner representing internal elastic energy of the plurality of hairs based on the received data; determining based on the first tree and the second tree, a first set of potential contacts between two or more hairs of the plurality of hairs or between one or more hairs of the plurality of hairs and one or more objects of the plurality of objects; and determining [410,412,414,416,418] positions of the plurality of hairs based on the determined first set of potential contacts and the first elasticity preconditioner, wherein determining positions of the plurality of hairs based on the determined first set of potential contacts and the first elasticity preconditioner comprises iteratively: (i) performing a Projected Gauss-Seidel algorithm using the first elasticity preconditioner to determine magnitudes of normal forces and friction forces for the first set of potential contacts; (ii) performing Cholesky back-substitution using the determined magnitudes of normal forces and friction forces for the first set of potential contacts to determine the positions of the plurality of hairs; and (iii) for iterations of (i)-(iii) after the first iteration of (i)-(iii), employing temporal collision detection to detect collision contacts between two or more hairs of the plurality of hairs or between one or more hairs of the plurality of hairs and one or more objects of the plurality of objects. (i) performing a Projected Gauss-Seidel algorithm using the first elasticity preconditioner to determine magnitudes of normal forces and friction forces for the first set of potential contacts; (ii) performing Cholesky back-substitution using the determined magnitudes of normal forces and friction forces for the first set of potential contacts to determine the positions of the plurality of hairs; and (iii) for iterations of (i)-(iii) after the first iteration of (i)-(iii), employing temporal collision detection to detect collision contacts between two or more hairs of the plurality of hairs or between one or more hairs of the plurality of hairs and one or more objects of the plurality of objects.