-mobs.create_head_functions = function(def,mob_register)
- --converts the degrees to radians
- local degrees_to_radians = function(degrees)
- --print(d)
- return(degrees/180.0*math.pi)
- end
-
- --converts yaw to degrees
- local degrees = function(yaw)
- return(yaw*180.0/math.pi)
- end
-
- --rounds it up to an integer
- local degree_round = function(degree)
- return(degree + 0.5 - (degree + 0.5) % 1)
- end
- --turns radians into degrees - not redundant
- --doesn't add math.pi
- local radians_to_degrees = function(radians)
- return(radians*180.0/math.pi)
- end
-
-
- --make sure this is redefined as shown below aka
- --don't run mob_rotation_degree_to_radians(rotation)
- --run local radians = mob_rotation_degree_to_radians(rotation)
- --or the mobs head rotation will become overwritten
- local head_rotation_to_radians = function(rotation)
- return{
- x = 0, --roll should never be changed
- y = degrees_to_radians(180 - rotation.y)*-1,
- z = degrees_to_radians(90 - rotation.z)
- }
- end
-