v2.0.2
Classes | Macros | Typedefs | Functions | Variables
CC3Foundation.h File Reference
#import "CC3Environment.h"
#import "CC3Math.h"
#import "CC3Logging.h"
#import "CC3CC2Extensions.h"
#import "ccTypes.h"
#import <CoreGraphics/CGColor.h>

Classes

struct  CC3AngularVector
 
struct  CC3AttenuationCoefficients
 
struct  CC3BarycentricWeights
 
struct  CC3Box
 
struct  CC3ColoredVertex
 
struct  CC3Face
 
struct  CC3FaceIndices
 
struct  CC3IntPoint
 
struct  CC3IntSize
 
struct  CC3IntVector
 
struct  CC3IntVector4
 
struct  CC3LitColoredVertex
 
struct  CC3Plane
 
struct  CC3Ray
 
struct  CC3Sphere
 
struct  CC3TexturedVertex
 
struct  CC3Vector
 
struct  CC3Vector4
 
union  CC3Viewport
 

Macros

#define CC3_POP_NOSELECTOR   _Pragma("GCC diagnostic pop")
 
#define CC3_POP_NOSHADOW   _Pragma("GCC diagnostic pop")
 
#define CC3_PUSH_NOSELECTOR   _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wselector\"")
 
#define CC3_PUSH_NOSHADOW   _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wshadow\"")
 
#define cc3tc(U, V)   CC3TexCoordsMake((U),(V))
 
#define cc3v(X, Y, Z)   CC3VectorMake((X),(Y),(Z))
 
#define ccc4f(R, G, B, A)   CCC4FMake((R),(G),(B),(A))
 
#define COCOS3D_VERSION   0x020002
 
#define kCC3BoundingBoxNull   kCC3BoxNull
 
#define kCC3BoundingBoxZero   kCC3BoxZero
 

Typedefs

typedef CC3TexturedVertex
CCTexturedVertex 
__deprecated = { { {0.0, 0.0, 0.0} }, 1.0 }
 
typedef GLfloat CC3Angle
 
typedef CC3IntPoint CC3Tessellation
 

Functions

static CC3AngularVector CC3AngularVectorDifference (CC3AngularVector minuend, CC3AngularVector subtrahend)
 
static CC3AngularVector CC3AngularVectorFromVector (CC3Vector aCoord)
 
static CC3AngularVector CC3AngularVectorMake (GLfloat heading, GLfloat inclination, GLfloat radius)
 
static BOOL CC3AttenuationCoefficientsAreEqual (CC3AttenuationCoefficients ac1, CC3AttenuationCoefficients ac2)
 
static CC3AttenuationCoefficients CC3AttenuationCoefficientsLegalize (CC3AttenuationCoefficients ac)
 
static CC3AttenuationCoefficients CC3AttenuationCoefficientsMake (GLfloat constant, GLfloat linear, GLfloat quadratic)
 
static CC3Vector4 CC3AxisAngleFromQuaternion (CC3Quaternion quaternion)
 
static BOOL CC3BarycentricWeightsAreInsideTriangle (CC3BarycentricWeights bcw)
 
static CC3BarycentricWeights CC3BarycentricWeightsMake (GLfloat b0, GLfloat b1, GLfloat b2)
 
static BOOL CC3BooleansAreEqual (BOOL b1, BOOL b2)
 
CC3Box CC3BoundingBoxAddPadding (CC3Box bb, CC3Vector padding) __deprecated
 
CC3Box CC3BoundingBoxAddUniformPadding (CC3Box bb, GLfloat padding) __deprecated
 
CC3Vector CC3BoundingBoxCenter (CC3Box bb) __deprecated
 
BOOL CC3BoundingBoxContainsLocation (CC3Box bb, CC3Vector aLoc) __deprecated
 
CC3Box CC3BoundingBoxEngulfLocation (CC3Box bb, CC3Vector aLoc) __deprecated
 
BOOL CC3BoundingBoxesAreEqual (CC3Box bb1, CC3Box bb2) __deprecated
 
CC3Box CC3BoundingBoxFromMinMax (CC3Vector minVtx, CC3Vector maxVtx) __deprecated
 
BOOL CC3BoundingBoxIsNull (CC3Box bb) __deprecated
 
BOOL CC3BoundingBoxIsZero (CC3Box bb) __deprecated
 
CC3Box CC3BoundingBoxMake (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat maxX, GLfloat maxY, GLfloat maxZ) __deprecated
 
CC3Box CC3BoundingBoxMoveCenterToOrigin (CC3Box bb) __deprecated
 
CC3Box CC3BoundingBoxScale (CC3Box bb, CC3Vector scale) __deprecated
 
CC3Box CC3BoundingBoxScaleUniform (CC3Box bb, GLfloat scale) __deprecated
 
CC3Vector CC3BoundingBoxSize (CC3Box bb) __deprecated
 
CC3Box CC3BoundingBoxTranslate (CC3Box bb, CC3Vector offset) __deprecated
 
CC3Box CC3BoundingBoxTranslateFractionally (CC3Box bb, CC3Vector offsetScale) __deprecated
 
CC3Box CC3BoundingBoxUnion (CC3Box bb1, CC3Box bb2) __deprecated
 
static CC3Box CC3BoxAddPadding (CC3Box bb, CC3Vector padding)
 
static CC3Box CC3BoxAddUniformPadding (CC3Box bb, GLfloat padding)
 
static CC3Vector CC3BoxCenter (CC3Box bb)
 
static BOOL CC3BoxContainsLocation (CC3Box bb, CC3Vector aLoc)
 
CC3Box CC3BoxEngulfLocation (CC3Box bb, CC3Vector aLoc)
 
static BOOL CC3BoxesAreEqual (CC3Box bb1, CC3Box bb2)
 
static CC3Box CC3BoxFromMinMax (CC3Vector minVtx, CC3Vector maxVtx)
 
static BOOL CC3BoxIsNull (CC3Box bb)
 
static BOOL CC3BoxIsZero (CC3Box bb)
 
static CC3Box CC3BoxMake (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat maxX, GLfloat maxY, GLfloat maxZ)
 
static CC3Box CC3BoxMoveCenterToOrigin (CC3Box bb)
 
static CC3Box CC3BoxScale (CC3Box bb, CC3Vector scale)
 
static CC3Box CC3BoxScaleUniform (CC3Box bb, GLfloat scale)
 
static CC3Vector CC3BoxSize (CC3Box bb)
 
static CC3Box CC3BoxTranslate (CC3Box bb, CC3Vector offset)
 
static CC3Box CC3BoxTranslateFractionally (CC3Box bb, CC3Vector offsetScale)
 
static CC3Box CC3BoxUnion (CC3Box bb1, CC3Box bb2)
 
GLfloat CC3DistanceFromNormalizedPlane (CC3Plane p, CC3Vector v) __deprecated
 
static GLfloat CC3DistanceFromPlane (CC3Vector v, CC3Plane p)
 
BOOL CC3DoesRayIntersectSphere (CC3Ray aRay, CC3Sphere aSphere)
 
static BOOL CC3DoesSphereIntersectSphere (CC3Sphere sphereOne, CC3Sphere sphereTwo)
 
static NSString * CC3EnsureAbsoluteFilePath (NSString *filePath)
 
static GLfloat CC3EnsureMinScaleAxis (GLfloat val)
 
static CC3Vector CC3EnsureMinScaleVector (CC3Vector scale)
 
CC3BarycentricWeights CC3FaceBarycentricWeights (CC3Face face, CC3Vector aLocation)
 
static CC3Vector CC3FaceCenter (CC3Face face)
 
static CC3FaceIndices CC3FaceIndicesMake (GLuint i0, GLuint i1, GLuint i2)
 
static CC3Face CC3FaceInvert (CC3Face face)
 
static CC3Vector CC3FaceLocationFromBarycentricWeights (CC3Face face, CC3BarycentricWeights bcw)
 
