39NSString *HPVectorDescription(HPVector vector)
41 return [NSString stringWithFormat:@"(%g, %g, %g)", vector.x, vector.y, vector.z];
44NSArray *ArrayFromHPVector(HPVector vec)
46 return [NSArray arrayWithObjects:[NSNumber numberWithDouble:vec.x],
47 [NSNumber numberWithDouble:vec.y],
48 [NSNumber numberWithDouble:vec.z],
55#if !OOMATHS_STANDALONE
76 while (m > 0.25 || m == 0.0);
78 return HPvector_normal(v);
94 return HPvector_multiply_scalar(v, maxLength * 2.0);
117 if (HPdistance(centre1,centre2) < (exclusion1+exclusion2)*1.2)
119 OOLog(
@"position.cylinder.error",
@"Trying to generate cylinder position in range %f long with exclusions %f and %f",HPdistance(centre1,centre2),exclusion1,exclusion2);
126 while(HPdistance2(result,centre1)<exc12 || HPdistance2(result,centre2)<exc22);
137 }
while(HPdistance2(result,centre)<inner2);
143 return HPvector_subtract(point,HPvector_multiply_scalar(normal,HPdot_product(HPvector_subtract(point, plane), normal)));
const HPVector kBasisXHPVector
HPVector OOHPVectorRandomRadial(OOHPScalar maxLength)
HPVector OOProjectHPVectorToPlane(HPVector point, HPVector plane, HPVector normal)
HPVector OORandomPositionInShell(HPVector centre, OOHPScalar inner, OOHPScalar outer)
const HPVector2D kBasisYHPVector2D
const HPVector kBasisYHPVector
const HPVector kZeroHPVector
HPVector OOHPRandomPositionInBoundingBox(BoundingBox bb)
HPVector OORandomUnitHPVector(void)
const HPVector2D kBasisXHPVector2D
HPVector OOHPVectorRandomSpatial(OOHPScalar maxLength)
const HPVector2D kZeroHPVector2D
const HPVector kBasisZHPVector
HPVector OORandomPositionInCylinder(HPVector centre1, OOHPScalar exclusion1, HPVector centre2, OOHPScalar exclusion2, OOHPScalar radius)
#define OOLog(class, format,...)