diff options
author | Harvey Harrison <[email protected]> | 2012-11-18 15:44:52 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-11-18 15:44:52 -0800 |
commit | 7959ae7d3ec88869d131e25165e4ce4c09314e15 (patch) | |
tree | 8b8301b30a6f9fa10236d067de90ac08e33e0bdf /src/classes | |
parent | 002497695a340491955cdfa3108c2cc628c923b8 (diff) |
j3dcore: simplify ModelClipRetained.update now that there is no D3d backend
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/share/javax/media/j3d/ModelClipRetained.java | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/src/classes/share/javax/media/j3d/ModelClipRetained.java b/src/classes/share/javax/media/j3d/ModelClipRetained.java index 94c554d..ec72258 100644 --- a/src/classes/share/javax/media/j3d/ModelClipRetained.java +++ b/src/classes/share/javax/media/j3d/ModelClipRetained.java @@ -599,39 +599,14 @@ class ModelClipRetained extends LeafRetained { update(cv.ctx, enableMask, getLastLocalToVworld()); } - void update(Context ctx, int enableMask, Transform3D trans) { - if (!VirtualUniverse.mc.isD3D()) { - for (int i = 0; i < 6; i ++) { - Pipeline.getPipeline().updateModelClip(ctx, i, ((enableMask & (1 << i)) != 0), - xformPlanes[i].x, xformPlanes[i].y, - xformPlanes[i].z, xformPlanes[i].w); - } - return; - } - - // For D3D we need to transform the plane equations from local to - // world coordinate. - Transform3D invtrans = new Transform3D(trans); - - // can't call getNormalTransform() since it will cache - // normalTransform and may return previous result next time. - invtrans.invert(); - invtrans.transpose(); - - for (int i=0; i < 6; i++) { - if ((enableMask & (1 << i)) != 0) { - - Vector4d vec = new Vector4d(xformPlanes[i].x, xformPlanes[i].y, - xformPlanes[i].z, xformPlanes[i].w); - vec.normalize(); - invtrans.transform(vec); - Pipeline.getPipeline().updateModelClip(ctx, i, true, vec.x, vec.y, vec.z, vec.w); - - } else { - Pipeline.getPipeline().updateModelClip(ctx, i, false, 0, 0, 0, 0); - } +void update(Context ctx, int enableMask, Transform3D trans) { + for (int i = 0; i < 6; i++) { + Vector4d v = xformPlanes[i]; + boolean enable = ((enableMask & (1 << i)) != 0); + Pipeline.getPipeline().updateModelClip(ctx, i, enable, + v.x, v.y, v.z, v.w); } - } +} void initMirrorObject(Object[] args) { Shape3DRetained shape; |