예제 #1
0
파일: Vec.cs 프로젝트: Svengali/SharpLibs
        public static Vec4 randInBox(Vec4 min, Vec4 max)
        {
            var extent = VecOps.Subtract(max, min);

            var randMult = create(s_rand.NextDouble(), s_rand.NextDouble(), s_rand.NextDouble(), s_rand.NextDouble());

            var normalizedPt = VecOps.Multiply(extent, randMult);

            var shiftedPt = VecOps.Add(min, normalizedPt);

            return(shiftedPt);
        }