Main repository of MikuMikuStudio
Revisión | 64695842301d143ff3b081c28d82a70605b0f907 (tree) |
---|---|
Tiempo | 2013-07-07 07:04:48 |
Autor | ZeroSeparation@gmail.com <ZeroSeparation@gmai...> |
Commiter | ZeroSeparation@gmail.com |
Reverted previous change. Use geometry.center() instead.
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10696 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright (c) 2009-2012 jMonkeyEngine | |
2 | + * Copyright (c) 2009-2010 jMonkeyEngine | |
3 | 3 | * All rights reserved. |
4 | 4 | * |
5 | 5 | * Redistribution and use in source and binary forms, with or without |
@@ -29,6 +29,7 @@ | ||
29 | 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
30 | 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 | 31 | */ |
32 | + | |
32 | 33 | package com.jme3.scene.shape; |
33 | 34 | |
34 | 35 | import com.jme3.scene.Mesh; |
@@ -77,21 +78,6 @@ public class Quad extends Mesh { | ||
77 | 78 | updateGeometry(width, height, flipCoords); |
78 | 79 | } |
79 | 80 | |
80 | - /** | |
81 | - * Create a quad with the given width and height. The quad | |
82 | - * is always created in the XY plane. | |
83 | - * | |
84 | - * @param width The X extent or width | |
85 | - * @param height The Y extent or width | |
86 | - * @param flipCoords If true, the texture coordinates will be flipped | |
87 | - * along the Y axis. | |
88 | - * @param originAtCenter If true then the origin of the quad will be at the center | |
89 | - * of the quad, rather than at one corner. | |
90 | - */ | |
91 | - public Quad(float width, float height, boolean flipCoords, boolean originAtCenter){ | |
92 | - updateGeometry(width, height, flipCoords, originAtCenter); | |
93 | - } | |
94 | - | |
95 | 81 | public float getHeight() { |
96 | 82 | return height; |
97 | 83 | } |
@@ -103,29 +89,16 @@ public class Quad extends Mesh { | ||
103 | 89 | public void updateGeometry(float width, float height){ |
104 | 90 | updateGeometry(width, height, false); |
105 | 91 | } |
106 | - | |
92 | + | |
107 | 93 | public void updateGeometry(float width, float height, boolean flipCoords) { |
108 | - updateGeometry(width, height, flipCoords, false); | |
109 | - } | |
110 | - | |
111 | - public void updateGeometry(float width, float height, boolean flipCoords, boolean originAtCenter) { | |
112 | 94 | this.width = width; |
113 | 95 | this.height = height; |
114 | - if (originAtCenter) { | |
115 | - float halfWidth = width*0.5f; | |
116 | - float halfHeight = height*0.5f; | |
117 | - setBuffer(Type.Position, 3, new float[]{-halfWidth, -halfHeight, 0, | |
118 | - halfWidth, -halfHeight, 0, | |
119 | - halfWidth, halfHeight, 0, | |
120 | - -halfWidth, halfHeight, 0 | |
121 | - }); | |
122 | - } else { | |
123 | - setBuffer(Type.Position, 3, new float[]{0, 0, 0, | |
124 | - width, 0, 0, | |
125 | - width, height, 0, | |
126 | - 0, height, 0 | |
127 | - }); | |
128 | - } | |
96 | + setBuffer(Type.Position, 3, new float[]{0, 0, 0, | |
97 | + width, 0, 0, | |
98 | + width, height, 0, | |
99 | + 0, height, 0 | |
100 | + }); | |
101 | + | |
129 | 102 | |
130 | 103 | if (flipCoords){ |
131 | 104 | setBuffer(Type.TexCoord, 2, new float[]{0, 1, |