Rotation with Rigidbody

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Rotation with Rigidbody

    Hello
    I'm having somewhat of a trouble with rotation of a Rigidbody.
    You see, I have two models, where one of them uses a Rigidbody. The problem
    is, however, that I want that rigidbody to have the same rotation as the model
    that doesnt use a rigidbody. I have tried solve this for quite some time
    without any luck.

    Any ideas?

    Thanks. :)

    SuperTank Guest

  2. Similar Questions and Discussions

    1. Rotation between two transform.rotation vectors.
      Hello, I think my subject is pretty straight forward. :) I am looking for a way for my 3D character to slowly rotate between two vectors. The...
    2. No rotation?
      I have a W3D file that I import into Director. There, I can pan, zoom, rotate just fine, but when I preview it in a browser (F12) or publish it, I...
    3. Havok rigidbody problem
      Hi all! I´m having several movablerigidbodys (spheres) that I want to bounce at another movablerigidbody (plane). The thing is that I move the...
    4. Havok RigidBody Rotation
      Hello All. I'm having some problems with the rotation property of a Havok rigid body. According to the Havok Xtra Lingo reference, the rotation...
    5. Rotation?
      im creating a small bullet seen for a movie of mine , and was wondering how i can do angles and rotations on a bullet easily? ie. A bullet flys...
  3. #2

    Default Re: Rotation with Rigidbody

    You could try to make the model of the rigidbody a child of the model you
    rotate. Make sure you use it with the #preserveworld to not screw up their
    positions.

    So:
    modelA.addChild(modelB, #preserveworld)

    I think this should work.

    Mazuho Guest

  4. #3

    Default Re: Rotation with Rigidbody

    It's been a while, and I don't have director in front of me to check the
    syntax, but I believe something like this might work for you:

    desiredRotation = plainModel.transform.rotation.axisAngle
    rigidBody.rotation = desiredRotation

    and run that everyframe or whenever is appropriate to keep it updated. Hope
    that helps some....





    Skavengur Guest

  5. #4

    Default Re: Rotation with Rigidbody

    hi,
    you should keep in mind that a havok body should be only conltrolled with the
    havok comands! the havok world is inside the havok castmember and it is
    invisible. the objects in the visual world only a representation of things
    happening in havok-land. That means, if a model is turned into a havok model,
    it should not be manipulated with normal lingo comands.

    The havok bodies should be moved by forces, impulses, angularvelocity,
    linearvelocity ... (all in the havok-lingo-reference)

    It's possible to set the rotation and the position of a havok body with
    havok-lingo-comands, but in setting the position and rotation without the use
    of forces, will exclude the model from the collision detection. Using
    "rotation" and "position" is in this case similar to "beam" the object to a new
    position by ignoring the physical rules.

    but to stick a object to a lingo controlled model you can use dashpods. If you
    use a angular dashpod, you can update its rotation and set it to the rotation
    of the lingo-controlled model. By making this agualar dashpod very strong, it
    will try to be very close to the given rotation.
    >modelA.addChild(modelB, #preserveworld)
    this is not a good idea because it will not move the havok body, only the
    visual representation. The havok model will not move. havok models can only be
    moved by havok comands.
    >desiredRotation = plainModel.transform.rotation.axisAngle
    >rigidBody.rotation = desiredRotation
    this will work, but exclude the collision detection.

    Apply a angulardashpod to that havok model and set its rotation like this:

    rot=pWorld.model("sourcemodel").getworldtransform( ).axisAngle
    pHavok.angulardashpot("nameofdashpot").rotation=ro t

    this should work. depending on the strenght of this dashpot, the motion will
    be applied. You should also take a look into the havok-lingo-reference on how
    to use "registerstepcallback" to build a handler that will execute the
    havok-code on havok timesteps.

    hope this is a littel help...

    hondo3000 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139