Friday, August 31, 2012

Defective C++ FQA

http://yosefk.com/c++fqa/defective.html

Monday, August 27, 2012

Lock-free, wait-free, hazard pointers

Articles on the topic: http://www.drdobbs.com/lock-free-data-structures-with-hazard-po/184401890 http://www.research.ibm.com/people/m/michael/ieeetpds-2004.pdf http://www.ibm.com/developerworks/java/library/j-jtp10264/

Tuesday, August 14, 2012

Useful links

http://graphics.stanford.edu/~seander/bithacks.html http://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/ http://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/

Useful geometry functions -)

void ProjectPointOnPlane(const Vector3 & p, const Plane & plane, Vector3 & projected)
{
    float d = plane.DistanceToPoint(p);
    projected = p - d*plane.n;
}


float CalcVectorAngle(const Vector2 & a, const Vector2 & b)
{
    float c = atan2f(b.y,b.x) - atan2f(a.y,a.x);

    if (c < -PI)
        c += 2.f*PI;
    else
        if (c > PI)
            c -= 2.f*PI;

    return c;
}