From 7959ae7d3ec88869d131e25165e4ce4c09314e15 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 18 Nov 2012 15:44:52 -0800 Subject: j3dcore: simplify ModelClipRetained.update now that there is no D3d backend Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/ModelClipRetained.java | 39 ++++------------------ 1 file changed, 7 insertions(+), 32 deletions(-) (limited to 'src/classes') 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; -- cgit v1.2.3