6 Replies Latest reply on Mar 28, 2008 9:51 AM by batts

    How the New Psyhic Engine Works?

    usualuser1000
      Is anyone knows how this new psyhic engine works? Because this init() command does nothing no matter if add gravity or simulate() command, i tried to make it work in the same way as Havok did, but nothing happens, no errors, nothing. Any suggestion?
        • 1. Re: How the New Psyhic Engine Works?
          KingDruid Level 1
          Make sure you have WorldObject.simulate() in every exitframe
          • 2. Re: How the New Psyhic Engine Works?
            usualuser1000 Level 1
            Maybe im still missed something, because i already use simulate() on exitFrame. I think im thinkin' in the way of Havok, but heres the simple code where "engine" is the physics and "crateroom" is the 3D world with some boxes, and with some balls in the air. With Havok the balls falls down, but with Physics they are still in the air, and the world.isInitialized returns 0,that means the world initialization is not succeeds...

            property pInitialized

            on beginsprite me
            initializePhysics()
            end

            on exitframe me
            member("engine").simulate()
            end me

            on endSprite( me )

            if (pInitialized) then
            member("engine").destroy()
            pInitialized = false
            member("crateroom").resetWorld()
            end if

            end

            on initializePhysics

            if (pInitialized) then
            member("engine").destroy()
            end if

            pInitialized = true
            member("engine").init("crateroom",vector(1.0,1.0,1.0),#automatic,0,5)
            member("engine").gravity = vector(0,-9.81,0)

            put "Initialized Physics"
            end initializePhysics
            • 3. Re: How the New Psyhic Engine Works?
              KingDruid Level 1
              The problem is you have:
              member("engine").init("crateroom",vector(1.0,1.0,1.0),#automatic,0,5)

              It should have a value here:
              #automatic,?????,5)

              I had the same problem and found that it can't be 0 or else the world will not initialize.
              • 4. Re: How the New Psyhic Engine Works?
                usualuser1000 Level 1
                Thanks! Now its works perfectly!
                • 5. How the New Psyhic Engine Works?
                  Glehenna
                  quote:

                  Originally posted by: KingDruid
                  The problem is you have:
                  member("engine").init("crateroom",vector(1.0,1.0,1.0),#automatic,0,5)

                  It should have a value here:
                  #automatic,?????,5)

                  I had the same problem and found that it can't be 0 or else the world will not initialize.


                  I had the exact same problem, the "funny" thing is that the example code suggests you use '0' as timeStep for #automatic mode.
                  The description for "timeStep" also says: "Used only in the equal time step mode where it specifies the step time for the physics world.". But it clearly affects the simulation in #automatic mode too, try setting the timeStep to 0.7 and then 0.1 to see the difference.

                  • 6. Re: How the New Psyhic Engine Works?
                    batts
                    Hi,

                    Any joy out there on examples / references for the new Dynamiks Xtra. So far I have converted some old havok bits without too much hassle.

                    Primarily I would l like to know the following:

                    Is there an equivalent for the havok registerStepCallback function or do I just use regular frame event calls (stepFrame, enter, exit, etc) this seems a little strange after years of havok?

                    On the up side adding and deleting from the sim seems not to cause a memory leak yet.