Add command to enable NavMesh render

togglenavmesh or tnm
This commit is contained in:
elsid 2018-04-07 16:11:23 +03:00
parent 1caa18bb4f
commit 70a369f70e
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
25 changed files with 436 additions and 22 deletions

View file

@ -42,4 +42,15 @@ osg::Vec4f colourFromRGB(unsigned int clr)
return colour;
}
osg::Vec4f colourFromRGBA(unsigned int value)
{
return osg::Vec4f(makeOsgColorComponent(value, 0), makeOsgColorComponent(value, 8),
makeOsgColorComponent(value, 16), makeOsgColorComponent(value, 24));
}
float makeOsgColorComponent(unsigned int value, unsigned int shift)
{
return float((value >> shift) & 0xFFu) / 255.0f;
}
}