Permalink
Browse files

Merge pull request #2424 from srahim/timob-9344

[TIMOB-9344] iOS:Moving 3DMatrix to common namespace
  • Loading branch information...
2 parents d1f7d65 + 26ddc74 commit 79c919a05c585a8e06595bcdd30f7b4a4d7c3b5f @vishalduggal vishalduggal committed Jun 19, 2012
@@ -1,9 +1,8 @@
---
name: Titanium.UI.3DMatrix
-summary: Use <Titanium.UI.iOS.3DMatrix> instead.
+summary: The 3D Matrix is an object for holding values for an affine transformation matrix.
description: |
- The 3D Matrix is an object for holding values for an affine transformation matrix.
-
+
The 3DMatrix is created by <Titanium.UI.create3DMatrix>. A 3D matrix is
used to rotate, scale, translate, or skew the objects in a three-dimensional
space. A 3D matrix is represented by a 4 by 4 matrix.
@@ -13,11 +12,11 @@ description: |
extends: Titanium.Proxy
since: "0.9"
platforms: [iphone, ipad]
-deprecated:
- since: 1.8.0
+
methods:
- name: invert
- summary: Returns a matrix constructed by inverting an existing matrix
+ summary: Returns a matrix constructed by inverting an existing matrix.
+
- name: multiply
summary: Returns a matrix constructed by combining two existing matrix.
returns:
@@ -26,6 +25,7 @@ methods:
- name: t2
summary: The second matrix. This matrix is concatenated to the matrix instance against which the function is invoked. The result of this function is the first matrix multiplied by the second matrix. You might perform several multiplications in order to create a single matrix that contains the cumulative effects of several transformations. Note that matrix operations are not commutative - the order in which you concatenate matrices is important. That is, the result of multiplying matrix t1 by matrix t2 does not necessarily equal the result of multiplying matrix t2 by matrix t1.
type: Titanium.UI.3DMatrix
+
- name: rotate
summary: Returns a matrix constructed by rotating an existing matrix
returns:
@@ -43,10 +43,12 @@ methods:
- name: z
summary: The z part of the vector about which to rotate
type: Number
+
- name: scale
summary: Returns a matrix constructed by scaling an existing matrix
returns:
type: Titanium.UI.3DMatrix
+
parameters:
- name: sx
summary: The value by which to scale x values of the matrix
@@ -57,6 +59,7 @@ methods:
- name: sz
summary: The value by which to scale z values of the matrix
type: Number
+
- name: translate
summary: Returns a matrix constructed by translating an existing matrix
returns:
@@ -71,52 +74,68 @@ methods:
- name: tz
summary: The value by which to move z values with the matrix
type: Number
+
properties:
- name: m11
summary: The entry at position [1,1] in the matrix.
type: Number
+
- name: m12
summary: The entry at position [1,2] in the matrix.
type: Number
+
- name: m13
summary: The entry at position [1,3] in the matrix.
type: Number
+
- name: m14
summary: The entry at position [1,4] in the matrix.
type: Number
+
- name: m21
summary: The entry at position [2,1] in the matrix.
type: Number
+
- name: m22
summary: The entry at position [2,2] in the matrix.
type: Number
+
- name: m23
summary: The entry at position [2,3] in the matrix.
type: Number
+
- name: m24
summary: The entry at position [2,4] in the matrix.
type: Number
+
- name: m31
summary: The entry at position [3,1] in the matrix.
type: Number
+
- name: m32
summary: The entry at position [3,2] in the matrix.
type: Number
+
- name: m33
summary: The entry at position [3,3] in the matrix.
type: Number
+
- name: m34
summary: The entry at position [3,4] in the matrix.
type: Number
+
- name: m41
summary: The entry at position [4,1] in the matrix.
type: Number
+
- name: m42
summary: The entry at position [4,2] in the matrix.
type: Number
+
- name: m43
summary: The entry at position [4,3] in the matrix.
type: Number
+
- name: m44
summary: The entry at position [4,4] in the matrix.
type: Number
@@ -1,8 +1,10 @@
---
name: Titanium.UI.iOS.3DMatrix
-summary: The 3D Matrix is an object for holding values for an affine transformation matrix.
+summary: Use <Titanium.UI.3DMatrix> instead.
description: |
- The 3DMatrix is created by the <Titanium.UI.iOS.create3DMatrix> method.
+ The 3D Matrix is an object for holding values for an affine transformation matrix.
+
+ The 3DMatrix is created by the <Titanium.UI.create3DMatrix> method.
A 3D matrix, represented by a 4 by 4 matrix, is used to rotate, scale, translate, or skew
objects in a three-dimensional space.
@@ -11,15 +13,17 @@ description: |
extends: Titanium.Proxy
since: "0.9"
platforms: [iphone, ipad]
-
+deprecated:
+ since: 2.1.0
+
methods:
- name: invert
summary: Returns a matrix constructed by inverting an existing matrix.
- name: multiply
summary: Returns a matrix constructed by combining two existing matrices.
returns:
- type: Titanium.UI.iOS.3DMatrix
+ type: Titanium.UI.3DMatrix
parameters:
- name: t2
summary: |
@@ -31,12 +35,12 @@ methods:
Note that matrix operations are not commutative - the order in which you concatenate
matrices is important. That is, the result of multiplying matrix t1 by matrix t2 does
not necessarily equal the result of multiplying matrix t2 by matrix t1.
- type: Titanium.UI.iOS.3DMatrix
+ type: Titanium.UI.3DMatrix
- name: rotate
summary: Returns a matrix constructed by rotating an existing matrix.
returns:
- type: Titanium.UI.iOS.3DMatrix
+ type: Titanium.UI.3DMatrix
parameters:
- name: angle
summary: |
@@ -59,7 +63,7 @@ methods:
- name: scale
summary: Returns a matrix constructed by scaling an existing matrix.
returns:
- type: Titanium.UI.iOS.3DMatrix
+ type: Titanium.UI.3DMatrix
parameters:
- name: sx
summary: The value by which to scale x values of the matrix.
@@ -76,7 +80,7 @@ methods:
- name: translate
summary: Returns a matrix constructed by translating an existing matrix.
returns:
- type: Titanium.UI.iOS.3DMatrix
+ type: Titanium.UI.3DMatrix
parameters:
- name: tx
summary: The value by which to move x values with the matrix.
@@ -185,7 +189,7 @@ examples:
win.add(button);
button.addEventListener('click', function(){
- var t1 = Ti.UI.iOS.create3DMatrix();
+ var t1 = Ti.UI.create3DMatrix();
t1 = t1.translate(0, 100, 200);
t1.m34 = 1.0/-90;
var a1 = Ti.UI.createAnimation();
@@ -67,7 +67,7 @@ button.addEventListener('click', function()
a3.repeat = 1;
a3.addEventListener('complete',function()
{
- view.animate({transform:Ti.UI.iOS.create3DMatrix(),duration:500});
+ view.animate({transform:Ti.UI.create3DMatrix(),duration:500});
});
view.animate(a3);
});
@@ -12,7 +12,7 @@ win.add(button);
button.addEventListener('click', function()
{
- var t = Titanium.UI.iOS.create3DMatrix();
+ var t = Titanium.UI.create3DMatrix();
t = t.rotate(200,0,1,1);
t = t.scale(3);
t = t.translate(20,50,170);
@@ -70,7 +70,7 @@ var button3 = Titanium.UI.createButton({
button3.addEventListener('click', function()
{
- var t1 = Ti.UI.iOS.create3DMatrix();
+ var t1 = Ti.UI.create3DMatrix();
t1 = t1.scale(0.00001);
t1 = t1.rotate(180,0,0,1);
var a1 = Titanium.UI.createAnimation();
@@ -81,7 +81,7 @@ button3.addEventListener('click', function()
a1.addEventListener('complete', function()
{
// simply reset animation
- var t2 = Ti.UI.iOS.create3DMatrix();
+ var t2 = Ti.UI.create3DMatrix();
var a2 = Titanium.UI.createAnimation();
a2.transform = t2;
a2.duration = 500;
@@ -1,8 +1,8 @@
-describe("Ti.UI.iOS.3DMatrix Tests", {
+describe("Ti.UI.3DMatrix Tests", {
testInvert: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
- var matrix2 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
+ var matrix2 = Ti.UI.create3DMatrix();
valueOf(matrix1.invert()).shouldBeObject();
matrix1 = matrix1.scale(2, 2, 2);
valueOf(matrix1.invert()).shouldBeObject();
@@ -15,14 +15,14 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testMultiply: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
- var matrix2 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
+ var matrix2 = Ti.UI.create3DMatrix();
valueOf(matrix1.multiply(matrix2)).shouldBeObject();
valueOf(matrix1.multiply(matrix1)).shouldBeObject();
},
testRotate: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
valueOf(matrix1.rotate(0, 0, 0, 0)).shouldBeObject();
valueOf(matrix1.rotate(90, 1, 0, 0)).shouldBeObject();
valueOf(matrix1.rotate(90, 0, 1, 0)).shouldBeObject();
@@ -38,7 +38,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testTranslate: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
valueOf(matrix1.translate(-1.0, 0, 0)).shouldBeObject();
valueOf(matrix1.translate(0, -1.0, 0)).shouldBeObject();
valueOf(matrix1.translate(0, 0, -1.0)).shouldBeObject();
@@ -52,7 +52,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testScale: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
valueOf(matrix1.scale()).shouldBeObject();
valueOf(matrix1.scale(1.0)).shouldBeObject();
valueOf(matrix1.scale(-1.0)).shouldBeObject();
@@ -67,7 +67,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testCreate3DMatrixValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
valueOf(matrix1.m11).shouldBe(1);
valueOf(matrix1.m12).shouldBe(0);
valueOf(matrix1.m13).shouldBe(0);
@@ -87,7 +87,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testInvertValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
matrix1.invert();
valueOf(matrix1.m11).shouldBe(1);
valueOf(matrix1.m12).shouldBe(0);
@@ -108,7 +108,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testRotateValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
matrix1 = matrix1.rotate(-180, 50, 0, 0);
valueOf(matrix1.m11).shouldBe(1);
valueOf(matrix1.m12).shouldBe(0);
@@ -129,7 +129,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testScaleValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
matrix1 = matrix1.scale(5, -5, 0);
valueOf(matrix1.m11).shouldBe(5);
valueOf(matrix1.m12).shouldBe(0);
@@ -150,7 +150,7 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testTranslateValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
matrix1 = matrix1.translate(5, -10, 5);
valueOf(matrix1.m11).shouldBe(1);
valueOf(matrix1.m12).shouldBe(0);
@@ -171,8 +171,8 @@ describe("Ti.UI.iOS.3DMatrix Tests", {
},
testMultiplyValue: function() {
- var matrix1 = Ti.UI.iOS.create3DMatrix();
- var matrix2 = Ti.UI.iOS.create3DMatrix();
+ var matrix1 = Ti.UI.create3DMatrix();
+ var matrix2 = Ti.UI.create3DMatrix();
matrix1 = matrix1.multiply(matrix1);
valueOf(matrix1.m11).shouldBe(1);
valueOf(matrix1.m12).shouldBe(0);
@@ -4,13 +4,13 @@
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
-#import "TiUIiOSProxy.h"
+#import "TiProxy.h"
#if defined(USE_TI_UIIOS3DMATRIX) || defined(USE_TI_UI3DMATRIX)
#import <QuartzCore/QuartzCore.h>
-@interface TiUIiOS3DMatrix : TiProxy {
+@interface Ti3DMatrix : TiProxy {
@protected
CATransform3D matrix;
}
@@ -19,11 +19,11 @@
-(id)initWithMatrix:(CATransform3D)matrix_;
-(CATransform3D)matrix;
--(TiUIiOS3DMatrix*)translate:(id)args;
--(TiUIiOS3DMatrix*)scale:(id)args;
--(TiUIiOS3DMatrix*)rotate:(id)args;
--(TiUIiOS3DMatrix*)invert:(id)args;
--(TiUIiOS3DMatrix*)multiply:(id)args;
+-(Ti3DMatrix*)translate:(id)args;
+-(Ti3DMatrix*)scale:(id)args;
+-(Ti3DMatrix*)rotate:(id)args;
+-(Ti3DMatrix*)invert:(id)args;
+-(Ti3DMatrix*)multiply:(id)args;
@property(nonatomic,readwrite,retain) NSNumber* m11;
@property(nonatomic,readwrite,retain) NSNumber* m12;
Oops, something went wrong.

0 comments on commit 79c919a

Please sign in to comment.