Events Triggered By Collision Detection In Shockwave 3D Environment Happen More Than Once?

Okay, I've finally managed to get my Director 3D game to move an object to a new random position when collision detection occurs with that object! HOWEVER, sometimes it will work as expected and other times the object seems to move SEVERAL times before settling. Anyone have any idea why it isn't always just moving once and settling as I'd hoped it would...?
To see an example of the problem I'm facing, create a new Director movie then insert a new Shockwave 3D media element into that Director movie named "Scene" and apply the below code to that 3D media element. I've tried to trim the code down as much as possible to get right to the heart of the problem:
=====
property Scene  -- reference to 3D cast member
property pSprite    -- referebce to the 3D sprite
property pCharacter -- reference to the yellow in the 3D world
property pTransformgreen01Flag -- reference to the flag which will trigger action to move green01 + increase score on collision
property pTransformgreen02Flag -- reference to the flag which will trigger action to move green02 + increase score on collision
on beginSprite me
  -- initiate properties and 3D world
  pSprite = sprite(me.spriteNum)
  Global Scene
  Scene = sprite(me.spriteNum).member
  Scene.resetWorld()
  Tempobjres = Scene.newmodelresource("sphereRES", #sphere)  --create sphere modelresource
  Tempobjres.radius = 10     --set sphere modelresrource radius to 20
  Tempobjres.resolution = 17   --set the sphere modelresource resolution to 17
  Tempobj = scene.newmodel("yellow", tempobjres)   --create a model from the sphere modelresource
  Tempshader = scene.newshader("sphereshd", #standard)   --create a new standard shader
  Tempshader.diffuse = rgb(250,250,10)   --set the diffuse color (in this case, a light green)
  Tempshader.texture = void   --set the texture of the shader to void
  Tempobj.transform.position=vector(0,0,0)
  Tempobj.shaderlist = tempshader   -- assign the shader to the model
  Tempobjres1 = Scene.newmodelresource("sphereRES1", #sphere)  --create sphere modelresource
  Tempobjres1.radius = 10     --set sphere modelresrource radius to 20
  Tempobjres1.resolution = 17   --set the sphere modelresource resolution to 17
  Tempobj1 = scene.newmodel("green01", tempobjres1)   --create a model from the sphere modelresource
  Tempshader1 = scene.newshader("sphereshd1", #standard)   --create a new standard shader
  Tempshader1.diffuse = rgb(100,200,50)   --set the diffuse color (in this case, a light green)
  Tempshader1.texture = void   --set the texture of the shader to void
  Tempobj1.transform.position = vector(25,25,0)
  Tempobj1.shaderlist = tempshader1   -- assign the shader to the model
  Tempobjres2 = Scene.newmodelresource("sphereRES2", #sphere)  --create sphere modelresource
  Tempobjres2.radius = 10     --set sphere modelresrource radius to 20
  Tempobjres2.resolution = 17   --set the sphere modelresource resolution to 17
  Tempobj2 = scene.newmodel("green02", tempobjres2)   --create a model from the sphere modelresource
  Tempshader2 = scene.newshader("sphereshd2", #standard)   --create a new standard shader
  Tempshader2.diffuse = rgb(100,200,50)   --set the diffuse color (in this case, a light green)
  Tempshader2.texture = void   --set the texture of the shader to void
  Tempobj2.transform.position = vector(-25,-25,0)
  Tempobj2.shaderlist = tempshader2   -- assign the shader to the model
  --the following lines will add collision detection for all three on-screen 3D objects
  Tempobj.addModifier(#collision)
  Tempobj.collision.enabled=true
  Tempobj1.addModifier(#collision)
  Tempobj1.collision.enabled=true
  Tempobj2.addModifier(#collision)
  Tempobj2.collision.enabled=true
  Tempobj.collision.resolve=true
  Tempobj1.collision.resolve=true
  Tempobj2.collision.resolve=true
  --the following lines will tell Director what to do with a specific object when it collides with another
  Tempobj.collision.setCollisionCallBack(#beepsound, me)
  Tempobj1.collision.setCollisionCallBack(#hitgreen01, me)
  Tempobj2.collision.setCollisionCallBack(#hitgreen02, me)
  pCharacter = Scene.model("yellow")
  -- we must define pCharacter after we use the resetWorld() command
  -- otherwise this variable object will be deleted
  createCollisionDetect
  pTransformgreen01Flag = false
  pTransformgreen02Flag = false
end
on createCollisionDetect
  Global Scene
  -- add collision modifier to the character
  pCharacter.addmodifier(#collision)
  -- set bounding geometry for collision detection to bounding box of model
  pCharacter.collision.mode = #mesh
  -- resolve collision for character
  pCharacter.collision.resolve = TRUE
end
on keyDown
  Global Scene
  case(chartonum(the keypressed)) of
    30: --up arrow
      scene.model("yellow").translate(0,5,0)
    31: --down arrow
      scene.model("yellow").translate(0,-5,0)
    28: --left arrow
      scene.model("yellow").translate(-5,0,0)
    29: --right arrow
      scene.model("yellow").translate(5,0,0)
  end case
end
--when "yellow" (player character) hits another object, this will happen:
on beepsound me, colData
  beep --plays sound
end
--when "green01" is hit by another object, this will happen:
on hitgreen01 me, colData
  Global Scene
  pTransformgreen01Flag=true
end
--when "green02" is hit by another object, this will happen:
on hitgreen02 me, colData
  Global Scene
  pTransformgreen02Flag=true 
end
on enterFrame me
  Global Scene
  if pTransformgreen01Flag then
    --the following lines will generate new random x and y co-ordinates for green01
    randomx=random(-110,110)
    green01x=randomx
    randomy=random(-90,90)
    green01y=randomy
    Scene = member("Scene")
    Scene.model("green01").transform.position = vector(green01x,green01y,0)
    pTransformgreen01Flag = false
  end if
  if pTransformgreen02Flag then
    --the following lines will generate new random x and y co-ordinates for green02
    randomx=random(-110,110)
    green02x=randomx
    randomy=random(-90,90)
    green02y=randomy
    Scene = member("Scene")
    Scene.model("green02").transform.position = vector(green02x,green02y,0)
    pTransformgreen02Flag = false
  end if
end
=====
I imagine the part that's causing the issue is the "on enterFrame me" part at the end, but can't see any reason why it wouldn't just perform the desired action ONCE every time...?
This is really confusing the hell out of me and is pretty much the final hurdle before I can call my game "finished" so any and all assistance would be GREATLY appreciated!

You can get yourself a used copy of my book http://www.amazon.com/Director-Shockwave-Studio-Developers-Guide/dp/0072132655/ for $0.82 + shipping.  Chapter 14 contains 33 pages which deal specifically with the vagaries of the collision modifier.
You can download just the chapter on Collision Detection from http://nonlinear.openspark.com/book/Collisions.zip.  This includes the demo movies and the unedited draft of the text for the chapter.
Perhaps you will find this useful.

Similar Messages

  • Terminating Event Getting triggered more than once

    Hi All,
    I am facing a very peculiar problem in PR release workflow(item wise release, business object BUS2009).
    One of the requirements of the workflow is to send a mail to PR initiator once it is rejected by any of the approvers(4, in my case). The event associated with the cancellation of the workflow is REJECTION_START.
    The problem is that this event is being triggered more than once. One thing that i have observed is that if eg. second level of approver cancels it, the event is triggered twice. Likewise if third level of approver cancels it, it is being triggered thrice. Which leads to sending of 2 and 3 mails respectively to the PR initiators mailbox.
    Why is this happening? Ideally, only one event should have been triggered, and the triggering of the event should have been independent of PR approver's level. I am at my wits end regarding this.
    Any suggestions in this regard will be highly appreciated
    Regards
    Varsha Agarwal.

    If you check for 2nd level rejjection two release Code is associated so it triggers 2 times and same for 3rd level approval.
    I think you have to put some sort of filter using FM SAP_WAPI_WORKITEM_OBJECT
    in the attribute portion of yopur custom BO.
    The attribjute will check this FM and if it has entries that means already a Workflow has been triggered it should set the flag as X.
    Make use of this attribute in defining the start condition of this task thru
    SWB_COND.
    Thanks
    Arghadip

  • QuickTime DOM Events called more than once?

    I am in the process of writing code in JavaScript that will track the interaction on a embedded QuickTime video.
    function ew_addImage(v) {
    trackImg=new Image(1,1);
    trackImg.src=v;
    function ew_pauseTrk() {
    var imgStr='http://www.sldkfjsldfjk.com/200125/EWTRACKNEW_VINT?ewadid=751801&ewbust='ewbust'&eid=1078554&file=$VIDEO$&bw=56&vlen=3:00&vint=PAUSED';
    ew_addImage(imgStr);
    if (document.addEventListener)
    document.getElementById("mov1").addEventListener("qt_pause", ew_pauseTrk, false);
    Everything works correctly. I am able to see the image being called when I am looking at Wireshark. The problem is when I click pause more than once.. It seems like the QuickTime DOM Events can only be called once.. Is that true?
    Thanks

    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    }<---- is this } matched elsewhere?

  • Process Chain after EVENT - More than once

    Hi all, I would like to run a process chain after an event; everything works fine with the following model...
    PC1 >>
         >> some processes
         >> EVENT TRIGGER
    PC2 >>
         (after EVENT) runs ok after event ONLY if I SCHEDULE it
    After succesfully run, I've tried to run again immediatly PC1 again and it runs ok, even triggers mentioned EVENT, but PC2 never runs again until I manually SCHEDULE it.
    The answer is: how should I SCHEDULE the process chain PC2 so I'll "never" need again to SCHEDULE it when I want it to run after event triggered on PC1?
    Hope you can help me.
    Thanks a lot!
    Bernardo

    Hello,
    Both process chains are separated. At the model I described, at the end of PC1 event is succesfully triggered. After event is triggered at PC1, PC2 triggers correctly due it is scheduled as "after event".
    Everything works fine, then, if I trigger PC1 again it runs correctly; event is triggered succesfully but PC2 (that is scheduled as "after event") doesn't runs; this is because I haven't SCHEDULED it again (after the first succesfully run).
    What I want is not schedule PC2 after a succesfully run. Is there any way to reach that purpose?
    Thanks again!
    Bernardo

  • Events being triggered more than once

    HI All,
    I am using SAP Business One 2007 A SP:01 PL:07
    I have created a form using SAP Business One UI API Version 2007 A 8.0.When i open the form first time all item events and menu events are working properly..
    When i close the form and open it again all the menu and items events get fired twice.Again i close and reopen the form all Item and Menu events are triggered thrice on a single click.
    Any help to solve this problem will be highly appreciated.
    Warm Regards,
    Prerna

    Hello,
    Maybe You using a global variable for the form. Try to swicth to local variable and use sbo_application.form.GetForm(pval.formtypeex, pval.formtypeCount), or check you application really closes the window (window menü, and see the list of opened forms).
    Try to use EventSpy, which is a part of the SDN tools, you can download from /docs/DOC-8857#section6
    Regards,
    J

  • Custom Events and Scheduling more than once

    Hi,
    in BO 4.1, I successfully triggered WebI Report instance generation by a "Custom Event" through scheduling.
    Now, we have the requirement that the report should not be triggered only once but always when the event is triggered.
    At first glance, this looks tricky bc. in order that the report "reacts" to the event, the report itself must be scheduled with the event (it gets an instance "pending" that "wait + reacts" to the event). So it looks like we need schedule the report always manually with "event" before it is ready to react to the event specified in the scheduling.
    Is there any user-friendly trick to make the report react upon every fired event without having to "schedule" the report manually with the event?
    (Similar to schedule daily, just that the event is the trigger, note a daytime...)
    Best Regards

    Hi Florian,
    What is the frequency set under Recurrence option for the report instance?
    Can you give an idea like after how much time the event can be triggered?
    For example, if you are expecting the event to change in an hour, you can schedule the recurrence as hourly or you can specify something like 0 hours and 15 minutes or something like that.
    In that case, once the event is fired, your report instance will be ready to trigger after 15 minutes for the next run.
    Would suggest you to sync with the BO administrator as concurrent triggering of large number of instances can give load on Job Servers.
    Hope it will help in some way.
    Regards,
    Yuvraj

  • Regarding activation job triggering more than once

    hi all,
    i have designed a process chain in which there are 5 info packages (same info source) loading into same ods.I have then clubbed these 5 info packages steps in one OR condition.however,there are multiple activations which are triggered i.e. as soon as one of the load is completed one activation job is triggering and similarly it happens with other loads also.
    this multiple triggering of activation causes subsequent processes in the chain to trigger multiple times which is not required.
    is there way that we can trigger this activation only once.
    Please note that OR condition is required and AND cannot be placed in its place.

    HI Parth,
    I think you cannot do away with AND.
    You will have to use it just when the 5 different process complete.
    I am not sure how did you make it but i would suggest to go like this:
    Loading1     
    Loading 2 
    Loading 3
    Loading 4          
    Loading 5
    Then you can have the Activation step. after the loading is completed.
    Do assign points if it helps.
    Do iterate your problem in more descriptive manner if this doesnt helps :).
    Regds,
    Den

  • Triggering workflow more than once during wait hrs

    Dear All,
    We have implemented two Z (ZAPFI_INV, & ZFI_INV_PARK) workflows for FI
    park invoice. ZFI_INV_PARK is the query workflow and ZAPFI_INV is the
    approval workflow.
    Both workflow start with checking whether if image (i.e. FI invoice) is
    attached with the document or not. If the image is not attached, the
    workflow will wait 3 hrs for the image attachment. If the image gets
    attached within 3 hrs, workflow will move further for approval or query
    process.
    But if the same document is "parked" or "save-as-completed" more than
    once within the waiting time frame of 3 hrs, then more than one
    workflow process starts & resulting same WI more than once in the useru2019s inbox.
    Kindy advice.

    Is it possible to put the Validation at Application Level (rather that doing changes in Workflows as they are working correctly)?
    May be you can log the Invoices in ZTABLE when they are parked and Flag them as marked once processing is complete.
    Regards
    Shital

  • Can I have a photo in more than one event?

    I understand that it is normally not possible to have one photo in more than one event at a time.
    I am quite careful about arranging my photos into events logically, but find in my library tere are several events called [Date] Photo Stream, which I've not delivberately created. It appears that in many cases the photos these Photo stream events contain are also in other events.
    Can anyone tell me what is going on here? Can I safely delete the Photostream events and their contents?

    To have a photo in more than one Event it must be duplicated and the duplicate added to the other Event.  A photo can be in multiple albums, books, slideshows without having to duplicate the photo as those use pointers to the original photo.
    At the beginning of each month new photos in the Shoto Stream are imported into an Event with the month and year as the Event name.  All photos taken that month are added to that Event.  That's because the iPhoto/Photo Stream preferences are set to auto import photos taken by your mobile devices:
    Events are basically buckets of photos based on the date taken and how you've setup iPhoto's preferences for importing photos:
    Merging Events can change the location in the resulting event among the other events due to the variety of dates of the photos.
    OT

  • HT2513 Help! iCal is deleting some events, as well as deleting anything more than 1 month old

    HELP! iCal is deleting events, seemingly at random. It is also deleting everything more than a month old.  Since I have no other record of my calendar, this is a disaster. 
    This has nothing to do with icloud, as my Mac is showing the identical calendar with identically missing items.  Nor have I added or deleted any calendars. 

    Quote
    Do this, and while it is in the open re-examine your cpu pins w/ a bight light and hd zoom or a magnifying glass.
    Thanks, xmad, I'll look at th CPU again tomorrow/next day under the glass when I take the board out.  I already checked them under magnification and was leaning toward a funky board, but it never hurts to re-check.  Eyesight is not what it used to be, for sure (I miss DOS, if that's a clue...).  Don't want to flash the BIOS if not necessary, since it runs Windows fine and everything works except that RAM.
    Bernhard, I don't have CPU-Z installed on that machine and don't want to install anything else until it's working normally.  I'd never seen Click-Bios before and just need to get over my initial suspicion of something new!  Also learn my way around it before I change anything.  I'd never encountered a board reporting a bios different than printed on it.  I've never messed with manual memory settings or done more overclocking than just a little exploratory and suprisingly successful nudge - if you could point me toward a  good basic explaination of all those settings, I could learn from there.
    Appreciate your input very much.   
    Have learned a lot just reading the threads here for the last few days.  This is the best forum I've ever encountered.  I'll report back - some suggestions in other posts resembling my problem ended with no resolution, and that's a shame because one doesn't know if it worked or not.

  • Bug in scrollbar event triggering?

    In LabVIEW 8.6, I am trying to fire an event when I finish moving the scrollbar of an array indicator.  I use the "mouse up" event to avoid having the event structure fire constantly the entire time I am moving the scrollbar.  However, there seems to be a bug (?) in the event detection.  It works fine as long as I have the mouse on top of the scrollbar when I release it.  However, Win XP allows you to continue to move the scrollbar even if the mouse is off to the left or right of the bar (when you click on the scrollbar it "locks" the focus onto it).  However, LabVIEW does not seem to realize this and if I have the mouse slightly off to the right of the scrollbar when I release, the event doesnt fire. LV seems to base the event off of whether the mouse is on top of the pixels of the indicator rather than whether I still have control of the scrollbar.

    Technically it is not a bug.  There is no event triggered because when you do the Mouse Up, you are no longer on the scrollbar.  Unfortunately, the behavior in Windows that allows you to continue to move the scrollbar even when you aren't on it is conflicting with the desire to detect when you let go of the scroll bar.
    There was a recent thread discussingthis very issue and a way to get the behavior you are looking for.
    Re: Handle mouse up on numeric slider control - even when mouse leaves control

  • Chapter 6 Event-triggered campaigns

    From William...
    Chapter 6 Event-triggered campaigns is an exercise in the CCMO training where we send an email to Recipients who recently converted from Prospects to Clients, detected by a change in their status.
    Possibly the simplest way of accomplishing this is with the Incremental Query activity. However, to prevent pulling Recipients who are Clients already at the start of the campaign, the Incremental Query needs to be run twice, the first time to set the history.
    According to the documentation
    https://support.neolane.net/doc/AC6.1/en/WKF_Repository_of_activities_Targeting_activities .html#Incremental_query
    "The population already targeted is stored in the memory by workflow instance and by activity... two tasks [executions of a workflow step] based on the same Incremental Query for the same workflow instance will use the same log."
    In other words, two runs of an Incremental Query activity in a workflow share the same history log. For the first run of the Incremental Query activity, uncheck the 'Plan execution' option and transition into an End activity. This will set the history log to current Clients. For the 2nd run of the Incremental Query activity, check the 'Plan execution' option and transition into the Delivery.
    The 2nd (and subsequent) runs of the Incremental Query activity will pick up only new conversions from Prospect to Client.

    Hi Oguz,
    If you're trying to communicate between two loops, triggering the second from the first, then you should look at producer consumer type structures in File»New... under From Template.
    Stephen Meserve
    National Instruments

  • Trying to get collision detection working with havok

    Hi - I'm having some trouble using collision detection within
    director using a w3d file with havok applied to it. I've been using
    the registerinterest function but I get a "value out of range"
    error.
    This is my code (there is a cone and box on a plane imported
    from 3d max - named Cone01 and Box01 these are both movable rigid
    bodies).
    on beginSprite me
    box1=member("3d").model("Box01")
    cone1=member("3d").model("Cone01")
    w = member ( 1 )
    hk = member( 2 )
    hk.initialize( w, 0.1, 1 )
    hk.registerInterest (box1, cone1, 10, 0, #collision, me)
    end
    on collision me, details
    sound(2).play(member("hihats"))
    end
    on enterFrame me
    end
    I've also tried this and had no luck:
    on beginSprite me
    rb1 = sprite(1).pHavok.rigidBody("Box01")
    rb2 = sprite(1).pHavok.rigidBody("Cone01")
    w = member ( 1 )
    hk = member( 2 )
    hk.initialize( w, 0.1, 1 )
    hk.registerInterest (rb1, rb2, 10, 0, #collision, me)
    end
    Any help would be great.
    Thanks

    quote:
    Originally posted by:
    josiewales
    Hi - I'm having some trouble using collision detection within
    director using a w3d file with havok applied to it.
    Just study this example:
    http://necromanthus.com/Games/ShockWave/tutorials/FPS_Havok.html
    cheers

  • Java3D collision detection (full test source)

    Hello!
    I have struggled with this problem for a month now, so I really need some help.
    I try to develop a game with collision detection with Java3D.
    To narrow it down I had made two test-java-files for you.
    File 1) Applet where I add all my objects (2 ColorCubes)
    File 2) A KeyListener to stear one of the cubes. The key listener also checks for collisons.
    All code is below, just compile and try.
    The idea is that the cube that I can stear should stop outside the other cube from any
    direction. But I can't detect that other cube at all.
    So if any one could try the code and give me some hints or example I would be most
    thankfull.
    Best regards
    Fredrik
    import java.applet.*;
    import java.awt.*;
    import java.awt.Frame;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import com.sun.j3d.utils.geometry.*;
    import com.sun.j3d.utils.behaviors.keyboard.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import javax.swing.*;
    import java.util.*;
    public class Test extends Applet
         BranchGroup branchGroup;
         ColorCube colorCube1 = new ColorCube(0.4); //The cube that you can navigate
         ColorCube colorCube2 = new ColorCube(0.4);
         TransformGroup transformGroup1;
         public void init()
              setLayout(new BorderLayout());
              GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
              Canvas3D canvas3D = new Canvas3D(config);
              add("Center", canvas3D);
              SimpleUniverse simpleUniverse = new SimpleUniverse(canvas3D);
              branchGroup = new BranchGroup();
              //Cube1
              transformGroup1 = new TransformGroup();
              Transform3D transform3D1 = new Transform3D();
              transform3D1.set(new Vector3f(0.0f, 0.0f, -20.0f));
              transformGroup1.setTransform(transform3D1);
              transformGroup1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
              //for setShapeBounds
              transformGroup1.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
              colorCube1.setCapability(Node.ALLOW_BOUNDS_READ);
              transformGroup1.setPickable(false);
              transformGroup1.addChild(colorCube1);
              branchGroup.addChild(transformGroup1);
              canvas3D.addKeyListener( new TestListener(transformGroup1, this) );
              //Cube2
              TransformGroup transformGroup2 = new TransformGroup();
              Transform3D transform3D2 = new Transform3D();
              transform3D2.set(new Vector3f(0.0f, 2.0f, -20.0f));
              transformGroup2.setTransform(transform3D2);
              colorCube2.setPickable(true);
              transformGroup2.addChild(colorCube2);
              branchGroup.addChild(transformGroup2);
              branchGroup.compile();
              simpleUniverse.addBranchGraph(branchGroup);
         public static void main(String[] args)
              Frame frame = new MainFrame(new Test(), 600, 400);
    }The KeyListener with Collision detection
    import java.awt.event.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.awt.Frame;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.picking.*;
    import com.sun.j3d.utils.geometry.*;
    public class TestListener implements KeyListener
         final static float DISTANCE      = 0.1f;
         final static double TURNANGLE      = 0.1;
         float x = 0.0f;
         float y = 0.0f;
         float z = -20.0f;
         private double angle = 0.0;
         TransformGroup transformGroup;
         Transform3D positionTransform3D = new Transform3D();
         Transform3D angleTransform3D = new Transform3D();
         Test test;
         PickTool pickTool;
         Point3d point3d;
         Vector3d vector3d;
         Transform3D transform3D;
         public TestListener(TransformGroup tfg, Test t)
              test = t;
              transformGroup = tfg;
              pickTool = new PickTool(test.branchGroup);
              pickTool.setCapabilities(test.colorCube2, PickTool.INTERSECT_FULL);
                pickTool.setMode( PickTool.BOUNDS );
              positionTransform3D.set(new Vector3f(x, y, z));
         public void keyTyped(KeyEvent e)
         public void keyPressed(KeyEvent e)
              if( e.getKeyCode() == KeyEvent.VK_UP )
                   if(isMovePossible(DISTANCE))
                        Transform3D temp = new Transform3D();
                     temp.set(new Vector3f(0, DISTANCE, 0));
                     positionTransform3D.mul(temp);
                     transformGroup.setTransform( positionTransform3D );
              else if( e.getKeyCode() == KeyEvent.VK_DOWN )
                   if(isMovePossible(-DISTANCE))
                        Transform3D temp = new Transform3D();
                     temp.set(new Vector3f(0, -DISTANCE, 0));
                     positionTransform3D.mul(temp);
                     transformGroup.setTransform( positionTransform3D );
              else if( e.getKeyCode() == KeyEvent.VK_LEFT )
                angle = angle + TURNANGLE;
                angleTransform3D.rotZ(TURNANGLE);
                positionTransform3D.mul(angleTransform3D);
                transformGroup.setTransform( positionTransform3D );
              else if( e.getKeyCode() == KeyEvent.VK_RIGHT )
                angle = angle - TURNANGLE;
                angleTransform3D.rotZ(-TURNANGLE);
                positionTransform3D.mul(angleTransform3D);
                transformGroup.setTransform( positionTransform3D );
         public void keyReleased(KeyEvent e)
         public boolean isMovePossible(float distance)
              boolean retValue = true;
              PickBounds pickBounds = new PickBounds( test.colorCube1.getBounds() );
              pickTool.setShape( pickBounds, getCordinate(test.transformGroup1) );
              PickResult pickResult = pickTool.pickAny( );
              if ( pickResult != null )
                   System.out.println("Boink");
                   retValue = false;
              else
                   retValue = true;
              return retValue;
         public static void main(String[] args)
              Frame frame = new MainFrame(new Test(), 600, 350);
        public Point3d getCordinate(TransformGroup transformGroup)
              Transform3D pointTransform3D = new Transform3D();
              transformGroup.getTransform( pointTransform3D );
              float[] cordinates = new float[16];
              pointTransform3D.get(cordinates);
              Point3d point = new Point3d(cordinates[3], cordinates[7], cordinates[11]);
              return point;
        public void printOutCordinates(TransformGroup transformGroup)
              Transform3D printOutTransform3D = new Transform3D();
              transformGroup.getTransform( printOutTransform3D );
              float[] cordinates = new float[16];
              printOutTransform3D.get(cordinates);
              for(int i = 0; i < cordinates.length; i++)
                   System.out.println(i + ":" + cordinates);
              System.out.println();

    First of all I would like to point out, that i've never actually used the PickTool, or in fact any element of the whole picking infrastructure from Java3D. Nevertheless I have done some collision detection in Java3D and it worked just fine. Unfortunatelly it required building the whole coldet ( collision detection ) algorythm from scratch :-)
    If You want to collide only two bodies then You probably should consider creating a special Behaviour class that will react to the WakeupOnCollisionEntry and WakeupOnCollisionExit criterions. There is a good example of such a behaviour class in the Java3D demos, under TickTockCollision. However if there will be more bodies in Your scene and they will collide with each other in a random way, then You should rather consider building the whole coldet engine from scratch ( it's not very difficult, but it takes some time )
    Either way, You could try to get a second opinion on the Java3D forum. People out there should have more experience with Java3D

  • VMware Performance Event Triggers use case questions.

    1) Can the CPO VMware Adapter Performance Event Triggers and their
    SAMPLE SIZE, INTERVAL, and CONDITIONS attributes be configured
    for the following use case?
    2) Can VMWare Performance Event Triggers be CORRELATED?  and if so would it be needed to satisfy the use case?
    3) Would an additional performance monitoring tool be required to satisy the use case?:
    If a VM CPU or RAM has been 80% for 2 hours then trigger a workflow
    and
    If a VM CPU or RAM has been at 60% for X days then trigger a workflow

    I will first describe how you could instrument a correlation method, but ultimately, I'm not sure it is really necessary for the uses cases described.
    To correlate VMware performance events over a designated timeframe, you would create a correlation process that tracks the underlying performance event and decides whether or not to trigger the process you want triggered when the correlated event is detected.
    Here's how it works.
    First, create a global table with three columns:
    1) Virtual Machine path
    2) Consecutive Trigger Count
    3) Last Trigger time
    Create a process that is triggered by a VMware performance event (such as Memory Avg > 80%) where you can set a sample size and interval that makes sense given the timeframe of interest (2 hours or X days). For example, a sample size of 10 and interval of 30 seconds (5 minutes) is a reasonable time slice from vCenter for a 2 hour timeframe. This results in requiring 24 consecutive triggers to raise the actual event of interest. (2 hours divided by 5 minutes)
    That is, the formula is:
    Sample Size * Interval / Timeframe = Consecutive Trigger Count
    The correlation process triggered by the raw VMware event does the following:
    1) If there is no existing entry in the global table for the VM, add entry to table with count = 1 and current time
    2) if entry exists, check the current time against the last trigger time
       a) if it is the next interval, for example, current time is 12:15 and last triggered time was 12:10 (see note below),
            Increment counter and set last trigger time 
            If count = 24, then run the process that handles the "VM Memory Avg > 80% for at least 2 hours " and delete entry from table.
           If count < 24, the process exits having only incremented the counter and set the last trigger time
       b) if the current time is > than last trigger time + time slice (+ a little padding), set the counter back to 1
    Note: When comparing current time w/last time, you should pad to account for slight processing delays so compare current-time < last-time+(time slice*2). Anything less than 10 minutes in this case would be considered a consecutive trigger. You could also compare current-time < last-time+time-slice+1, which is probably also safe.
    Now, having gone through all that, you may not need the correlation process after all. Simply adjust your sample size to be large enough to accommodate your ultimate timeframe and you can trigger your event handler directly without the need to correlate. So for the 2 hour window, just create a sample size of 240 (* 30 seconds = 2 hours). This may or may not work depending on how performance metrics have been configured on the server (sample size, intervals and how much is saved). You can only set your own sample and intervals to multiples of those configured values (so be careful and refer to the VMware documentation when relying on such metrics)
    You may find that the correlation method I first described is more reliable, especially for longer timeframes such as X days (where you need to sample hourly rather than every 5 minutes).
    In any case, I think you can do what is asked without external monitoring, but it will require some experimentation and a deeper knowledge of how performance metric sampling works for ESX.

Maybe you are looking for

  • PL/SQL code not working

    why is this code giving me error? declare type dept_tab_type is table of departments%rowtype; index by binary_integer; dept_tab dept_tab_type; v_counter number(3):= 270; begin for i in 10..v_count loop select * into dept_tab(i) from departments end l

  • Can I use an Airport extreme to extend my ATT wireless network?

    Hi I get my internet through an ATT DSL wireless router positioned up in my attic. I have a studio in my basement with 2 computers, a plotter, a laser printer and a fax/scanner/photo printer. I've run an ethernet cable down from the attic in to a cen

  • Safari Has encountered an error and needs to close

    Hi I have been having this problem with safari that right after it starts it closes due to an error (thats what it says) I really like safari and i'm waiting on my mac to get here so HELP!

  • Payment Lot-Posting incomplete but posted a FICA document

    Hello, A payment lot was created with the status "Posting incomplete" and there were few items in the  "Not posted" list. When checked one of the accounts, the FICA document was posted for payment, but was NOT referring to the payment lot. The accoun

  • Insufficient Device Memory to Update to 10.2.1

    I went to install the new update (10.2.1.537) onto my Q5 through my phone, received the notification telling me device storage was almost full and the install failed. I then cleared out my device memory, moving everything I had access to onto media c