<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EstiloCorreioElectrnico17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><div><div><div><div><div><p class=MsoNormal><span lang=PT style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=PT style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Following a request in mantis 7973 (<a href="http://opensimulator.org/mantis/view.php?id=7973">http://opensimulator.org/mantis/view.php?id=7973</a>) I did a few changes to damage, since improvements on physics broke what we had even more.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> If llSetDamage() is not used, damage amount is now estimated from collision relative velocity, and not the penetration depth.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> The value reported by physics for this (and collision sounds intensity) is the projection of the relative velocity on the direction of the collision plane normal, so it does depend on the collision angle with that plane normal. This value is then squared so to express a kind of “Energy”. Objects mass is not taken into consideration<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> This result value is then scaled to give a little amount of damage identical to sl, with the difference that moving objects do damage to avatars not sitting (currently physics doesn’t know about sitting ones).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Physics engines are temperamental things. The collision plane may not match a real object surface, etc, etc, so results may still seem odd.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> To have effective and predictable damage, llSetDamage() should be used.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Automatic heal is now done on a timed event (heartbeat actually) so it should work a bit better.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Added OSSL functions:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> o</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>sSetHealth(key avatar, float health)</span><span style='font-size:9.5pt;font-family:Consolas;color:black'> sets current health (1% to 100%) (avoided 0 for now because it would not work predictably)</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>osGetHealRate(key avatar)</span><span style='font-size:9.5pt;font-family:Consolas;color:black'> gets the current automatic healing rate in % per second<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>osSetHealRate(key avatar, </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>float</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> healrate)</span><span style='font-size:9.5pt;font-family:Consolas;color:black'> sets the automatic healing rate in % per second. A value of zero can disable automatic heal, current maximum value is 100 % per second.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'>Default heal rate is now around 0.5% per second.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'>(think we do need to also be able to disable the llSetDamage object autokill, eventually the death behavior, ?)<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'>The goal is just to improve the current simple health control system, for simple uses.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'>Keep in mind the testing nature of opensim master branch.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'>This may be broken and will change, at least in details, also according to your feedback<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:9.5pt;font-family:Consolas;color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards, <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ubit<o:p></o:p></span></p></div></div></div></div></div></div></body></html>