Revision b32444ee
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/Cubit.java | ||
---|---|---|
26 | 26 |
import org.distorted.library.effect.MatrixEffectRotate; |
27 | 27 |
import org.distorted.library.main.DistortedEffects; |
28 | 28 |
import org.distorted.library.main.DistortedNode; |
29 |
import org.distorted.library.mesh.MeshCubes;
|
|
29 |
import org.distorted.library.mesh.MeshBase;
|
|
30 | 30 |
import org.distorted.library.message.EffectListener; |
31 | 31 |
import org.distorted.library.type.Dynamic1D; |
32 | 32 |
import org.distorted.library.type.Static1D; |
... | ... | |
43 | 43 |
private final Static3D mOrigPosition; |
44 | 44 |
|
45 | 45 |
private RubikObject mParent; |
46 |
private MeshCubes mCube;
|
|
46 |
private MeshBase mMesh;
|
|
47 | 47 |
private Static3D mRotationAxis; |
48 | 48 |
private MatrixEffectRotate mRotateEffect; |
49 | 49 |
|
... | ... | |
153 | 153 |
|
154 | 154 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
155 | 155 |
|
156 |
Cubit(RubikObject parent, MeshCubes mesh, Static3D position)
|
|
156 |
Cubit(RubikObject parent, MeshBase mesh, Static3D position)
|
|
157 | 157 |
{ |
158 | 158 |
float x = position.get0(); |
159 | 159 |
float y = position.get1(); |
... | ... | |
164 | 164 |
Static3D vector = new Static3D(TS*(x-nc), TS*(y-nc), TS*(z-nc)); |
165 | 165 |
|
166 | 166 |
mParent = parent; |
167 |
mCube = mesh;
|
|
167 |
mMesh = mesh;
|
|
168 | 168 |
mOrigPosition = new Static3D(x,y,z); |
169 | 169 |
mQuatScramble = new Static4D(0,0,0,1); |
170 | 170 |
mRotationAngle = new Dynamic1D(); |
... | ... | |
182 | 182 |
mEffect.apply(mParent.mScaleEffect); |
183 | 183 |
mEffect.apply(mParent.mMoveEffect); |
184 | 184 |
|
185 |
mNode = new DistortedNode(mParent.mTexture,mEffect,mCube);
|
|
185 |
mNode = new DistortedNode(mParent.mTexture,mEffect,mMesh);
|
|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
267 | 267 |
|
268 | 268 |
void releaseResources() |
269 | 269 |
{ |
270 |
mCube.markForDeletion();
|
|
270 |
mMesh.markForDeletion();
|
|
271 | 271 |
mNode.markForDeletion(); |
272 | 272 |
} |
273 | 273 |
|
Also available in: Unified diff
More work on making new types of RubikObjects easily creatable.