Interim code. Integrating cocos2d.
authorchsieh <chester.developer@hotmail.com>
Thu, 23 Dec 2010 19:10:02 +0000 (11:10 -0800)
committerchsieh <chester.developer@hotmail.com>
Thu, 23 Dec 2010 19:10:02 +0000 (11:10 -0800)
176 files changed:
Classes/Foundation/Common/GlobalDefines.h
Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.h [new file with mode: 0644]
Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.mm [new file with mode: 0644]
Classes/Foundation/GraphicsServices/OpenGLServices.h
Classes/Foundation/GraphicsServices/OpenGLServices.mm
Classes/Foundation/Math/MathTypes.h
Classes/Foundation/Math/Matrix.h
Classes/Foundation/Math/Quaternion.h
Classes/Foundation/Math/Vector.h
Classes/cocos2d/CCAction.h [new file with mode: 0644]
Classes/cocos2d/CCAction.m [new file with mode: 0644]
Classes/cocos2d/CCActionCamera.h [new file with mode: 0644]
Classes/cocos2d/CCActionCamera.m [new file with mode: 0644]
Classes/cocos2d/CCActionEase.h [new file with mode: 0644]
Classes/cocos2d/CCActionEase.m [new file with mode: 0644]
Classes/cocos2d/CCActionGrid.h [new file with mode: 0644]
Classes/cocos2d/CCActionGrid.m [new file with mode: 0644]
Classes/cocos2d/CCActionGrid3D.h [new file with mode: 0644]
Classes/cocos2d/CCActionGrid3D.m [new file with mode: 0644]
Classes/cocos2d/CCActionInstant.h [new file with mode: 0644]
Classes/cocos2d/CCActionInstant.m [new file with mode: 0644]
Classes/cocos2d/CCActionInterval.h [new file with mode: 0644]
Classes/cocos2d/CCActionInterval.m [new file with mode: 0644]
Classes/cocos2d/CCActionManager.h [new file with mode: 0644]
Classes/cocos2d/CCActionManager.m [new file with mode: 0644]
Classes/cocos2d/CCActionPageTurn3D.h [new file with mode: 0644]
Classes/cocos2d/CCActionPageTurn3D.m [new file with mode: 0644]
Classes/cocos2d/CCActionProgressTimer.h [new file with mode: 0644]
Classes/cocos2d/CCActionProgressTimer.m [new file with mode: 0644]
Classes/cocos2d/CCActionTiledGrid.h [new file with mode: 0644]
Classes/cocos2d/CCActionTiledGrid.m [new file with mode: 0644]
Classes/cocos2d/CCActionTween.h [new file with mode: 0644]
Classes/cocos2d/CCActionTween.m [new file with mode: 0644]
Classes/cocos2d/CCAnimation.h [new file with mode: 0644]
Classes/cocos2d/CCAnimation.m [new file with mode: 0644]
Classes/cocos2d/CCAnimationCache.h [new file with mode: 0644]
Classes/cocos2d/CCAnimationCache.m [new file with mode: 0644]
Classes/cocos2d/CCAtlasNode.h [new file with mode: 0644]
Classes/cocos2d/CCAtlasNode.m [new file with mode: 0644]
Classes/cocos2d/CCBlockSupport.h [new file with mode: 0644]
Classes/cocos2d/CCBlockSupport.m [new file with mode: 0644]
Classes/cocos2d/CCCamera.h [new file with mode: 0644]
Classes/cocos2d/CCCamera.m [new file with mode: 0644]
Classes/cocos2d/CCCompatibility.h [new file with mode: 0644]
Classes/cocos2d/CCCompatibility.m [new file with mode: 0644]
Classes/cocos2d/CCConfiguration.h [new file with mode: 0644]
Classes/cocos2d/CCConfiguration.m [new file with mode: 0644]
Classes/cocos2d/CCDirector.h [new file with mode: 0644]
Classes/cocos2d/CCDirector.m [new file with mode: 0644]
Classes/cocos2d/CCDrawingPrimitives.h [new file with mode: 0644]
Classes/cocos2d/CCDrawingPrimitives.m [new file with mode: 0644]
Classes/cocos2d/CCGrabber.h [new file with mode: 0644]
Classes/cocos2d/CCGrabber.m [new file with mode: 0644]
Classes/cocos2d/CCGrid.h [new file with mode: 0644]
Classes/cocos2d/CCGrid.m [new file with mode: 0644]
Classes/cocos2d/CCLabelAtlas.h [new file with mode: 0644]
Classes/cocos2d/CCLabelAtlas.m [new file with mode: 0644]
Classes/cocos2d/CCLabelBMFont.h [new file with mode: 0644]
Classes/cocos2d/CCLabelBMFont.m [new file with mode: 0644]
Classes/cocos2d/CCLabelTTF.h [new file with mode: 0644]
Classes/cocos2d/CCLabelTTF.m [new file with mode: 0644]
Classes/cocos2d/CCLayer.h [new file with mode: 0644]
Classes/cocos2d/CCLayer.m [new file with mode: 0644]
Classes/cocos2d/CCMenu.h [new file with mode: 0644]
Classes/cocos2d/CCMenu.m [new file with mode: 0644]
Classes/cocos2d/CCMenuItem.h [new file with mode: 0644]
Classes/cocos2d/CCMenuItem.m [new file with mode: 0644]
Classes/cocos2d/CCMotionStreak.h [new file with mode: 0644]
Classes/cocos2d/CCMotionStreak.m [new file with mode: 0644]
Classes/cocos2d/CCNode.h [new file with mode: 0644]
Classes/cocos2d/CCNode.m [new file with mode: 0644]
Classes/cocos2d/CCParallaxNode.h [new file with mode: 0644]
Classes/cocos2d/CCParallaxNode.m [new file with mode: 0644]
Classes/cocos2d/CCParticleExamples.h [new file with mode: 0644]
Classes/cocos2d/CCParticleExamples.m [new file with mode: 0644]
Classes/cocos2d/CCParticleSystem.h [new file with mode: 0644]
Classes/cocos2d/CCParticleSystem.m [new file with mode: 0644]
Classes/cocos2d/CCParticleSystemPoint.h [new file with mode: 0644]
Classes/cocos2d/CCParticleSystemPoint.m [new file with mode: 0644]
Classes/cocos2d/CCParticleSystemQuad.h [new file with mode: 0644]
Classes/cocos2d/CCParticleSystemQuad.m [new file with mode: 0644]
Classes/cocos2d/CCProgressTimer.h [new file with mode: 0644]
Classes/cocos2d/CCProgressTimer.m [new file with mode: 0644]
Classes/cocos2d/CCProtocols.h [new file with mode: 0644]
Classes/cocos2d/CCRenderTexture.h [new file with mode: 0755]
Classes/cocos2d/CCRenderTexture.m [new file with mode: 0755]
Classes/cocos2d/CCRibbon.h [new file with mode: 0644]
Classes/cocos2d/CCRibbon.m [new file with mode: 0644]
Classes/cocos2d/CCScene.h [new file with mode: 0644]
Classes/cocos2d/CCScene.m [new file with mode: 0644]
Classes/cocos2d/CCScheduler.h [new file with mode: 0644]
Classes/cocos2d/CCScheduler.m [new file with mode: 0644]
Classes/cocos2d/CCSprite.h [new file with mode: 0644]
Classes/cocos2d/CCSprite.m [new file with mode: 0644]
Classes/cocos2d/CCSpriteBatchNode.h [new file with mode: 0644]
Classes/cocos2d/CCSpriteBatchNode.m [new file with mode: 0644]
Classes/cocos2d/CCSpriteFrame.h [new file with mode: 0644]
Classes/cocos2d/CCSpriteFrame.m [new file with mode: 0644]
Classes/cocos2d/CCSpriteFrameCache.h [new file with mode: 0644]
Classes/cocos2d/CCSpriteFrameCache.m [new file with mode: 0644]
Classes/cocos2d/CCSpriteSheet.h [new file with mode: 0644]
Classes/cocos2d/CCSpriteSheet.m [new file with mode: 0644]
Classes/cocos2d/CCTMXLayer.h [new file with mode: 0644]
Classes/cocos2d/CCTMXLayer.m [new file with mode: 0644]
Classes/cocos2d/CCTMXObjectGroup.h [new file with mode: 0644]
Classes/cocos2d/CCTMXObjectGroup.m [new file with mode: 0644]
Classes/cocos2d/CCTMXTiledMap.h [new file with mode: 0644]
Classes/cocos2d/CCTMXTiledMap.m [new file with mode: 0644]
Classes/cocos2d/CCTMXXMLParser.h [new file with mode: 0644]
Classes/cocos2d/CCTMXXMLParser.m [new file with mode: 0644]
Classes/cocos2d/CCTexture2D.h [new file with mode: 0644]
Classes/cocos2d/CCTexture2D.m [new file with mode: 0644]
Classes/cocos2d/CCTextureAtlas.h [new file with mode: 0644]
Classes/cocos2d/CCTextureAtlas.m [new file with mode: 0644]
Classes/cocos2d/CCTextureCache.h [new file with mode: 0644]
Classes/cocos2d/CCTextureCache.m [new file with mode: 0644]
Classes/cocos2d/CCTexturePVR.h [new file with mode: 0644]
Classes/cocos2d/CCTexturePVR.m [new file with mode: 0644]
Classes/cocos2d/CCTileMapAtlas.h [new file with mode: 0644]
Classes/cocos2d/CCTileMapAtlas.m [new file with mode: 0644]
Classes/cocos2d/CCTransition.h [new file with mode: 0644]
Classes/cocos2d/CCTransition.m [new file with mode: 0644]
Classes/cocos2d/CCTransitionPageTurn.h [new file with mode: 0644]
Classes/cocos2d/CCTransitionPageTurn.m [new file with mode: 0644]
Classes/cocos2d/CCTransitionRadial.h [new file with mode: 0644]
Classes/cocos2d/CCTransitionRadial.m [new file with mode: 0644]
Classes/cocos2d/Platforms/CCGL.h [new file with mode: 0644]
Classes/cocos2d/Platforms/CCNS.h [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/CCDirectorMac.h [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/CCDirectorMac.m [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/CCEventDispatcher.h [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/CCEventDispatcher.m [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/MacGLView.h [new file with mode: 0644]
Classes/cocos2d/Platforms/Mac/MacGLView.m [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/CCDirectorIOS.h [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/CCDirectorIOS.m [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/CCTouchDelegateProtocol.h [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/CCTouchDispatcher.h [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/CCTouchDispatcher.m [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/CCTouchHandler.h [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/CCTouchHandler.m [new file with mode: 0644]
Classes/cocos2d/Platforms/iOS/EAGLView.h [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/EAGLView.m [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/ES1Renderer.h [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/ES1Renderer.m [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/ESRenderer.h [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/glu.c [new file with mode: 0755]
Classes/cocos2d/Platforms/iOS/glu.h [new file with mode: 0644]
Classes/cocos2d/Support/CCArray.h [new file with mode: 0644]
Classes/cocos2d/Support/CCArray.m [new file with mode: 0644]
Classes/cocos2d/Support/CCFileUtils.h [new file with mode: 0644]
Classes/cocos2d/Support/CCFileUtils.m [new file with mode: 0644]
Classes/cocos2d/Support/CCProfiling.h [new file with mode: 0644]
Classes/cocos2d/Support/CCProfiling.m [new file with mode: 0644]
Classes/cocos2d/Support/CGPointExtension.h [new file with mode: 0644]
Classes/cocos2d/Support/CGPointExtension.m [new file with mode: 0644]
Classes/cocos2d/Support/OpenGL_Internal.h [new file with mode: 0644]
Classes/cocos2d/Support/TGAlib.h [new file with mode: 0644]
Classes/cocos2d/Support/TGAlib.m [new file with mode: 0644]
Classes/cocos2d/Support/TransformUtils.h [new file with mode: 0644]
Classes/cocos2d/Support/TransformUtils.m [new file with mode: 0644]
Classes/cocos2d/Support/ZipUtils.h [new file with mode: 0644]
Classes/cocos2d/Support/ZipUtils.m [new file with mode: 0644]
Classes/cocos2d/Support/base64.c [new file with mode: 0644]
Classes/cocos2d/Support/base64.h [new file with mode: 0644]
Classes/cocos2d/Support/ccCArray.h [new file with mode: 0644]
Classes/cocos2d/Support/ccUtils.c [new file with mode: 0644]
Classes/cocos2d/Support/ccUtils.h [new file with mode: 0644]
Classes/cocos2d/Support/uthash.h [new file with mode: 0644]
Classes/cocos2d/Support/utlist.h [new file with mode: 0644]
Classes/cocos2d/ccConfig.h [new file with mode: 0644]
Classes/cocos2d/ccMacros.h [new file with mode: 0644]
Classes/cocos2d/ccTypes.h [new file with mode: 0644]
Classes/cocos2d/cocos2d.h [new file with mode: 0644]
Classes/cocos2d/cocos2d.m [new file with mode: 0644]
Littlest.xcodeproj/project.pbxproj

index 7dde617..14712b2 100755 (executable)
@@ -70,9 +70,9 @@
 //----------------------------------------------------------------------------------------\r
 // alignment macros\r
 #if defined(__WINDOWS__)\r
-#define ALIGN(N)                  __declspec(align(N))\r
+#define MEM_ALIGN(N)              __declspec(align(N))\r
 #elif defined(__iOS__)\r
-#define ALIGN(N)                  __attribute__((aligned (N)))\r
+#define MEM_ALIGN(N)              __attribute__((aligned (N)))\r
 #endif\r
 \r
 #define IS_POWER_OF_TWO(x)        ( ((x) & -(x)) == (x) )\r
diff --git a/Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.h b/Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.h
new file mode 100644 (file)
index 0000000..ba50ba9
--- /dev/null
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Foundation/Common/GlobalInclude.h"
+#include "Foundation/Math/MathInclude.h"
+
+//#include <OpenGLES/ES1/gl.h>
+#include <OpenGLES/ES2/gl.h>
+
+//----------------------------------------------------------------------------------------
+struct Basic2DPrimitive
+{
+protected:
+  Basic2DPrimitive(); // Only the children classes can call this.
+  ~Basic2DPrimitive();
+
+  GLuint    mVertexBuffer;
+  uint16_t  mX, mY;
+};
+
+//----------------------------------------------------------------------------------------
+struct Rectangle : public Basic2DPrimitive
+{
+public:
+  GLuint    mWidth, mHeight;
+  
+  Rectangle( uint16_t width, uint16_t height, uint16_t anchorX, uint16_t anchorY );
+};
diff --git a/Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.mm b/Classes/Foundation/GraphicsServices/Geometry/BasicPrimitives.mm
new file mode 100644 (file)
index 0000000..4cc9da1
--- /dev/null
@@ -0,0 +1,26 @@
+#include "BasicPrimitives.h"
+
+//----------------------------------------------------------------------------------------
+Basic2DPrimitive::Basic2DPrimitive() : mVertexBuffer(0), mX(0), mY(0)
+{
+  glGenBuffers( 1, &mVertexBuffer );
+}
+
+//----------------------------------------------------------------------------------------
+Basic2DPrimitive::~Basic2DPrimitive()
+{
+  glDeleteBuffers( 1, &mVertexBuffer );
+}
+
+//----------------------------------------------------------------------------------------
+Rectangle::Rectangle( uint16_t width, uint16_t height, uint16_t anchorX, uint16_t anchorY ) : Basic2DPrimitive()
+{
+  Assert( mVertexBuffer );
+  glBindBuffer( GL_ARRAY_BUFFER, mVertexBuffer );
+  
+  mWidth = width;
+  mHeight = height;
+
+  uint16_t values[4 * 2] = {-anchorX, height + anchorY, -anchorX, };
+  glBufferData( GL_ARRAY_BUFFER, 4 * 2 * sizeof(uint16_t), values, GL_STATIC_DRAW );
+}
index 819ba12..deadd57 100644 (file)
@@ -10,8 +10,8 @@
  *  we should never need to set context other than during startup or shutdown.
  *****************************************************************************************/
 
-#include <OpenGLES/ES1/gl.h>
-#include <OpenGLES/ES1/glext.h>
+//#include <OpenGLES/ES1/gl.h>
+//#include <OpenGLES/ES1/glext.h>
 #include <OpenGLES/ES2/gl.h>
 #include <OpenGLES/ES2/glext.h>
 
index 236059e..9c1f7a2 100644 (file)
@@ -22,16 +22,21 @@ bool OpenGLServices::init( EAGLContext* mainContext )
   
   initScratchMem();
   
-  // Enable some common states.
+  // Enable some common states and set their parameters.
   glEnable( GL_TEXTURE_2D );
-
   glEnable( GL_BLEND );
-
   // We will premultiply alpha into the color channels of all textures (so no alpha animation).
   // This is basically the A over B alpha scheme.
   glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
-
   glEnable( GL_DEPTH_TEST );
+  glDepthFunc( GL_LEQUAL );
+  glFrontFace( GL_CCW );
+  glCullFace( GL_BACK );
+
+  // Disable unused stuff.
+  glDisable( GL_STENCIL_TEST );
+  glDisable( GL_SCISSOR_TEST );
+  glDisable( GL_DITHER );
   
   return true;
 }
index c16a44e..379bf16 100755 (executable)
@@ -4,16 +4,16 @@
 #include "Foundation/Math/MathOperations.h"\r
 \r
 //----------------------------------------------------------------------------------------\r
-struct Vector2\r
+struct Vec2\r
 {\r
   float x;\r
   float y;\r
 \r
-  slInline explicit Vector2() {}\r
-  slInline explicit Vector2(const float xy) {x = xy; y = xy;}\r
-  slInline explicit Vector2(const float ix, const float iy) {x = ix; y = iy;}\r
+  slInline explicit Vec2() {}\r
+  slInline explicit Vec2(const float xy) {x = xy; y = xy;}\r
+  slInline explicit Vec2(const float ix, const float iy) {x = ix; y = iy;}\r
 \r
-  slInline Vector2(const Vector2& v) {x = v.x; y = v.y;} // copy constructor\r
+  slInline Vec2(const Vec2& v) {x = v.x; y = v.y;} // copy constructor\r
 \r
   slInline float* AsFloatArray() {return &x;}\r
   slInline const float* AsFloatArray() const {return &x;}\r
@@ -23,21 +23,21 @@ struct Vector2
 \r
 \r
 //----------------------------------------------------------------------------------------\r
-struct Vector3\r
+struct Vec3\r
 {\r
   float x;\r
   float y;\r
   float z;\r
 \r
-  slInline explicit Vector3() {}\r
-  slInline explicit Vector3(const float xyz) {x = xyz; y = xyz; z = xyz;}\r
-  slInline explicit Vector3(const float ix, const float iy, const float iz) {x = ix; y = iy; z = iz;}\r
+  slInline explicit Vec3() {}\r
+  slInline explicit Vec3(const float xyz) {x = xyz; y = xyz; z = xyz;}\r
+  slInline explicit Vec3(const float ix, const float iy, const float iz) {x = ix; y = iy; z = iz;}\r
 \r
-  slInline explicit Vector3(const Vector2& v, const float iz) {x = v.x; y = v.y; z = iz;}\r
+  slInline explicit Vec3(const Vec2& v, const float iz) {x = v.x; y = v.y; z = iz;}\r
 \r
-  slInline Vector3(const Vector3& v) {x = v.x; y = v.y; z = v.z;} // copy constructor\r
+  slInline Vec3(const Vec3& v) {x = v.x; y = v.y; z = v.z;} // copy constructor\r
 \r
-  slInline Vector2 AsVector2() const {return Vector2(x, y);}\r
+  slInline Vec2 AsVec2() const {return Vec2(x, y);}\r
 \r
   slInline float* AsFloatArray() {return &x;}\r
   slInline const float* AsFloatArray() const {return &x;}\r
@@ -47,27 +47,27 @@ struct Vector3
 \r
 \r
 //----------------------------------------------------------------------------------------\r
-struct Vector4\r
+struct Vec4\r
 {\r
   float x;\r
   float y;\r
   float z;\r
   float w;\r
 \r
-  slInline explicit Vector4() {}\r
-  slInline explicit Vector4(const float xyzw) {x = xyzw; y = xyzw; z = xyzw; w = xyzw;}\r
-  slInline explicit Vector4(const float xyz, const float iw) {x = xyz; y = xyz; z = xyz; w = iw;}\r
-  slInline explicit Vector4(const float ix, const float iy, const float iz, const float iw) {x = ix; y = iy; z = iz; w = iw;}\r
+  slInline explicit Vec4() {}\r
+  slInline explicit Vec4(const float xyzw) {x = xyzw; y = xyzw; z = xyzw; w = xyzw;}\r
+  slInline explicit Vec4(const float xyz, const float iw) {x = xyz; y = xyz; z = xyz; w = iw;}\r
+  slInline explicit Vec4(const float ix, const float iy, const float iz, const float iw) {x = ix; y = iy; z = iz; w = iw;}\r
 \r
-  slInline explicit Vector4(const Vector2& u, const Vector2& v) {x = u.x; y = u.y; z = v.x; w = v.y;}\r
-  slInline explicit Vector4(const Vector2& v, const float iz, const float iw) {x = v.x; y = v.y; z = iz; w = iw;}\r
+  slInline explicit Vec4(const Vec2& u, const Vec2& v) {x = u.x; y = u.y; z = v.x; w = v.y;}\r
+  slInline explicit Vec4(const Vec2& v, const float iz, const float iw) {x = v.x; y = v.y; z = iz; w = iw;}\r
 \r
-  slInline explicit Vector4(const Vector3& v, const float iw) {x = v.x; y = v.y; z = v.z; w = iw;}\r
+  slInline explicit Vec4(const Vec3& v, const float iw) {x = v.x; y = v.y; z = v.z; w = iw;}\r
 \r
-  slInline Vector4(const Vector4& v) {x = v.x; y = v.y; z = v.z; w = v.w;} // copy constructor\r
+  slInline Vec4(const Vec4& v) {x = v.x; y = v.y; z = v.z; w = v.w;} // copy constructor\r
 \r
-  slInline Vector2 AsVector2() const {return Vector2(x, y);}\r
-  slInline Vector3 AsVector3() const {return Vector3(x, y, z);}\r
+  slInline Vec2 AsVec2() const {return Vec2(x, y);}\r
+  slInline Vec3 AsVec3() const {return Vec3(x, y, z);}\r
 \r
   slInline float* AsFloatArray() {return &x;}\r
   slInline const float* AsFloatArray() const {return &x;}\r
@@ -85,43 +85,43 @@ struct Quaternion
   float s;\r
 \r
   slInline explicit Quaternion() {}\r
-  explicit Quaternion(const float angle, const Vector3& normalized_axis);\r
+  explicit Quaternion(const float angle, const Vec3& normalized_axis);\r
   explicit Quaternion(const float angle, const float x, const float y, const float z);\r
 \r
   slInline Quaternion(const Quaternion& q) {i = q.i; j = q.j; k = q.k; s = q.s;}\r
 \r
-  Vector4 AsVector4();\r
+  Vec4 AsVec4();\r
   slInline float* AsFloatArray() {return &i;}\r
 \r
-  Vector3 GetImaginary();\r
+  Vec3 GetImaginary();\r
   slInline float GetReal() {return s;}\r
 };\r
 \r
-slInline Quaternion::Quaternion(const float angle, const Vector3& normalized_axis)\r
+slInline Quaternion::Quaternion(const float angle, const Vec3& normalized_axis)\r
 {\r
-  Assert( EpsilonEquals(LengthVector3(normalized_axis), 1.0f, kEpsilon) );\r
+  Assert( EpsilonEquals(normalized_axis.x * normalized_axis.x + normalized_axis.y * normalized_axis.y + normalized_axis.z * normalized_axis.z, 1.0f, kSqrtEpsilon) );\r
   float half_angle = angle * 0.5f;\r
-  float sin_half_angle = Sinf(half_angle);\r
+  float sin_half_angle = (float)Sinf(half_angle);\r
   i = normalized_axis.x * sin_half_angle;\r
   j = normalized_axis.y * sin_half_angle;\r
   k = normalized_axis.z * sin_half_angle;\r
-  s = Cosf(half_angle);\r
+  s = (float)Cosf(half_angle);\r
 }\r
 \r
 slInline Quaternion::Quaternion(const float angle, const float x, const float y, const float z)\r
 {\r
   Assert( EpsilonEquals(x * x + y * y + z * z, 1.0f, kSqrtEpsilon) );\r
   float half_angle = angle * 0.5f;\r
-  float sin_half_angle = Sinf(half_angle);\r
+  float sin_half_angle = (float)Sinf(half_angle);\r
   i = x * sin_half_angle;\r
   j = y * sin_half_angle;\r
   k = z * sin_half_angle;\r
-  s = Cosf(half_angle);\r
+  s = (float)Cosf(half_angle);\r
 }\r
 \r
-Vector4 Quaternion::AsVector4()\r
+Vec4 Quaternion::AsVec4()\r
 {\r
-  Vector4 r;\r
+  Vec4 r;\r
   r.x = i;\r
   r.y = j;\r
   r.z = k;\r
@@ -129,9 +129,9 @@ Vector4 Quaternion::AsVector4()
   return r;\r
 }\r
 \r
-Vector3 Quaternion::GetImaginary()\r
+Vec3 Quaternion::GetImaginary()\r
 {\r
-  Vector3 r;\r
+  Vec3 r;\r
   r.x = i;\r
   r.y = j;\r
   r.z = k;\r
@@ -140,35 +140,35 @@ Vector3 Quaternion::GetImaginary()
 \r
 \r
 //----------------------------------------------------------------------------------------\r
-struct Matrix3\r
+struct Mat3\r
 {\r
-  Vector3 v[3];\r
+  Vec3 v[3];\r
 \r
-  slInline explicit Matrix3() {}\r
-  explicit Matrix3(const Vector3& v0, const Vector3& v1, const Vector3& v2);\r
-  explicit Matrix3(const float v00, const float v01, const float v02,\r
-                   const float v10, const float v11, const float v12,\r
-                   const float v20, const float v21, const float v22);\r
-  Matrix3(Matrix3& m); // copy constructor\r
+  slInline explicit Mat3() {}\r
+  explicit Mat3(const Vec3& v0, const Vec3& v1, const Vec3& v2);\r
+  explicit Mat3(const float v00, const float v01, const float v02,\r
+                const float v10, const float v11, const float v12,\r
+                const float v20, const float v21, const float v22);\r
+  Mat3(const Mat3& m); // copy constructor\r
 \r
   float* AsFloatArray() {return &v[0].x;}\r
 };\r
 \r
-slInline Matrix3::Matrix3(const Vector3& v0, const Vector3& v1, const Vector3& v2)\r
+slInline Mat3::Mat3(const Vec3& v0, const Vec3& v1, const Vec3& v2)\r
 {\r
   v[0] = v0;\r
   v[1] = v1;\r
   v[2] = v2;\r
 }\r
 \r
-slInline Matrix3::Matrix3(const float v00, const float v01, const float v02, const float v10, const float v11, const float v12, const float v20, const float v21, const float v22)\r
+slInline Mat3::Mat3(const float v00, const float v01, const float v02, const float v10, const float v11, const float v12, const float v20, const float v21, const float v22)\r
 {\r
   v[0].x = v00; v[0].y = v01; v[0].z = v02;\r
   v[1].x = v10; v[1].y = v11; v[1].z = v12;\r
   v[2].x = v20; v[2].y = v21; v[2].z = v22;\r
 }\r
 \r
-slInline Matrix3::Matrix3(Matrix3& m)\r
+slInline Mat3::Mat3(const Mat3& m)\r
 {\r
   v[0] = m.v[0];\r
   v[1] = m.v[1];\r
@@ -177,23 +177,23 @@ slInline Matrix3::Matrix3(Matrix3& m)
 \r
 \r
 //----------------------------------------------------------------------------------------\r
-struc