static CC3Face CC3FaceMake (CC3Vector v0, CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3FaceNormal (CC3Face face)
 
static CC3Plane CC3FacePlane (CC3Face face)
 
void CC3FlipVertically (GLubyte *rowMajorData, GLuint rowCount, GLuint bytesPerRow)
 
static CC3IntPoint CC3IntPointAdd (CC3IntPoint p1, CC3IntPoint p2)
 
static CC3IntPoint CC3IntPointFromCGPoint (CGPoint pt)
 
static BOOL CC3IntPointIsZero (CC3IntPoint p)
 
static CC3IntPoint CC3IntPointMake (GLint x, GLint y)
 
static BOOL CC3IntPointsAreEqual (CC3IntPoint p1, CC3IntPoint p2)
 
static CC3IntSize CC3IntSizeFromCGSize (CGSize sz)
 
static BOOL CC3IntSizeIsZero (CC3IntSize s)
 
static CC3IntSize CC3IntSizeMake (GLint w, GLint h)
 
static BOOL CC3IntSizesAreEqual (CC3IntSize s1, CC3IntSize s2)
 
static CC3IntVector4 CC3IntVector4Make (GLint x, GLint y, GLint z, GLint w)
 
static BOOL CC3IntVector4sAreEqual (CC3IntVector4 v1, CC3IntVector4 v2)
 
static CC3IntVector CC3IntVectorMake (GLint x, GLint y, GLint z)
 
static BOOL CC3IntVectorsAreEqual (CC3IntVector v1, CC3IntVector v2)
 
static BOOL CC3IsBitClear (GLbitfield bits, GLuint bitIdx)
 
static BOOL CC3IsBitSet (GLbitfield bits, GLuint bitIdx)
 
static BOOL CC3IsLocationOnRay (CC3Vector aLocation, CC3Ray aRay)
 
static BOOL CC3IsLocationWithinSphere (CC3Vector aLocation, CC3Sphere aSphere)
 
static GLfloat CC3LuminosityBT601 (GLfloat red, GLfloat green, GLfloat blue)
 
static GLfloat CC3LuminosityBT709 (GLfloat red, GLfloat green, GLfloat blue)
 
static CC3Plane CC3PlaneFromLocations (CC3Vector v1, CC3Vector v2, CC3Vector v3)
 
static CC3Plane CC3PlaneFromNormalAndLocation (CC3Vector n, CC3Vector loc)
 
CC3Plane CC3PlaneFromPoints (CC3Vector v1, CC3Vector v2, CC3Vector v3) __deprecated
 
static BOOL CC3PlaneIsZero (CC3Plane p)
 
static CC3Plane CC3PlaneMake (GLfloat a, GLfloat b, GLfloat c, GLfloat d)
 
static CC3Plane CC3PlaneNegate (CC3Plane p)
 
static CC3Vector CC3PlaneNormal (CC3Plane p)
 
static CC3Plane CC3PlaneNormalize (CC3Plane p)
 
static BOOL CC3PlanesAreEqual (CC3Plane p1, CC3Plane p2)
 
static CC3Quaternion CC3QuaternionConjugate (CC3Quaternion q)
 
static GLfloat CC3QuaternionDot (CC3Quaternion q1, CC3Quaternion q2)
 
static CC3Quaternion CC3QuaternionFromAxisAngle (CC3Vector4 axisAngle)
 
static CC3Quaternion CC3QuaternionFromCC3Vector (CC3Vector v, GLfloat w)
 
static CC3Quaternion CC3QuaternionFromGLKQuaternion (GLKQuaternion glkq)
 
CC3Quaternion CC3QuaternionFromRotation (CC3Vector aRotation)
 
static CC3Quaternion CC3QuaternionInvert (CC3Quaternion q)
 
static BOOL CC3QuaternionIsNull (CC3Quaternion q)
 
static BOOL CC3QuaternionIsZero (CC3Quaternion q)
 
static GLfloat CC3QuaternionLength (CC3Quaternion q)
 
static GLfloat CC3QuaternionLengthSquared (CC3Quaternion q)
 
static CC3Quaternion CC3QuaternionMake (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
static CC3Quaternion CC3QuaternionMultiply (CC3Quaternion qL, CC3Quaternion qR)
 
static CC3Quaternion CC3QuaternionNegate (CC3Quaternion q)
 
static CC3Quaternion CC3QuaternionNormalize (CC3Quaternion q)
 
static CC3Vector CC3QuaternionRotateVector (CC3Quaternion q, CC3Vector v)
 
static BOOL CC3QuaternionsAreEqual (CC3Quaternion q1, CC3Quaternion q2)
 
static CC3Quaternion CC3QuaternionScaleUniform (CC3Quaternion q, GLfloat scale)
 
CC3Quaternion CC3QuaternionSlerp (CC3Quaternion q1, CC3Quaternion q2, GLfloat blendFactor)
 
static CC3Ray CC3RayFromLocDir (CC3Vector aLocation, CC3Vector aDirection)
 
CC3Vector CC3RayIntersectionOfSphere (CC3Ray aRay, CC3Sphere aSphere) __deprecated
 
CC3Vector CC3RayIntersectionWithBoundingBox (CC3Ray aRay, CC3Box bb) __deprecated
 
CC3Vector4 CC3RayIntersectionWithBoundingBoxSide (CC3Ray aRay, CC3Box bb, CC3Vector sideNormal, CC3Vector4 prevHit) __deprecated
 
CC3Vector CC3RayIntersectionWithBox (CC3Ray aRay, CC3Box bb)
 
CC3Vector4 CC3RayIntersectionWithBoxSide (CC3Ray aRay, CC3Box bb, CC3Vector sideNormal, CC3Vector4 prevHit)
 
CC3Vector4 CC3RayIntersectionWithPlane (CC3Ray ray, CC3Plane plane)
 
CC3Vector CC3RayIntersectionWithSphere (CC3Ray aRay, CC3Sphere aSphere)
 
static CC3Ray CC3RayMake (GLfloat locX, GLfloat locY, GLfloat locZ, GLfloat dirX, GLfloat dirY, GLfloat dirZ)
 
CC3Plane CC3RaySphereIntersectionEquation (CC3Ray aRay, CC3Sphere aSphere)
 
static NSString * CC3ResolveResourceFilePath (NSString *filePath)
 
CC3Vector CC3RotationFromQuaternion (CC3Quaternion aQuaternion)
 
static void CC3SetBit (GLbitfield *bits, GLuint bitIdx, BOOL val)
 
static CC3Sphere CC3SphereFromCircumscribingBox (CC3Box box)
 
static CC3Sphere CC3SphereMake (CC3Vector center, GLfloat radius)
 
CC3Sphere CC3SphereUnion (CC3Sphere s1, CC3Sphere s2)
 
static CC3Tessellation CC3TessellationMake (GLint x, GLint y)
 
static ccTex2F CC3TexCoordsMake (GLfloat u, GLfloat v)
 
CC3Vector CC3TriplePlaneIntersection (CC3Plane p1, CC3Plane p2, CC3Plane p3)
 
static CC3Vector4 CC3Vector4Add (CC3Vector4 v, CC3Vector4 translation)
 
static CC3Vector4 CC3Vector4Difference (CC3Vector4 minuend, CC3Vector4 subtrahend)
 
static GLfloat CC3Vector4Dot (CC3Vector4 v1, CC3Vector4 v2)
 
static CC3Vector4 CC3Vector4FromCC3Vector (CC3Vector v, GLfloat w)
 
static CC3Vector4 CC3Vector4FromDirection (CC3Vector aDirection)
 
static CC3Vector4 CC3Vector4FromGLKVector4 (GLKVector4 glkv)
 
static CC3Vector4 CC3Vector4FromLocation (CC3Vector aLocation)
 
static CC3Vector4 CC3Vector4HomogeneousNegate (CC3Vector4 v)
 
static CC3Vector4 CC3Vector4HomogeneousScaleUniform (CC3Vector4 v, GLfloat scale)
 
static CC3Vector4 CC3Vector4Homogenize (CC3Vector4 v)
 
static BOOL CC3Vector4IsDirectional (CC3Vector4 v)
 
static BOOL CC3Vector4IsInFrontOfPlane (CC3Vector4 v, CC3Plane plane)
 
static BOOL CC3Vector4IsLocational (CC3Vector4 v)
 
static BOOL CC3Vector4IsNull (CC3Vector4 v)
 
static BOOL CC3Vector4IsZero (CC3Vector4 v)
 
static GLfloat CC3Vector4Length (CC3Vector4 v)
 
static GLfloat CC3Vector4LengthSquared (CC3Vector4 v)
 
static CC3Vector4 CC3Vector4Make (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
static CC3Vector4 CC3Vector4Negate (CC3Vector4 v)
 
static CC3Vector4 CC3Vector4Normalize (CC3Vector4 v)
 
static BOOL CC3Vector4sAreEqual (CC3Vector4 v1, CC3Vector4 v2)
 
static CC3Vector4 CC3Vector4ScaleUniform (CC3Vector4 v, GLfloat scale)
 
CC3Vector4 CC3Vector4Slerp (CC3Vector4 v1, CC3Vector4 v2, GLfloat blendFactor) __deprecated
 
static CC3Vector CC3VectorAdd (CC3Vector v, CC3Vector translation)
 
static CC3Vector CC3VectorAverage (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorCross (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorDifference (CC3Vector minuend, CC3Vector subtrahend)
 
static GLfloat CC3VectorDistance (CC3Vector start, CC3Vector end)
 
static GLfloat CC3VectorDistanceSquared (CC3Vector start, CC3Vector end)
 
static GLfloat CC3VectorDot (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorFromAngularVector (CC3AngularVector av)
 
static CC3Vector CC3VectorFromGLKVector3 (GLKVector3 glkv)
 
static CC3Vector CC3VectorFromHomogenizedCC3Vector4 (CC3Vector4 v)
 
CC3Vector CC3VectorFromQuaternion (CC3Quaternion q) __deprecated
 
CC3Vector CC3VectorFromTruncatedCC3Vector4 (CC3Vector4 v) __deprecated
 
static CC3Vector CC3VectorInvert (CC3Vector v)
 
static BOOL CC3VectorIsInFrontOfPlane (CC3Vector v, CC3Plane p)
 
static BOOL CC3VectorIsNull (CC3Vector v)
 
static BOOL CC3VectorIsZero (CC3Vector v)
 
static GLfloat CC3VectorLength (CC3Vector v)
 
static GLfloat CC3VectorLengthSquared (CC3Vector v)
 
static CC3Vector CC3VectorLerp (CC3Vector v1, CC3Vector v2, GLfloat blendFactor)
 
static CC3Vector CC3VectorMake (GLfloat x, GLfloat y, GLfloat z)
 
static CC3Vector CC3VectorMaximize (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorMinimize (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorNegate (CC3Vector v)
 
static CC3Vector CC3VectorNormalize (CC3Vector v)
 
void CC3VectorOrthonormalize (CC3Vector *vectors, GLuint vectorCount)
 
static void CC3VectorOrthonormalizeTriple (CC3Vector *triVector)
 
static CC3Vector CC3VectorRotationalDifference (CC3Vector minuend, CC3Vector subtrahend)
 
static CC3Vector CC3VectorRotationModulo (CC3Vector aRotation)
 
static BOOL CC3VectorsAreEqual (CC3Vector v1, CC3Vector v2)
 
static BOOL CC3VectorsAreParallel (CC3Vector v1, CC3Vector v2)
 
static BOOL CC3VectorsArePerpendicular (CC3Vector v1, CC3Vector v2)
 
static CC3Vector CC3VectorScale (CC3Vector v, CC3Vector scale)
 
static CC3Vector CC3VectorScaleUniform (CC3Vector v, GLfloat scale)
 
static BOOL CC3ViewportContainsPoint (CC3Viewport vp, CGPoint point)
 
static CC3Viewport CC3ViewportFromCGRect (CGRect rect)
 
static CC3Viewport CC3ViewportFromOriginAndSize (CC3IntPoint origin, CC3IntSize size)
 
static BOOL CC3ViewportIsZero (CC3Viewport vp)
 
static CC3Viewport CC3ViewportMake (GLint x, GLint y, GLint w, GLint h)
 
static BOOL CC3ViewportsAreEqual (CC3Viewport vp1, CC3Viewport vp2)
 
static CC3Viewport CC3ViewportTranslate (CC3Viewport vp, CC3IntPoint offset)
 
static BOOL CCC3BAreEqual (ccColor3B c1, ccColor3B c2)
 
static ccColor3B CCC3BBlend (ccColor3B baseColor, ccColor3B blendColor, GLfloat blendWeight)
 
static ccColor3B CCC3BFromCCC4B (ccColor4B color)
 
static ccColor3B CCC3BFromCCC4F (ccColor4F floatColor)
 
static BOOL CCC4BAreEqual (ccColor4B c1, ccColor4B c2)
 
static ccColor4B CCC4BBlendAlpha (ccColor4B rgba)
 
static ccColor4B CCC4BFromCCC4F (ccColor4F floatColor)
 
static ccColor4B CCC4BFromColorAndOpacity (ccColor3B byteColor, CCOpacity opacity)
 
static ccColor4F CCC4FAdd (ccColor4F rgba, ccColor4F translation)
 
static BOOL CCC4FAreEqual (ccColor4F c1, ccColor4F c2)
 
static ccColor4F CCC4FBlend (ccColor4F baseColor, ccColor4F blendColor, GLfloat blendWeight)
 
static ccColor4F CCC4FBlendAlpha (ccColor4F rgba)
 
static ccColor4F CCC4FDifference (ccColor4F minuend, ccColor4F subtrahend)
 
static ccColor4F CCC4FFromCCC4B (ccColor4B byteColor)
 
static ccColor4F CCC4FFromCGColor (CGColorRef cgColor)
 
static ccColor4F CCC4FFromColorAndOpacity (ccColor3B byteColor, CCOpacity opacity)
 
static GLfloat CCC4FIntensity (ccColor4F color)
 
static ccColor4F CCC4FMake (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
 
static ccColor4F CCC4FModulate (ccColor4F rgba, ccColor4F modulation)
 
static ccColor4F CCC4FUniformScale (ccColor4F rgba, GLfloat scale)
 
static ccColor4F CCC4FUniformTranslate (ccColor4F rgba, GLfloat offset)
 
static GLubyte CCColorByteFromFloat (GLfloat colorValue)
 
static GLfloat CCColorFloatFromByte (GLubyte colorValue)
 
static CGPoint CGPointFromCC3IntPoint (CC3IntPoint ipt)
 
static CGRect CGRectFromCC3Viewport (CC3Viewport vp)
 
static CGSize CGSizeFromCC3IntSize (CC3IntSize isz)
 
static GLKQuaternion GLKQuaternionFromCC3Quaternion (CC3Quaternion cc3q)
 
static GLKVector3 GLKVector3FromCC3Vector (CC3Vector cc3v)
 
static GLKVector4 GLKVector4FromCC3Vector4 (CC3Vector4 cc3v)
 
static NSString * NSStringFromBoolean (BOOL value)
 
static NSString * NSStringFromCC3AngularVector (CC3AngularVector av)
 
static NSString * NSStringFromCC3AttenuationCoefficients (CC3AttenuationCoefficients coeffs)
 
static NSString * NSStringFromCC3BarycentricWeights (CC3BarycentricWeights bcw)
 
NSString * NSStringFromCC3BoundingBox (CC3Box bb) __deprecated
 
static NSString * NSStringFromCC3Box (CC3Box bb)
 
static NSString * NSStringFromCC3Face (CC3Face face)
 
static NSString * NSStringFromCC3FaceIndices (CC3FaceIndices faceIndices)
 
static NSString * NSStringFromCC3IntPoint (CC3IntPoint v)
 
static NSString * NSStringFromCC3IntSize (CC3IntSize size)
 
static NSString * NSStringFromCC3IntVector (CC3IntVector v)
 
static NSString * NSStringFromCC3IntVector4 (CC3IntVector4 v)
 
static NSString * NSStringFromCC3Plane (CC3Plane p)
 
static NSString * NSStringFromCC3Quaternion (CC3Quaternion q)
 
static NSString * NSStringFromCC3Ray (CC3Ray aRay)
 
static NSString * NSStringFromCC3Spere (CC3Sphere sphere)
 
static NSString * NSStringFromCC3Tessellation (CC3Tessellation t)
 
static NSString * NSStringFromCC3TexturedVertex (CC3TexturedVertex vertex)
 
static NSString * NSStringFromCC3Vector (CC3Vector v)
 
static NSString * NSStringFromCC3Vector4 (CC3Vector4 v)
 
NSString * NSStringFromCC3Vectors (CC3Vector *vectors, GLuint vectorCount)
 
static NSString * NSStringFromCC3Version ()
 
static NSString * NSStringFromCC3Viewport (CC3Viewport vp)
 
static NSString * NSStringFromCCC3B (ccColor3B rgb)
 
static NSString * NSStringFromCCC4B (ccColor4B rgba)
 
static NSString * NSStringFromCCC4F (ccColor4F rgba)
 
static ccColor4F RandomCCC4FBetween (ccColor4F min, ccColor4F max)
 

Variables

static const
CC3AttenuationCoefficients 
kCC3AttenuationNone = {1.0, 0.0, 0.0}
 
static const CC3Box kCC3BoxNull = { {INFINITY, INFINITY, INFINITY}, {INFINITY, INFINITY, INFINITY} }
 
static const CC3Box kCC3BoxZero = { {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }
 
static const CC3FaceIndices kCC3FaceIndicesZero = { {0, 0, 0} }
 
static const CC3Face kCC3FaceZero = { { { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } } }
 
static const CC3IntPoint kCC3IntPointZero = { 0, 0 }
 
static const CC3IntSize kCC3IntSizeZero = { 0, 0 }
 
static const CC3Plane kCC3PlaneZero = { 0, 0, 0, 0 }
 
static const CC3Quaternion kCC3QuaternionIdentity = { { {0.0, 0.0, 0.0} }, 1.0 }
 
static const CC3Vector4 kCC3QuaternionNull = { { {INFINITY, INFINITY, INFINITY} }, INFINITY}
 
static const CC3Quaternion kCC3QuaternionZero = { { {0.0, 0.0, 0.0} }, 0.0 }
 
static GLfloat kCC3ScaleMin = 1.0e-9f
 
static const CC3Vector4 kCC3Vector4Null = { { {INFINITY, INFINITY, INFINITY} }, INFINITY}
 
static const CC3Vector4 kCC3Vector4Zero = { { {0.0, 0.0, 0.0} }, 0.0 }
 
static const CC3Vector4 kCC3Vector4ZeroLocation = { { {0.0, 0.0, 0.0} }, 1.0 }
 
static const CC3Vector kCC3VectorNull = {INFINITY, INFINITY, INFINITY}
 
static const CC3Vector kCC3VectorUnitCube = { 1.0, 1.0, 1.0 }
 
static const GLfloat kCC3VectorUnitCubeLength = kCC3Sqrt3
 
static const CC3Vector kCC3VectorUnitXNegative = {-1.0, 0.0, 0.0 }
 
static const CC3Vector kCC3VectorUnitXPositive = { 1.0, 0.0, 0.0 }
 
static const CC3Vector kCC3VectorUnitYNegative = { 0.0, -1.0, 0.0 }
 
static const CC3Vector kCC3VectorUnitYPositive = { 0.0, 1.0, 0.0 }
 
static const CC3Vector kCC3VectorUnitZNegative = { 0.0, 0.0, -1.0 }
 
static const CC3Vector kCC3VectorUnitZPositive = { 0.0, 0.0, 1.0 }
 
static const CC3Vector kCC3VectorZero = { 0.0, 0.0, 0.0 }
 
static const CC3Viewport kCC3ViewportZero = { {0, 0, 0, 0} }
 
static const ccColor4F kCCC4FBlack = { 0.0, 0.0, 0.0, 1.0 }
 
static const ccColor4F kCCC4FBlackTransparent = {0.0, 0.0, 0.0, 0.0}
 
static const ccColor4F kCCC4FBlue = { 0.0, 0.0, 1.0, 1.0 }
 
static const ccColor4F kCCC4FCyan = { 0.0, 1.0, 1.0, 1.0 }
 
static const ccColor4F kCCC4FDarkGray = { 0.25, 0.25, 0.25, 1.0 }
 
static const ccColor4F kCCC4FGray = { 0.5, 0.5, 0.5, 1.0 }
 
static const ccColor4F kCCC4FGreen = { 0.0, 1.0, 0.0, 1.0 }
 
static const ccColor4F kCCC4FLightGray = { 0.75, 0.75, 0.75, 1.0 }
 
static const ccColor4F kCCC4FMagenta = { 1.0, 0.0, 1.0, 1.0 }
 
static const ccColor4F kCCC4FOrange = { 1.0, 0.5, 0.0, 1.0 }
 
static const ccColor4F kCCC4FRed = { 1.0, 0.0, 0.0, 1.0 }
 
static const ccColor4F kCCC4FWhite = { 1.0, 1.0, 1.0, 1.0 }
 
static const ccColor4F kCCC4FYellow = { 1.0, 1.0, 0.0, 1.0 }
 

Macro Definition Documentation

#define CC3_POP_NOSELECTOR   _Pragma("GCC diagnostic pop")

Resume compiler warnings of unimplemented selectors.

#define CC3_POP_NOSHADOW   _Pragma("GCC diagnostic pop")

Resume compiler warnings for hidden variable shadowing.

#define CC3_PUSH_NOSELECTOR   _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wselector\"")

Temporarily turn off compiler warnings of unimplemented selectors.

#define CC3_PUSH_NOSHADOW   _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wshadow\"")

Temporarily turn off compiler warnings for hidden variable shadowing.

#define cc3tc (   U,
 
)    CC3TexCoordsMake((U),(V))

Convenience alias macro to create ccTex2F with less keystrokes.

#define cc3v (   X,
  Y,
 
)    CC3VectorMake((X),(Y),(Z))

Convenience alias macro to create CC3Vectors with less keystrokes.

#define ccc4f (   R,
  G,
  B,
 
)    CCC4FMake((R),(G),(B),(A))

Convenience alias macro to create ccColor4F with less keystrokes.

#define COCOS3D_VERSION   0x020002

The version of Cocos3D, derived from the version format, where each of the HI.ME.LO components of the version is allocated two digits in this value, in the format HIMELO.

Examples:

  • 0.7 -> 0x000700
  • 2.7.3 -> 0x020703
#define kCC3BoundingBoxNull   kCC3BoxNull
Deprecated:
Renamed to kCC3BoxNull.
#define kCC3BoundingBoxZero   kCC3BoxZero
Deprecated:
Renamed to kCC3BoxZero.

Typedef Documentation

const CC3AttenuationCoefficients kCC3ParticleSizeAttenuationNone __deprecated = { { {0.0, 0.0, 0.0} }, 1.0 }

Deprecated.

Deprecated:
Misspelling of CC3TexturedVertex.
Deprecated:
Renamed to CC3Box.
Deprecated:
Replaced by kCC3QuaternionIdentity.

Use kCC3AttenuationNone instead.

typedef GLfloat CC3Angle

An angle such as a heading or inclination.

Can be measured in degrees or radians and may be positive or negative.

A struct representing an integer tessellation.

Function Documentation

static CC3AngularVector CC3AngularVectorDifference ( CC3AngularVector  minuend,
CC3AngularVector  subtrahend 
)
inlinestatic

Returns the difference between two CC3AngularVectors, by subtracting the corresponding heading, inclination & radial components.

Note that this is NOT true vector arithmetic, which would yield a completely different angular and radial results.

static CC3AngularVector CC3AngularVectorFromVector ( CC3Vector  aCoord)
inlinestatic

Returns an CC3AngularVector providing the heading, inclination & radius of the specified CC3Vector.

Heading is measured in degrees, in the X-Z plane, clockwise from the negative Z-axis. Inclination is measured in degrees, with up being in the positive-Y direction.

static CC3AngularVector CC3AngularVectorMake ( GLfloat  heading,
GLfloat  inclination,
GLfloat  radius 
)
inlinestatic

Returns an CC3AngularVector structure constructed from the vector components.

static BOOL CC3AttenuationCoefficientsAreEqual ( CC3AttenuationCoefficients  ac1,
CC3AttenuationCoefficients  ac2 
)
inlinestatic

Returns whether the two attenuation coefficents are equal by comparing their respective components.

static CC3AttenuationCoefficients CC3AttenuationCoefficientsLegalize ( CC3AttenuationCoefficients  ac)
inlinestatic

If at least one of the coefficients in the specified attenuation is not zero, the specified attenuation coefficients is returned unchanged.

However, if all three coefficients of the specified attenuation coefficients are zero, the value is illegal (and will cause divide-by-zero errors, especially in shaders). If that is the case, this function returns kCC3AttenuationNone.

static CC3AttenuationCoefficients CC3AttenuationCoefficientsMake ( GLfloat  constant,
GLfloat  linear,
GLfloat  quadratic 
)
inlinestatic

Returns a CC3AttenuationCoefficients structure constructed from the specified coefficients.

static CC3Vector4 CC3AxisAngleFromQuaternion ( CC3Quaternion  quaternion)
inlinestatic

Converts the specified quaternion to a vector that represents a rotation in axis-angle form.

The X, Y & Z components of the returned vector contain the rotation axis, and the W component specifies the angle, in degrees.

static BOOL CC3BarycentricWeightsAreInsideTriangle ( CC3BarycentricWeights  bcw)
inlinestatic

Returns whether the specified barycentric weights indicate a location inside a triangle.

To be inside a triangle, none of the weights may be negative. If any of the weights are negative, the specified barycentric weights represent a location outside a triangle.

static CC3BarycentricWeights CC3BarycentricWeightsMake ( GLfloat  b0,
GLfloat  b1,
GLfloat  b2 
)
inlinestatic

Returns a CC3BarycentricWeights structure constructed from the three specified weights.

static BOOL CC3BooleansAreEqual ( BOOL  b1,
BOOL  b2 
)
inlinestatic

Returns whether the two boolean values are in equal state.

This test will work if the two booleans each contain different non-zero content to indicate logical YES, whereas a simple == comparison would give an erroneous result in that situation.

CC3Box CC3BoundingBoxAddPadding ( CC3Box  bb,
CC3Vector  padding 
)
Deprecated:
Renamed to CC3BoxAddPadding.
CC3Box CC3BoundingBoxAddUniformPadding ( CC3Box  bb,
GLfloat  padding 
)
Deprecated:
Renamed to CC3BoxAddUniformPadding.
CC3Vector CC3BoundingBoxCenter ( CC3Box  bb)
Deprecated:
Renamed to CC3BoxCenter.
BOOL CC3BoundingBoxContainsLocation ( CC3Box  bb,
CC3Vector  aLoc 
)
Deprecated:
Renamed to CC3BoxContainsLocation.
CC3Box CC3BoundingBoxEngulfLocation ( CC3Box  bb,
CC3Vector  aLoc 
)
Deprecated:
Renamed to CC3BoxEngulfLocation.
BOOL CC3BoundingBoxesAreEqual ( CC3Box  bb1,
CC3Box  bb2 
)
Deprecated:
Renamed to CC3BoxesAreEqual.
CC3Box CC3BoundingBoxFromMinMax ( CC3Vector  minVtx,
CC3Vector  maxVtx 
)
Deprecated:
Renamed to CC3BoxFromMinMax.
BOOL CC3BoundingBoxIsNull ( CC3Box  bb)
Deprecated:
Renamed to CC3BoxIsNull.
BOOL CC3BoundingBoxIsZero ( CC3Box  bb)
Deprecated:
Renamed to CC3BoxIsZero.
CC3Box CC3BoundingBoxMake ( GLfloat  minX,
GLfloat  minY,
GLfloat  minZ,
GLfloat  maxX,
GLfloat  maxY,
GLfloat  maxZ 
)
Deprecated:
Renamed to CC3BoxMake.
CC3Box CC3BoundingBoxMoveCenterToOrigin ( CC3Box  bb)
Deprecated:
Renamed to CC3BoxMoveCenterToOrigin.
CC3Box CC3BoundingBoxScale ( CC3Box  bb,
CC3Vector  scale 
)
Deprecated:
Renamed to CC3BoxScale.
CC3Box CC3BoundingBoxScaleUniform ( CC3Box  bb,
GLfloat  scale 
)
Deprecated:
Renamed to CC3BoxScaleUniform.
CC3Vector CC3BoundingBoxSize ( CC3Box  bb)
Deprecated:
Renamed to CC3BoxSize.
CC3Box CC3BoundingBoxTranslate ( CC3Box  bb,
CC3Vector  offset 
)
Deprecated:
Renamed to CC3BoxTranslate.
CC3Box CC3BoundingBoxTranslateFractionally ( CC3Box  bb,
CC3Vector  offsetScale 
)
Deprecated:
Renamed to CC3BoxTranslateFractionally.
CC3Box CC3BoundingBoxUnion ( CC3Box  bb1,
CC3Box  bb2 
)
Deprecated:
Renamed to CC3BoxUnion.
static CC3Box CC3BoxAddPadding ( CC3Box  bb,
CC3Vector  padding 
)
inlinestatic

Returns a bounding box that has the same dimensions as the specified bounding box, but with each corner expanded outward by the specified amount of padding.

The padding value is added to the maximum vector, and subtracted from the minimum vector.

static CC3Box CC3BoxAddUniformPadding ( CC3Box  bb,
GLfloat  padding 
)
inlinestatic

Returns a box that has the same dimensions as the specified box, but with each corner expanded outward by the specified amount of padding.

The padding value is added to all three components of the maximum vector, and subtracted from all three components of the minimum vector.

static CC3Vector CC3BoxCenter ( CC3Box  bb)
inlinestatic

Returns the geometric center of the specified bounding box.

static BOOL CC3BoxContainsLocation ( CC3Box  bb,
CC3Vector  aLoc 
)
inlinestatic

Returns whether the specified bounding box contains the specified location.

CC3Box CC3BoxEngulfLocation ( CC3Box  bb,
CC3Vector  aLoc 
)

Returns the smallest CC3Box that contains both the specified bounding box and location.

If the specified bounding box is null, returns a bounding box of zero size at the specified location.

static BOOL CC3BoxesAreEqual ( CC3Box  bb1,
CC3Box  bb2 
)
inlinestatic

Returns whether the two bounding boxes are equal by comparing their respective components.

static CC3Box CC3BoxFromMinMax ( CC3Vector  minVtx,
CC3Vector  maxVtx 
)
inlinestatic

Returns a CC3Box structure constructed from the min and max vertices.

static BOOL CC3BoxIsNull ( CC3Box  bb)
inlinestatic

Returns whether the specified bounding box is equal to the null bounding box, specified by kCC3BoxNull.

static BOOL CC3BoxIsZero ( CC3Box  bb)
inlinestatic

Returns whether the specified bounding box is equal to the zero bounding box, specified by kCC3BoxZero.

static CC3Box CC3BoxMake ( GLfloat  minX,
GLfloat  minY,
GLfloat  minZ,
GLfloat  maxX,
GLfloat  maxY,
GLfloat  maxZ 
)
inlinestatic

Returns a CC3Box structure constructed from the min and max components.

static CC3Box CC3BoxMoveCenterToOrigin ( CC3Box  bb)
inlinestatic

Returns a bounding box of the same size as the specified bounding box, and whose center lies at the origin of the coordinate system.

This effectivly moves the bounding box so that its center is at the origin.

static CC3Box CC3BoxScale ( CC3Box  bb,
CC3Vector  scale 
)
inlinestatic

Returns a bounding box constructed by scaling the specified bounding box by the specified scale value.

Scaling can be different along each axis of the box.

This has the effect of multiplying each component of each of the vectors representing the minimum and maximum corners of the box by the corresponding component in the scale vector.

static CC3Box CC3BoxScaleUniform ( CC3Box  bb,
GLfloat  scale 
)
inlinestatic

Returns a bounding box constructed by scaling the specified bounding box by the specified scale value.

The same scaling is applied to each axis of the box.

This has the effect of multiplying each component of each of the vectors representing the minimum and maximum corners of the box by the scale value.

static CC3Vector CC3BoxSize ( CC3Box  bb)
inlinestatic

Returns the size of the specified bounding box, between the minimum to maximum corners.

static CC3Box CC3BoxTranslate ( CC3Box  bb,
CC3Vector  offset 
)
inlinestatic

Returns a box constructed by translating the specified box by the specified translation offset.

static CC3Box CC3BoxTranslateFractionally ( CC3Box  bb,
CC3Vector  offsetScale 
)
inlinestatic

Returns a box constructed by translating the specified box by a translation that is a fraction of the box size, as determined by the specified offsetScale.

For example, a value of -0.2 in the X-component of the offsetScale, will move the box 20% of its dimension in the X-axis, in the direction of the negative X-axis.

static CC3Box CC3BoxUnion ( CC3Box  bb1,
CC3Box  bb2 
)
inlinestatic

Returns the smallest CC3Box that contains the two specified bounding boxes.

If either bounding box is the null bounding box, simply returns the other bounding box (which may also be the null bounding box).

GLfloat CC3DistanceFromNormalizedPlane ( CC3Plane  p,
CC3Vector  v 
)
Deprecated:
Replaced with CC3DistanceFromPlane.
static GLfloat CC3DistanceFromPlane ( CC3Vector  v,
CC3Plane  p 
)
inlinestatic

Returns the distance from the specified location to the specified plane.

The distance is returned in terms of the length of the normal. If the normal is of unit length, then the distance is in absolute units.

BOOL CC3DoesRayIntersectSphere ( CC3Ray  aRay,
CC3Sphere  aSphere 
)

Returns whether the specified ray intersects the specified sphere.

static BOOL CC3DoesSphereIntersectSphere ( CC3Sphere  sphereOne,
CC3Sphere  sphereTwo 
)
inlinestatic

Returns whether the specified spheres intersect.

static NSString* CC3EnsureAbsoluteFilePath ( NSString *  filePath)
inlinestatic

Ensures that the specified file path is absolute, converting it if necessary.

Relative paths are assumed to be relative to the application resources directory. If the specified file path is not already absolute, the path to that directory is prepended to it.

static GLfloat CC3EnsureMinScaleAxis ( GLfloat  val)
inlinestatic

Ensures the specified value can be used as a component in a scale vector.

If the value is greater than kCC3ScaleMin or less than -kCC3ScaleMin, it is returned unchanced, otherwise either -kCC3ScaleMin or kCC3ScaleMin is returned, depending on whether the value is less than zero or not, respectively.

This is used to ensure that scales used in transforms do not cause uninvertable matrices.

static CC3Vector CC3EnsureMinScaleVector ( CC3Vector  scale)
inlinestatic

Ensures the absolute value of each of the components in the specified scale vector is greater than kCC3ScaleMin.

Any component between -kCC3ScaleMin and kCC3ScaleMin is replaced with -kCC3ScaleMin or kCC3ScaleMin depending on whether the component is less than zero or not, respectively.

This can be used to ensure that scales used in transforms do not cause uninvertable matrices.

CC3BarycentricWeights CC3FaceBarycentricWeights ( CC3Face  face,
CC3Vector  aLocation 
)

Returns the barycentric weights for the specified location on the plane of the specified face.

The returned weights are specified in the same order as the vertices of the face.

The specified location should be on the plane of the specified face.

If the location is on the plane of the specified face, the three returned weights will add up to one. If all three of the returned weights are positive, then the location is inside the triangle defined by the face, otherwise, at least one of the returned weights will be negative.

static CC3Vector CC3FaceCenter ( CC3Face  face)
inlinestatic

Returns the location of the center of the specified face, calculated as the mathematical average of the three vertices that define the face.

static CC3FaceIndices CC3FaceIndicesMake ( GLuint  i0,
GLuint  i1,
GLuint  i2 
)
inlinestatic

Returns a CC3FaceIndices structure constructed from the three specified vertex indices, which should be supplied in winding order.

static CC3Face CC3FaceInvert ( CC3Face  face)
inlinestatic

Returns a CC3Face structure that has the same vertices as the specified face, but in the opposite winding order.

static CC3Vector CC3FaceLocationFromBarycentricWeights ( CC3Face  face,
CC3BarycentricWeights  bcw 
)
inlinestatic

Returns the 3D cartesian location on the specified face that corresponds to the specified barycentric coordinate weights.

static CC3Face CC3FaceMake ( CC3Vector  v0,
CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns a CC3Face structure constructed from the three specified vectors, which should be supplied in winding order.

static CC3Vector CC3FaceNormal ( CC3Face  face)
inlinestatic

Returns a normalized normal vector derived from the location and winding order of the three vertices in the specified face.

The direction of the normal vector is affected by the winding order of the vertices in the face. The vertices should wind vertex[0] -> vertex[1] -> vertex[2]. The normal will point in the direction that has the three points winding in a counter-clockwise direction, according to a right-handed coordinate system. If the direction of the normal is important, be sure the winding order of the points in the face is correct.

static CC3Plane CC3FacePlane ( CC3Face  face)
inlinestatic

Returns a CC3Plane structure that contains the points in the specified face.

The direction of the normal of the returned plane is dependent on the winding order of the face, which is taken to be vertex[0] -> vertex[1] -> vertex[2], and the normal will point in the direction that has the three points winding in a counter-clockwise direction, according to a right-handed coordinate system. If the direction of the normal is important, be sure the winding order of the points in the face is correct.

void CC3FlipVertically ( GLubyte *  rowMajorData,
GLuint  rowCount,
GLuint  bytesPerRow 
)

Reverses the order of the rows in the specified data block.

The transformation is performed in-place.

This function can be useful for vertically flipping the contents of a texture or image, which is a common requirement when transferring content data between an OpenGL texture and an iOS or OSX image. Or it may be used to reverse the order of the rows of any row-major memory structure.

The specified data block is assumed to be in row-major order, containing the specified number of rows, and with the specified number of bytes in each row. The total number of bytes in the data block must be at least (bytesPerRow * rowCount).

static CC3IntPoint CC3IntPointAdd ( CC3IntPoint  p1,
CC3IntPoint  p2 
)
inlinestatic

Returns a point representing the sum of the two specified points, by add their respective components.

static CC3IntPoint CC3IntPointFromCGPoint ( CGPoint  pt)
inlinestatic

Returns a CC3IntPoint structure constructed from the specified CGPoint.

static BOOL CC3IntPointIsZero ( CC3IntPoint  p)
inlinestatic

Returns whether the specified point is zero, as specified by kCC3IntPointZero.

static CC3IntPoint CC3IntPointMake ( GLint  x,
GLint  y 
)
inlinestatic

Returns a CC3IntPoint structure constructed from the vector components.

static BOOL CC3IntPointsAreEqual ( CC3IntPoint  p1,
CC3IntPoint  p2 
)
inlinestatic

Returns whether the two points are equal by comparing their respective components.

static CC3IntSize CC3IntSizeFromCGSize ( CGSize  sz)
inlinestatic

Returns a CC3IntSize structure constructed from the specified CGSize.

static BOOL CC3IntSizeIsZero ( CC3IntSize  s)
inlinestatic

Returns whether the specified size is zero, as specified by kCC3IntSizeZero.

static CC3IntSize CC3IntSizeMake ( GLint  w,
GLint  h 
)
inlinestatic

Returns a CC3IntSize structure constructed from the dimensional components.

static BOOL CC3IntSizesAreEqual ( CC3IntSize  s1,
CC3IntSize  s2 
)
inlinestatic

Returns whether the two sizes are equal by comparing their respective components.

static CC3IntVector4 CC3IntVector4Make ( GLint  x,
GLint  y,
GLint  z,
GLint  w 
)
inlinestatic

Returns a CC3IntVector4 structure constructed from the vector components.

static BOOL CC3IntVector4sAreEqual ( CC3IntVector4  v1,
CC3IntVector4  v2 
)
inlinestatic

Returns whether the two vectors are equal by comparing their respective components.

static CC3IntVector CC3IntVectorMake ( GLint  x,
GLint  y,
GLint  z 
)
inlinestatic

Returns a CC3IntVector structure constructed from the vector components.

static BOOL CC3IntVectorsAreEqual ( CC3IntVector  v1,
CC3IntVector  v2 
)
inlinestatic

Returns whether the two vectors are equal by comparing their respective components.

static BOOL CC3IsBitClear ( GLbitfield  bits,
GLuint  bitIdx 
)
inlinestatic

Returns whether the specified bit in the specified bitfield is set to zero.

static BOOL CC3IsBitSet ( GLbitfield  bits,
GLuint  bitIdx 
)
inlinestatic

Returns whether the specified bit in the specified bitfield is set to one.

static BOOL CC3IsLocationOnRay ( CC3Vector  aLocation,
CC3Ray  aRay 
)
inlinestatic

Returns whether the specified location lies on the specified ray.

static BOOL CC3IsLocationWithinSphere ( CC3Vector  aLocation,
CC3Sphere  aSphere 
)
inlinestatic

Returns whether the specified location lies within the specified sphere.

static GLfloat CC3LuminosityBT601 ( GLfloat  red,
GLfloat  green,
GLfloat  blue 
)
inlinestatic

Returns the luminosity of the specified color as calculated using the ITU-R BT.601 conversion for standard-definition television (SDTV):

luminosity = (0.299 * red) + (0.587 * green) + (0.114 * blue),

static GLfloat CC3LuminosityBT709 ( GLfloat  red,
GLfloat  green,
GLfloat  blue 
)
inlinestatic

Returns the luminosity of the specified color as calculated using the ITU-R BT.709 conversion for high-definition television (HDTV):

luminosity = (0.2126 * red) + (0.7152 * green) + (0.0722 * blue),

static CC3Plane CC3PlaneFromLocations ( CC3Vector  v1,
CC3Vector  v2,
CC3Vector  v3 
)
inlinestatic

Returns a CC3Plane structure that contains the specified locations.

The direction of the normal of the returned plane is dependent on the winding order of the three locations. Winding is done in the order the locations are specified (v1 -> v2 -> v3), and the normal will point in the direction that has the three locations winding in a counter-clockwise direction, according to a right-handed coordinate system. If the direction of the normal is important, be sure to specify the three points in the appropriate order.

static CC3Plane CC3PlaneFromNormalAndLocation ( CC3Vector  n,
CC3Vector  loc 
)
inlinestatic

Returns a CC3Plane that has the specified normal and intersects the specified location.

CC3Plane CC3PlaneFromPoints ( CC3Vector  v1,
CC3Vector  v2,
CC3Vector  v3 
)
Deprecated:
Renamed to CC3PlaneFromLocations
static BOOL CC3PlaneIsZero ( CC3Plane  p)
inlinestatic

Returns whether the specified plane is equal to the zero plane, specified by kCC3PlaneZero.

static CC3Plane CC3PlaneMake ( GLfloat  a,
GLfloat  b,
GLfloat  c,
GLfloat  d 
)
inlinestatic

Returns a CC3Plane structure constructed from the specified coefficients.

static CC3Plane CC3PlaneNegate ( CC3Plane  p)
inlinestatic

Returns a plane that is the negative of the specified plane in all dimensions, including D.

The returned plane represents a plane that is coincident with the specified plane, but whose normal points in the opposite direction.

static CC3Vector CC3PlaneNormal ( CC3Plane  p)
inlinestatic

Returns the normal of the plane, which is (a, b, c) from the planar equation.

static CC3Plane CC3PlaneNormalize ( CC3Plane  p)
inlinestatic

Returns a normalized copy of the specified CC3Plane so that the length of its normal (a, b, c) is 1.0.

static BOOL CC3PlanesAreEqual ( CC3Plane  p1,
CC3Plane  p2 
)
inlinestatic

Returns whether the two planes are equal by comparing their respective components.

static CC3Quaternion CC3QuaternionConjugate ( CC3Quaternion  q)
inlinestatic

Returns a quaternion that is the conjugate of the specified quaterion.

The X, Y, Z dimensions are negated, but the W is not.

static GLfloat CC3QuaternionDot ( CC3Quaternion  q1,
CC3Quaternion  q2 
)
inlinestatic

Returns the dot-product of the two given quaternions (q1 .

q2).

static CC3Quaternion CC3QuaternionFromAxisAngle ( CC3Vector4  axisAngle)
inlinestatic

Converts the specified vector that represents an rotation in axis-angle form to the corresponding quaternion.

The X, Y & Z components of the incoming vector contain the rotation axis, and the W component specifies the angle, in degrees.

static CC3Quaternion CC3QuaternionFromCC3Vector ( CC3Vector  v,
GLfloat  w 
)
inlinestatic

Returns a CC3Quaternion structure constructed from a 3D vector and a w component.

static CC3Quaternion CC3QuaternionFromGLKQuaternion ( GLKQuaternion  glkq)
inlinestatic

Returns a CC3Quaternion structure constructed from the specified GLKQuaternion structure.

Although CC3Quaternion has the same internal structure as GLKQuaternion, the structures may have different byte alignment requirements. Avoid casting directly between GLKQuaternion and CC3Quaternion, as this is not guaranteed to work reliably.

CC3Quaternion CC3QuaternionFromRotation ( CC3Vector  aRotation)

Converts the specified Euler angle rotational vector to a quaternion.

The specified rotation vector contains three Euler angles measured in degrees.

static CC3Quaternion CC3QuaternionInvert ( CC3Quaternion  q)
inlinestatic

Returns the inverse of the specified quaterion.

The inverse of a quaternion is another quaternion such that multiplying a quaternion by its inverse results in the identity quaternion.

The returned inverse quaternion is calculated as the conjugate of the specified quaternion divided by the square of the length of the specified quaternion.

static BOOL CC3QuaternionIsNull ( CC3Quaternion  q)
inlinestatic

Returns whether the specified quaternion is equal to the null quaternion, specified by kCC3QuaternionNull.

static BOOL CC3QuaternionIsZero ( CC3Quaternion  q)
inlinestatic

Returns whether the specified quaternion is equal to the zero quaternion, specified by kCC3QuaternionZero.

static GLfloat CC3QuaternionLength ( CC3Quaternion  q)
inlinestatic

Returns the scalar length (or magnitude) of the specified quaternion.

This is calculated as sqrt(x*x + y*y + z*z + w*w) and will always be positive.

static GLfloat CC3QuaternionLengthSquared ( CC3Quaternion  q)
inlinestatic

Returns the square of the scalar length (or magnitude) of the specified quaternion.

This is calculated as (x*x + y*y + z*z + w*w) and will always be positive.

This function is useful for comparing vector sizes without having to run an expensive square-root calculation.

static CC3Quaternion CC3QuaternionMake ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)
inlinestatic

Returns a CC3Quaternion structure constructed from the vector components.

static CC3Quaternion CC3QuaternionMultiply ( CC3Quaternion  qL,
CC3Quaternion  qR 
)
inlinestatic

Returns the result of multiplying qL on the left by qR on the right.

This represents a concatenation of two rotations, so that a point rotated by the result is equivalent to the point being rotated first by qL and then by qR: (qL.qR).p == qR.(qL.p).

static CC3Quaternion CC3QuaternionNegate ( CC3Quaternion  q)
inlinestatic

Returns a quaternion that is the negative of the specified quaterion in all dimensions, including W.

static CC3Quaternion CC3QuaternionNormalize ( CC3Quaternion  q)
inlinestatic

Returns a normalized copy of the specified quaternion so that its length is 1.0.

The w-component is also normalized.

static CC3Vector CC3QuaternionRotateVector ( CC3Quaternion  q,
CC3Vector  v 
)
inlinestatic

Returns the specified vector rotated by the specified quaternion.

This uses a highly optimized version of the basic quaternion rotation equation: qvq(-1):

v' = v + 2 * cross(cross(v, q.v) + (q.w * v), q.v)

Derivation of this algorithm can be found in the following Wikipedia article: http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Performance_comparisons which describes the algo in terms of a left-handed coordinate system. It has been modified here for the right-handed coordinate system of OpenGL.

The right-handed algo is also described here: http://twistedpairdevelopment.wordpress.com/2013/02/11/rotating-a-vector-by-a-quaternion-in-glsl/

A related algo can be found derived (for left-handed coordinates) here: http://mollyrocket.com/forums/viewtopic.php?t=833&sid=3a84e00a70ccb046cfc87ac39881a3d0

static BOOL CC3QuaternionsAreEqual ( CC3Quaternion  q1,
CC3Quaternion  q2 
)
inlinestatic

Returns whether the two quaterions are equal by comparing their respective components.

static CC3Quaternion CC3QuaternionScaleUniform ( CC3Quaternion  q,
GLfloat  scale 
)
inlinestatic

Returns the result of scaling the original quaternion by the corresponding scale factor uniformly along all axes.

CC3Quaternion CC3QuaternionSlerp ( CC3Quaternion  q1,
CC3Quaternion  q2,
GLfloat  blendFactor 
)

Returns a spherical linear interpolation between two quaternions, based on the blendFactor.

which should be between zero and one inclusive. The returned quaternion is calculated as q1 + (blendFactor * (q2 - q1)). If the blendFactor is either zero or one exactly, this function short-circuits to simply return q1 or q2 respectively.

static CC3Ray CC3RayFromLocDir ( CC3Vector  aLocation,
CC3Vector  aDirection 
)
inlinestatic

Returns a CC3Ray structure constructed from the start location and direction vectors.

CC3Vector CC3RayIntersectionOfSphere ( CC3Ray  aRay,
CC3Sphere  aSphere 
)
Deprecated:
Renamed to CC3RayIntersectionWithSphere.
CC3Vector CC3RayIntersectionWithBoundingBox ( CC3Ray  aRay,
CC3Box  bb 
)
Deprecated:
Renamed to CC3RayIntersectionWithBox.
CC3Vector4 CC3RayIntersectionWithBoundingBoxSide ( CC3Ray  aRay,
CC3Box  bb,
CC3Vector  sideNormal,
CC3Vector4  prevHit 
)
Deprecated:
Renamed to CC3RayIntersectionWithBoxSide.
CC3Vector CC3RayIntersectionWithBox ( CC3Ray  aRay,
CC3Box  bb 
)

Returns the location that the specified ray intersects the specified bounding box, or returns kCC3VectorNull if the ray does not intersect the bounding box, or the bounding box is behind the ray.

The result takes into consideration the startLocation of the ray, and will return kCC3VectorNull if the bounding box is behind the startLocation, even if the line projecting back through the startLocation in the negative direction of the ray intersects the bounding box.

The ray may start inside the bounding box, and the exit location of the ray will be returned.

CC3Vector4 CC3RayIntersectionWithBoxSide ( CC3Ray  aRay,
CC3Box  bb,
CC3Vector  sideNormal,
CC3Vector4  prevHit 
)

Returns the location that the specified ray intersects the specified bounding box, on the side of the bounding box that has the specified normal, but only if the intersection distance is less than the specified previous intersection location.

The distance measurement is specified in the W component of the returned 4D vector.

If the ray does not intersect the specified side of the bounding box, if the side is behind the ray, or if the intersection distance is larger than that for the specified previous intersection location is returned.

This method first creates the plane on which the side exists, finds the intersection of the ray and that plane, determines whether the intersection location is actually within the bounding box, and then tests whether the intersection distance is less than for the specified previous intersection.

CC3Vector4 CC3RayIntersectionWithPlane ( CC3Ray  ray,
CC3Plane  plane 
)

Returns the location of the point where the specified ray intersects the specified plane.

The returned result is a 4D vector, where the x, y & z components give the intersection location in 3D space, and the w component gives the distance from the startLocation of the ray to the intersection location, in multiples of the ray direction vector. If this value is negative, the intersection point is in the direction opposite to the direction of the ray.

If the ray is parallel to the plane, no intersection occurs, and the returned 4D vector will be equal to kCC3Vector4Null.

CC3Vector CC3RayIntersectionWithSphere ( CC3Ray  aRay,
CC3Sphere  aSphere 
)

Returns the location that the specified ray intersects the specified sphere, or returns kCC3VectorNull if the ray does not intersect the sphere, or the sphere is behind the ray.

The result takes into consideration the startLocation of the ray, and will return kCC3VectorNull if the sphere is behind the startLocation, even if the line projecting back through the startLocation in the negative direction of the ray intersects the sphere.

The ray may start inside the sphere, in which case, the returned location represents the exit location of the ray.

static CC3Ray CC3RayMake ( GLfloat  locX,
GLfloat  locY,
GLfloat  locZ,
GLfloat  dirX,
GLfloat  dirY,
GLfloat  dirZ 
)
inlinestatic

Returns a CC3Ray structure constructed from the start location and direction components.

CC3Plane CC3RaySphereIntersectionEquation ( CC3Ray  aRay,
CC3Sphere  aSphere 
)

Returns the coefficients of the quadratic equation that describes the points of intersection between the specified ray and sphere.

Given the equation for a sphere at the origin: x*x + y*y + z*z = r*r, and the equation for a ray in the same frame of reference: p = s + tv, where s is the ray start, v is the ray direction, and p is a point on the ray, we can solve for the intersection points of the ray and sphere. The result is a quadratic equation in t: at*t + bt + c = 0, where: a = v*v, b = 2(s.v), and c = s*s - r*r.

The a, b and c elements of the returned CC3Plane structure contain the a, b and c coefficients of the quadratic equation, respectively. The d element of the returned CC3Plane structure contains the discriminant of the quadratic equation (d = b*b - 4ac).

The returned quadratic coefficients are not a plane. The CC3Plane structure is simply used for convenience.

Reference: Mathematics for 3D Game Programming and Computer Graphics, 3rd ed. book, by Eric Lengyel

static NSString* CC3ResolveResourceFilePath ( NSString *  filePath)
inlinestatic

Resolves the specified file path as one of:

  • An absolute path.
  • A path within the application bundle resource directory.
  • A path within the Cocos3D library bundle resource directory.

This function checks for the existence of the file on each of the above paths, in order, and returns an absolute path to the first file located.

Since the paths are searched in the above order, the application can provide a resource file to override a standard Cocos3D library resource file by adding the file with the same name to the application bundle resource directory.

Returns nil if the file could not be located in on any of the paths above.

CC3Vector CC3RotationFromQuaternion ( CC3Quaternion  aQuaternion)

Converts the specified quaternion to a Euler angle rotational vector.

The returned rotation vector contains three Euler angles measured in degrees.

static void CC3SetBit ( GLbitfield *  bits,
GLuint  bitIdx,
BOOL  val 
)
inlinestatic

Sets the specified bit in the specified bitfield is to one if the specified value is YES, or to zero if the specified value is NO.

static CC3Sphere CC3SphereFromCircumscribingBox ( CC3Box  box)
inlinestatic

Returns a CC3Spere that circumscribes the specified box.

static CC3Sphere CC3SphereMake ( CC3Vector  center,
GLfloat  radius 
)
inlinestatic

Returns a CC3Spere constructed from the specified center and radius.

CC3Sphere CC3SphereUnion ( CC3Sphere  s1,
CC3Sphere  s2 
)

Returns the smallest CC3Sphere that contains the two specified spheres.

static CC3Tessellation CC3TessellationMake ( GLint  x,
GLint  y 
)
inlinestatic

Returns a CC3Tessellation structure constructed from the specified components.

static ccTex2F CC3TexCoordsMake ( GLfloat  u,
GLfloat  v 
)
inlinestatic

Returns a ccTex2F structure constructed from the vector components.

CC3Vector CC3TriplePlaneIntersection ( CC3Plane  p1,
CC3Plane  p2,
CC3Plane  p3 
)

Returns the instersection point of the three specified planes, or returns kCC3VectorNull if the planes do not intersect at a single point, which can occur if the planes are parallel, or if one plane is parallel to the line of intersection of the other two planes.

static CC3Vector4 CC3Vector4Add ( CC3Vector4  v,
CC3Vector4  translation 
)
inlinestatic

Returns the result of adding the two specified vectors, by adding the corresponding components of both vectors.

If one vector is a location (W=1) and the other is a direction (W=0), this can be thought of as a translation of the location in that direction.

static CC3Vector4 CC3Vector4Difference ( CC3Vector4  minuend,
CC3Vector4  subtrahend 
)
inlinestatic

Returns the difference between two vectors, by subtracting the subtrahend from the minuend, which is accomplished by subtracting each of the corresponding components.

If both vectors are locations (W=1), the result will be a direction (W=0).

static GLfloat CC3Vector4Dot ( CC3Vector4  v1,
CC3Vector4  v2 
)
inlinestatic

Returns the dot-product of the two given vectors (v1 .

v2).

static CC3Vector4 CC3Vector4FromCC3Vector ( CC3Vector  v,
GLfloat  w 
)
inlinestatic

Returns a CC3Vector4 structure constructed from a 3D vector and a w component.

static CC3Vector4 CC3Vector4FromDirection ( CC3Vector  aDirection)
inlinestatic

Returns a CC3Vector4 homogeneous coordinate constructed from a 3D direction.

The W component of the returned vector is set to 0.0.

static CC3Vector4 CC3Vector4FromGLKVector4 ( GLKVector4  glkv)
inlinestatic

Returns a CC3Vector4 structure constructed from the specified GLKVector4 structure.

Although CC3Vector4 has the same internal structure as GLKVector4, the structures may have different byte alignment requirements. Avoid casting directly between GLKVector4 and CC3Vector4, as this is not guaranteed to work reliably.

static CC3Vector4 CC3Vector4FromLocation ( CC3Vector  aLocation)
inlinestatic

Returns a CC3Vector4 homogeneous coordinate constructed from a 3D location.

The W component of the returned vector is set to 1.0.

static CC3Vector4 CC3Vector4HomogeneousNegate ( CC3Vector4  v)
inlinestatic

Returns a vector that is the negative of the specified homogeneous vector in the X, Y & Z axes.

The W component is left unchanged.

static CC3Vector4 CC3Vector4HomogeneousScaleUniform ( CC3Vector4  v,
GLfloat  scale 
)
inlinestatic

Returns the result of scaling the original vector by the corresponding scale factor uniformly along the X, Y & Z axes.

The W component is left unchanged.

Use this method for scaling 4D homgeneous coordinates.

static CC3Vector4 CC3Vector4Homogenize ( CC3Vector4  v)
inlinestatic

If the specified homogeneous vector represents a location (w is not zero), returns a homoginized copy of the vector, by dividing each component by the w-component (including the w-component itself, leaving it with a value of one).

If the specified vector is a direction (w is zero), or is already homogenized (w is one) the vector is returned unchanged.

static BOOL CC3Vector4IsDirectional ( CC3Vector4  v)
inlinestatic

Returns whether the vector represents a direction, rather than a location.

It is directional if the w component is zero.

static BOOL CC3Vector4IsInFrontOfPlane ( CC3Vector4  v,
CC3Plane  plane 
)
inlinestatic

Returns whether the specified 4D homogeneous vector is in front of the specified normalized plane.

If the vector is a location (w = 1), being "in front" means the location is on the side of the plane from which the plane normal points.

If the vector is a direction (w = 0), being "in front" means that the direction points away from the plane on the same side of the plane as the normal points away from the plane.

static BOOL CC3Vector4IsLocational ( CC3Vector4  v)
inlinestatic

Returns whether the vector represents a location, rather than a direction.

It is locational if the w component is not zero.

static BOOL CC3Vector4IsNull ( CC3Vector4  v)
inlinestatic

Returns whether the specified vector is equal to the null vector, specified by kCC3Vector4Null.

static BOOL CC3Vector4IsZero ( CC3Vector4  v)
inlinestatic

Returns whether the specified vector is equal to the zero vector, specified by kCC3Vector4Zero.

static GLfloat CC3Vector4Length ( CC3Vector4  v)
inlinestatic

Returns the scalar length of the specified vector from the origin, including the w-component This is calculated as sqrt(x*x + y*y + z*z + w*w) and will always be positive.

static GLfloat CC3Vector4LengthSquared ( CC3Vector4  v)
inlinestatic

Returns the square of the scalar length of the specified vector from the origin, including the w-component.

This is calculated as (x*x + y*y + z*z + w*w) and will always be positive.

This function is useful for comparing vector sizes without having to run an expensive square-root calculation.

static CC3Vector4 CC3Vector4Make ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)
inlinestatic

Returns a CC3Vector4 structure constructed from the vector components.

static CC3Vector4 CC3Vector4Negate ( CC3Vector4  v)
inlinestatic

Returns a vector that is the negative of the specified vector in all dimensions, including W.

static CC3Vector4 CC3Vector4Normalize ( CC3Vector4  v)
inlinestatic

Returns a normalized copy of the specified vector so that its length is 1.0.

The w-component is also normalized.

static BOOL CC3Vector4sAreEqual ( CC3Vector4  v1,
CC3Vector4  v2 
)
inlinestatic

Returns whether the two vectors are equal by comparing their respective components.

static CC3Vector4 CC3Vector4ScaleUniform ( CC3Vector4  v,
GLfloat  scale 
)
inlinestatic

Returns the result of scaling the original vector by the corresponding scale factor uniformly along all axes.

CC3Vector4 CC3Vector4Slerp ( CC3Vector4  v1,
CC3Vector4  v2,
GLfloat  blendFactor 
)
Deprecated:
Replaced by CC3QuaternionSlerp.
static CC3Vector CC3VectorAdd ( CC3Vector  v,
CC3Vector  translation 
)
inlinestatic

Returns the result of adding the two specified vectors, by adding the corresponding components of both vectors.

This can also be thought of as a translation of the first vector by the second.

static CC3Vector CC3VectorAverage ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns a vector that represents the average of the two specified vectors.

This is calculated by adding the two specified vectors and scaling the resulting sum vector by half.

The returned vector represents the midpoint between a line that joins the endpoints of the two specified vectors.

static CC3Vector CC3VectorCross ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns the cross-product of the two given vectors (v1 x v2).

static CC3Vector CC3VectorDifference ( CC3Vector  minuend,
CC3Vector  subtrahend 
)
inlinestatic

Returns the difference between two vectors, by subtracting the subtrahend from the minuend, which is accomplished by subtracting each of the corresponding x,y,z components.

static GLfloat CC3VectorDistance ( CC3Vector  start,
CC3Vector  end 
)
inlinestatic

Returns the positive scalar distance between the ends of the two specified vectors.

static GLfloat CC3VectorDistanceSquared ( CC3Vector  start,
CC3Vector  end 
)
inlinestatic

Returns the square of the scalar distance between the ends of the two specified vectors.

This function is useful for comparing vector distances without having to run an expensive square-root calculation.

static GLfloat CC3VectorDot ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns the dot-product of the two given vectors (v1 .

v2).

static CC3Vector CC3VectorFromAngularVector ( CC3AngularVector  av)
inlinestatic

Returns a CC3Vector from the specified CC3AngularVector.

Heading is measured in degrees, in the X-Z plane, clockwise from the negative Z-axis. Inclination is measured in degrees, with up being in the positive-Y direction.

static CC3Vector CC3VectorFromGLKVector3 ( GLKVector3  glkv)
inlinestatic

Returns a CC3Vector structure constructed from the specified GLKVector3 structure.

Although CC3Vector has the same internal structure as GLKVector3, the structures may have different byte alignment requirements. Avoid casting directly between GLKVector3 and CC3Vector, as this is not guaranteed to work reliably.

static CC3Vector CC3VectorFromHomogenizedCC3Vector4 ( CC3Vector4  v)
inlinestatic

Returns a CC3Vector structure constructed from a CC3Vector4.

The CC3Vector4 is first homogenized (via CC3Vector4Homogenize), before copying the resulting x, y & z coordinates into the CC3Vector.

CC3Vector CC3VectorFromQuaternion ( CC3Quaternion  q)
Deprecated:
You can now use q.v instead. See the declaration of the CC3Quaterion/CC3Vector4 structure.
CC3Vector CC3VectorFromTruncatedCC3Vector4 ( CC3Vector4  v)
Deprecated:
You can now use v.v instead. See the declaration of the CC3Vector4 structure.
static CC3Vector CC3VectorInvert ( CC3Vector  v)
inlinestatic

Returns a CC3Vector that is the inverse of the specified vector in all directions, such that scaling the original by the inverse using CC3VectorScale will result in a vector of unit dimension in each direction (1.0, 1.0, 1.0).

The result of this function is effectively calculated by dividing each component of the original vector into 1.0 (1.0/x, 1.0/y, 1.0/z). It is the responsibility of the caller to ensure that none of the components of the original is zero.

static BOOL CC3VectorIsInFrontOfPlane ( CC3Vector  v,
CC3Plane  p 
)
inlinestatic

Returns whether the specified vector is in front of the specified normalized plane.

If the vector is a location, being "in front" means the location is on the side of the plane from which the plane normal points.

If the vector is a direction, being "in front" means that the direction points away from the plane on the same side of the plane as the normal points away from the plane.

static BOOL CC3VectorIsNull ( CC3Vector  v)
inlinestatic

Returns whether the specified vector is equal to the null vector, specified by kCC3VectorNull.

static BOOL CC3VectorIsZero ( CC3Vector  v)
inlinestatic

Returns whether the specified vector is equal to the zero vector, specified by kCC3VectorZero.

static GLfloat CC3VectorLength ( CC3Vector  v)
inlinestatic

Returns the scalar length of the specified CC3Vector from the origin.

This is calculated as sqrt(x*x + y*y + z*z) and will always be positive.

static GLfloat CC3VectorLengthSquared ( CC3Vector  v)
inlinestatic

Returns the square of the scalar length of the specified CC3Vector from the origin.

This is calculated as (x*x + y*y + z*z) and will always be positive.

This function is useful for comparing vector sizes without having to run an expensive square-root calculation.

static CC3Vector CC3VectorLerp ( CC3Vector  v1,
CC3Vector  v2,
GLfloat  blendFactor 
)
inlinestatic

Returns a linear interpolation between two vectors, based on the blendFactor.

which should be between zero and one inclusive. The returned value is calculated as v1 + (blendFactor * (v2 - v1)). If the blendFactor is either zero or one exactly, this method short-circuits to simply return v1 or v2 respectively.

static CC3Vector CC3VectorMake ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)
inlinestatic

Returns a CC3Vector structure constructed from the vector components.

static CC3Vector CC3VectorMaximize ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns a vector whose components comprise the maximum value of each of the respective components of the two specfied vectors.

In general, do not expect this method to return one of the specified vectors, but a new vector, each of the components of which is the maximum value for that component between the two vectors.

static CC3Vector CC3VectorMinimize ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns a vector whose components comprise the minimum value of each of the respective components of the two specfied vectors.

In general, do not expect this method to return one of the specified vectors, but a new vector, each of the components of which is the minimum value for that component between the two vectors.

static CC3Vector CC3VectorNegate ( CC3Vector  v)
inlinestatic

Returns a vector that is the negative of the specified vector in all directions.

For vectors that represent directions, the returned vector points in the direction opposite to the original.

static CC3Vector CC3VectorNormalize ( CC3Vector  v)
inlinestatic

Returns a normalized copy of the specified CC3Vector so that its length is 1.0.

If the length is zero, the original vector (a zero vector) is returned.

void CC3VectorOrthonormalize ( CC3Vector vectors,
GLuint  vectorCount 
)

Orthonormalizes the specified array of vectors, using a Gram-Schmidt process, and returns the orthonormal results in the same array.

The vectorCount argument indicates the number of vectors in the vectors array argument.

Upon completion, each vector in the specfied array will be a unit vector that is orthagonal to all of the other vectors in the array.

The first vector in the array is used as the starting point for orthonormalization. Since the Gram-Schmidt process is biased towards the starting vector, if this function will be used repeatedly on the same set of vectors, it is recommended that the order of the vectors in the array be changed on each call to this function, to ensure that the starting bias be averaged across each of the vectors over the long term.

static void CC3VectorOrthonormalizeTriple ( CC3Vector triVector)
inlinestatic

Orthonormalizes the specified array of three vectors, using a Gram-Schmidt process, and returns the orthonormal results in the same array.

The number of vectors in the specified array must be exactly three.

Upon completion, each vector in the specfied array will be a unit vector that is orthagonal to all of the other vectors in the array.

The first vector in the array is used as the starting point for orthonormalization. Since the Gram-Schmidt process is biased towards the starting vector, if this function will be used repeatedly on the same set of vectors, it is recommended that the order of the vectors in the array be changed on each call to this function, to ensure that the starting bias be averaged across each of the vectors over the long term.

static CC3Vector CC3VectorRotationalDifference ( CC3Vector  minuend,
CC3Vector  subtrahend 
)
inlinestatic

Returns the difference between two rotation vectors, in terms of the minimal degrees, along each axis, required to travel between the two roations, given that rotations are cyclical with a period of 360 degrees.

The result may be positive or negative, but will always be between (+/-180 degrees).

For example, the difference between 350 and 10 will yield -20 (ie- the smallest change from 10 degrees to 350 degrees is -20 degrees) rather than +340 (from simple subtraction). Similarly, the difference between 10 and 350 will yield +20 (ie- the smallest change from 350 degrees to 10 degrees is +20 degrees) rather than -340 (from simple subtraction).

static CC3Vector CC3VectorRotationModulo ( CC3Vector  aRotation)
inlinestatic

Returns a modulo version of the specifed rotation, so that each component is between (+/-360 degrees).

static BOOL CC3VectorsAreEqual ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns whether the two vectors are equal by comparing their respective components.

static BOOL CC3VectorsAreParallel ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns YES if the two vectors are either exactly parallel or exactly antiparallel.

static BOOL CC3VectorsArePerpendicular ( CC3Vector  v1,
CC3Vector  v2 
)
inlinestatic

Returns whether the two vectors are exactly perpendicular.

static CC3Vector CC3VectorScale ( CC3Vector  v,
CC3Vector  scale 
)
inlinestatic

Returns the result of scaling the original vector by the corresponding scale vector.

Scaling can be different for each axis. This has the effect of multiplying each component of the vector by the corresponding component in the scale vector.

static CC3Vector CC3VectorScaleUniform ( CC3Vector  v,
GLfloat  scale 
)
inlinestatic

Returns the result of scaling the original vector by the corresponding scale factor uniformly along all axes.

static BOOL CC3ViewportContainsPoint ( CC3Viewport  vp,
CGPoint  point 
)
inlinestatic

Returns whether the specified point lies within the specified viewport.

A point is considered inside the viewport if its coordinates lie inside the viewport or on the minimum X or minimum Y edge.

static CC3Viewport CC3ViewportFromCGRect ( CGRect  rect)
inlinestatic

Returns a CC3Viewport constructed from the specified CGRect.

static CC3Viewport CC3ViewportFromOriginAndSize ( CC3IntPoint  origin,
CC3IntSize  size 
)
inlinestatic

Returns a CC3Viewport constructed from the specified origin and size.

static BOOL CC3ViewportIsZero ( CC3Viewport  vp)
inlinestatic

Returns whether the specified viewport is equal to the zero viewport, specified by kCC3ViewportZero.

static CC3Viewport CC3ViewportMake ( GLint  x,
GLint  y,
GLint  w,
GLint  h 
)
inlinestatic

Returns a CC3Viewport structure constructed from the specified components.

static BOOL CC3ViewportsAreEqual ( CC3Viewport  vp1,
CC3Viewport  vp2 
)
inlinestatic

Returns whether the two viewports are equal by comparing their respective components.

static CC3Viewport CC3ViewportTranslate ( CC3Viewport  vp,
CC3IntPoint  offset 
)
inlinestatic

Returns a CC3Viewport of the same size as the specified viewport, but whose origin is translated from the origin of the specified viewport by the by the specified amount.

static BOOL CCC3BAreEqual ( ccColor3B  c1,
ccColor3B  c2 
)
inlinestatic

Returns whether the two colors are equal by comparing their respective components.

static ccColor3B CCC3BBlend ( ccColor3B  baseColor,
ccColor3B  blendColor,
GLfloat  blendWeight 
)
inlinestatic

Returns an ccColor3B structure whose values are a weighted average of the specified base color and the blend color.

The parameter blendWeight should be between zero and one. A value of zero will leave the base color unchanged. A value of one will result in the blend being the same as the blend color.

static ccColor3B CCC3BFromCCC4B ( ccColor4B  color)
inlinestatic

Returns a ccColor3B structure constructed from the specified ccColor4B.

static ccColor3B CCC3BFromCCC4F ( ccColor4F  floatColor)
inlinestatic

Returns a ccColor3B structure constructed from the specified ccColor4F.

static BOOL CCC4BAreEqual ( ccColor4B  c1,
ccColor4B  c2 
)
inlinestatic

Returns whether the two colors are equal by comparing their respective components.

static ccColor4B CCC4BBlendAlpha ( ccColor4B  rgba)
inlinestatic

Returns a ccColor4B color whose R, G & B components are those of the specified color multiplied by the alpha value of the specified color, clamping to the range between zero and 255 if needed.

The alpha value remains unchanged.

This function performs the same operation on the specified color that is known as pre-multiplied alpha when applied to the texels of a texture.

static ccColor4B CCC4BFromCCC4F ( ccColor4F  floatColor)
inlinestatic

Returns a ccColor4B structure constructed from the specified ccColor4F.

static ccColor4B CCC4BFromColorAndOpacity ( ccColor3B  byteColor,
CCOpacity  opacity 
)
inlinestatic

Returns a ccColor4B structure constructed from the specified ccColor3B and opacity.

static ccColor4F CCC4FAdd ( ccColor4F  rgba,
ccColor4F  translation 
)
inlinestatic

Returns the result of adding the two specified colors, by adding the corresponding components.

Each of the resulting color components is clamped to be between 0.0 and 1.0. This can also be thought of as a translation of the first color by the second.

static BOOL CCC4FAreEqual ( ccColor4F  c1,
ccColor4F  c2 
)
inlinestatic

Returns whether the two colors are equal by comparing their respective components.

static ccColor4F CCC4FBlend ( ccColor4F  baseColor,
ccColor4F  blendColor,
GLfloat  blendWeight 
)
inlinestatic

Returns a ccColor4F structure whose values are a weighted average of the specified base color and the blend color.

The parameter blendWeight should be between zero and one. A value of zero will leave the base color unchanged. A value of one will result in the blend being the same as the blend color.

static ccColor4F CCC4FBlendAlpha ( ccColor4F  rgba)
inlinestatic

Returns a ccColor4F color whose R, G & B components are those of the specified color multiplied by the alpha value of the specified color, clamping to the range between zero and one if needed.

The alpha value remains unchanged.

This function performs the same operation on the specified color that is known as pre-multiplied alpha when applied to the texels of a texture.

static ccColor4F CCC4FDifference ( ccColor4F  minuend,
ccColor4F  subtrahend 
)
inlinestatic

Returns the difference between two colors, by subtracting the subtrahend from the minuend, which is accomplished by subtracting each of the corresponding r,g, b, a components.

Each of the resulting color components is clamped to be between 0.0 and 1.0.

static ccColor4F CCC4FFromCCC4B ( ccColor4B  byteColor)
inlinestatic

Returns a ccColor4F structure constructed from the specified ccColor4B.

static ccColor4F CCC4FFromCGColor ( CGColorRef  cgColor)
inlinestatic

Returns a ccColor4F structure constructed from the specified CoreGraphics CGColorRef.

static ccColor4F CCC4FFromColorAndOpacity ( ccColor3B  byteColor,
CCOpacity  opacity 
)
inlinestatic

Returns a ccColor4F structure constructed from the specified ccColor3B and opacity.

static GLfloat CCC4FIntensity ( ccColor4F  color)
inlinestatic

Returns the intensity of the specified color, calculated as the arithmetic mean of the R, G & B components.

static ccColor4F CCC4FMake ( GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha 
)
inlinestatic

Returns a ccColor4F structure constructed from the specified components.

static ccColor4F CCC4FModulate ( ccColor4F  rgba,
ccColor4F  modulation 
)
inlinestatic

Returns the result of modulating the specified colors, by multiplying the corresponding components.

Each of the resulting color components is clamped to be between 0.0 and 1.0.

static ccColor4F CCC4FUniformScale ( ccColor4F  rgba,
GLfloat  scale 
)
inlinestatic

Returns a ccColor4F structure whose values are those of the specified original color, multiplied by the specified scaling factor.

Each of the resulting color components is clamped to be between 0.0 and 1.0.

static ccColor4F CCC4FUniformTranslate ( ccColor4F  rgba,
GLfloat  offset 
)
inlinestatic

Returns a ccColor4F structure whose values are those of the specified original color, where each color component has been translated by the specified offset.

Each of the resulting color components is clamped to be between 0.0 and 1.0.

static GLubyte CCColorByteFromFloat ( GLfloat  colorValue)
inlinestatic

Returns a GLubyte between 0 and 255 converted from the specified GLfloat value.

The specified float value is clamped to between 0 and 1 before conversion, so that the Glubyte does not overflow or underflow, which would create unexpected colors.

static GLfloat CCColorFloatFromByte ( GLubyte  colorValue)
inlinestatic

Returns a GLfloat between 0 and 1 converted from the specified GLubyte value between 0 and 255.

static CGPoint CGPointFromCC3IntPoint ( CC3IntPoint  ipt)
inlinestatic

Returns a CGPoint structure constructed from the specified CC3IntPoint.

static CGRect CGRectFromCC3Viewport ( CC3Viewport  vp)
inlinestatic

Returns a CGRect constructed from the specified viewport.

static CGSize CGSizeFromCC3IntSize ( CC3IntSize  isz)
inlinestatic

Returns a CGSize structure constructed from the specified CC3IntSize.

static GLKQuaternion GLKQuaternionFromCC3Quaternion ( CC3Quaternion  cc3q)
inlinestatic

Returns a GLKQuaternion structure constructed from the specified CC3Quaternion structure.

Although GLKQuaternion has the same internal structure as CC3Quaternion, the structures may have different byte alignment requirements. Avoid casting directly between CC3Quaternion and GLKQuaternion, as this is not guaranteed to work reliably.

static GLKVector3 GLKVector3FromCC3Vector ( CC3Vector  cc3v)
inlinestatic

Returns a GLKVector3 structure constructed from the specified CC3Vector structure.

Although GLKVector3 has the same internal structure as CC3Vector, the structures may have different byte alignment requirements. Avoid casting directly between CC3Vector and GLKVector3, as this is not guaranteed to work reliably.

static GLKVector4 GLKVector4FromCC3Vector4 ( CC3Vector4  cc3v)
inlinestatic

Returns a GLKVector4 structure constructed from the specified CC3Vector4 structure.

Although GLKVector4 has the same internal structure as CC3Vector4, the structures may have different byte alignment requirements. Avoid casting directly between CC3Vector4 and GLKVector4, as this is not guaranteed to work reliably.

static NSString* NSStringFromBoolean ( BOOL  value)
inlinestatic

Returns the string YES or NO, depending on the specified boolean value.

static NSString* NSStringFromCC3AngularVector ( CC3AngularVector  av)
inlinestatic

Returns a string description of the specified CC3AngularVector struct in the form "(heading, inclination, radius)".

static NSString* NSStringFromCC3AttenuationCoefficients ( CC3AttenuationCoefficients  coeffs)
inlinestatic

Returns a string description of the specified CC3AttenuationCoefficients struct in the form "(a, b, c)".

static NSString* NSStringFromCC3BarycentricWeights ( CC3BarycentricWeights  bcw)
inlinestatic

Returns a string description of the specified NSStringFromCC3BarycentricWeights struct.

NSString* NSStringFromCC3BoundingBox ( CC3Box  bb)
Deprecated:
Renamed to NSStringFromCC3Box.
static NSString* NSStringFromCC3Box ( CC3Box  bb)
inlinestatic

Returns a string description of the specified CC3Box struct.

static NSString* NSStringFromCC3Face ( CC3Face  face)
inlinestatic

Returns a string description of the specified CC3Face struct.

static NSString* NSStringFromCC3FaceIndices ( CC3FaceIndices  faceIndices)
inlinestatic

Returns a string description of the specified CC3FaceIndices struct.

static NSString* NSStringFromCC3IntPoint ( CC3IntPoint  v)
inlinestatic

Returns a string description of the specified CC3IntPoint struct in the form "(x, y)".

static NSString* NSStringFromCC3IntSize ( CC3IntSize  size)
inlinestatic

Returns a string description of the specified CC3IntSize struct in the form "(width, height)".

static NSString* NSStringFromCC3IntVector ( CC3IntVector  v)
inlinestatic

Returns a string description of the specified CC3IntVector struct in the form "(x, y, z)".

static NSString* NSStringFromCC3IntVector4 ( CC3IntVector4  v)
inlinestatic

Returns a string description of the specified CC3IntVector4 struct in the form "(x, y, z, w)".

static NSString* NSStringFromCC3Plane ( CC3Plane  p)
inlinestatic

Returns a string description of the specified CC3Plane struct in the form "(a, b, c, d)".

static NSString* NSStringFromCC3Quaternion ( CC3Quaternion  q)
inlinestatic

Returns a string description of the specified CC3Quaternion struct in the form "(x, y, z, w)".

static NSString* NSStringFromCC3Ray ( CC3Ray  aRay)
inlinestatic

Returns a string description of the specified CC3Ray struct.

static NSString* NSStringFromCC3Spere ( CC3Sphere  sphere)
inlinestatic

Returns a string description of the specified sphere.

static NSString* NSStringFromCC3Tessellation ( CC3Tessellation  t)
inlinestatic

Returns a string description of the specified CC3Tessellation struct in the form "(x, y)".

static NSString* NSStringFromCC3TexturedVertex ( CC3TexturedVertex  vertex)
inlinestatic

Returns a string description of the specified textured vertex.

static NSString* NSStringFromCC3Vector ( CC3Vector  v)
inlinestatic

Returns a string description of the specified CC3Vector struct in the form "(x, y, z)".

static NSString* NSStringFromCC3Vector4 ( CC3Vector4  v)
inlinestatic

Returns a string description of the specified CC3Vector4 struct in the form "(x, y, z, w)".

NSString* NSStringFromCC3Vectors ( CC3Vector vectors,
GLuint  vectorCount 
)

Returns a string description of the specified array of CC3Vector structs.

The vectorCount argument indicates the number of vectors in the vectors array argument.

Each vector in the array is output on a separate line in the result.

static NSString* NSStringFromCC3Version ( )
inlinestatic

Returns a string describing the Cocos3D version.

static NSString* NSStringFromCC3Viewport ( CC3Viewport  vp)
inlinestatic

Returns a string description of the specified CC3Viewport struct in the form "(x, y, w, h)".

static NSString* NSStringFromCCC3B ( ccColor3B  rgb)
inlinestatic

Returns a string description of the specified ccColor3B in the form "(r, g, b)".

static NSString* NSStringFromCCC4B ( ccColor4B  rgba)
inlinestatic

Returns a string description of the specified ccColor4B in the form "(r, g, b, a)".

static NSString* NSStringFromCCC4F ( ccColor4F  rgba)
inlinestatic

Returns a string description of the specified ccColor4F in the form "(r, g, b, a)".

static ccColor4F RandomCCC4FBetween ( ccColor4F  min,
ccColor4F  max 
)
inlinestatic

Returns a random ccColor4F where each component value between the specified min inclusive and the specified max exclusive.

This can be useful when creating particle systems.

Variable Documentation

const CC3AttenuationCoefficients kCC3AttenuationNone = {1.0, 0.0, 0.0}
static

Attenuation coefficients corresponding to no attenuation with distance (constant size).

const CC3Box kCC3BoxNull = { {INFINITY, INFINITY, INFINITY}, {INFINITY, INFINITY, INFINITY} }
static

The null bounding box.

It cannot be drawn, but is useful for marking an uninitialized bounding box.

const CC3Box kCC3BoxZero = { {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }
static

A CC3Box of zero origin and dimensions.

const CC3FaceIndices kCC3FaceIndicesZero = { {0, 0, 0} }
static

A CC3FaceIndices with all vertices set to zero.

const CC3Face kCC3FaceZero = { { { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } } }
static

A CC3Face with all vertices set to zero.

const CC3IntPoint kCC3IntPointZero = { 0, 0 }
static

A CC3IntPoint at the origin.

const CC3IntSize kCC3IntSizeZero = { 0, 0 }
static

A CC3IntSize of zero extent.

const CC3Plane kCC3PlaneZero = { 0, 0, 0, 0 }
static

An undefined plane.

const CC3Quaternion kCC3QuaternionIdentity = { { {0.0, 0.0, 0.0} }, 1.0 }
static

A CC3Quaternion that represents the identity quaternion.

const CC3Vector4 kCC3QuaternionNull = { { {INFINITY, INFINITY, INFINITY} }, INFINITY}
static

The null CC3Quaternion.

Useful for marking an uninitialized quaternion.

const CC3Quaternion kCC3QuaternionZero = { { {0.0, 0.0, 0.0} }, 0.0 }
static

A CC3Vector4 of zero length at the origin.

GLfloat kCC3ScaleMin = 1.0e-9f
static

Minimum acceptable absolute value for a scale transformation component.

This is used to ensure that scales used in transforms do not cause uninvertable matrices.

The initial value is 1.0e-9f. Set this to another value if appropriate.

const CC3Vector4 kCC3Vector4Null = { { {INFINITY, INFINITY, INFINITY} }, INFINITY}
static

The null CC3Vector4.

It cannot be drawn, but is useful for marking an uninitialized vector.

const CC3Vector4 kCC3Vector4Zero = { { {0.0, 0.0, 0.0} }, 0.0 }
static

A CC3Vector4 of zero length at the origin.

const CC3Vector4 kCC3Vector4ZeroLocation = { { {0.0, 0.0, 0.0} }, 1.0 }
static

A CC3Vector4 location at the origin.

As a definite location, the W component is 1.0.

const CC3Vector kCC3VectorNull = {INFINITY, INFINITY, INFINITY}
static

The null CC3Vector.

It cannot be drawn, but is useful for marking an uninitialized vector.

const CC3Vector kCC3VectorUnitCube = { 1.0, 1.0, 1.0 }
static

A CC3Vector with each component equal to one, representing the diagonal of a unit cube.

const GLfloat kCC3VectorUnitCubeLength = kCC3Sqrt3
static

The diagonal length of a unit cube.

const CC3Vector kCC3VectorUnitXNegative = {-1.0, 0.0, 0.0 }
static

Unit vector pointing in the same direction as the negative X-axis.

const CC3Vector kCC3VectorUnitXPositive = { 1.0, 0.0, 0.0 }
static

Unit vector pointing in the same direction as the positive X-axis.

const CC3Vector kCC3VectorUnitYNegative = { 0.0, -1.0, 0.0 }
static

Unit vector pointing in the same direction as the negative Y-axis.

const CC3Vector kCC3VectorUnitYPositive = { 0.0, 1.0, 0.0 }
static

Unit vector pointing in the same direction as the positive Y-axis.

const CC3Vector kCC3VectorUnitZNegative = { 0.0, 0.0, -1.0 }
static

Unit vector pointing in the same direction as the negative Z-axis.

const CC3Vector kCC3VectorUnitZPositive = { 0.0, 0.0, 1.0 }
static

Unit vector pointing in the same direction as the positive Z-axis.

const CC3Vector kCC3VectorZero = { 0.0, 0.0, 0.0 }
static

A CC3Vector of zero length at the origin.

const CC3Viewport kCC3ViewportZero = { {0, 0, 0, 0} }
static

An empty or undefined viewport.

const ccColor4F kCCC4FBlack = { 0.0, 0.0, 0.0, 1.0 }
static

Opaque Black.

const ccColor4F kCCC4FBlackTransparent = {0.0, 0.0, 0.0, 0.0}
static

Transparent Black.

const ccColor4F kCCC4FBlue = { 0.0, 0.0, 1.0, 1.0 }
static

Opaque Blue.

const ccColor4F kCCC4FCyan = { 0.0, 1.0, 1.0, 1.0 }
static

Opaque Cyan.

const ccColor4F kCCC4FDarkGray = { 0.25, 0.25, 0.25, 1.0 }
static

Opaque Dark Gray.

const ccColor4F kCCC4FGray = { 0.5, 0.5, 0.5, 1.0 }
static

Opaque Gray.

const ccColor4F kCCC4FGreen = { 0.0, 1.0, 0.0, 1.0 }
static

Opaque Green.

const ccColor4F kCCC4FLightGray = { 0.75, 0.75, 0.75, 1.0 }
static

Opaque Light Gray.

const ccColor4F kCCC4FMagenta = { 1.0, 0.0, 1.0, 1.0 }
static

Opaque Magenta.

const ccColor4F kCCC4FOrange = { 1.0, 0.5, 0.0, 1.0 }
static

Opaque Orange.

const ccColor4F kCCC4FRed = { 1.0, 0.0, 0.0, 1.0 }
static

Opaque Red.

const ccColor4F kCCC4FWhite = { 1.0, 1.0, 1.0, 1.0 }
static

Opaque White.

const ccColor4F kCCC4FYellow = { 1.0, 1.0, 0.0, 1.0 }
static

Opaque Yellow.