Hi, I have been trying to understand how to use prismatic joints and have failed miserably. In my test code below, the cubes seem to first jump to a central point then are attached to an axis along Z (Away from the camera). I assume that I'm doing something wrong with the "axisX#, axisY#, axisZ#" part of the PHY MAKE PRISMATIC JOINT command.
Does anyone know how to use this command and are willing to give an example or could point me in the direction of some tutorials? The tutorial that came with DarkPhysics (Dark Physics\Tutorials\Prismatic Joints) doesn't seem to build the joint and when I add a build command it has the same behaviour as my code.
#Constant RunSpeed = 40 `This value alters the amount the program 'sleeps' when Ctrl is pressed.
Phy Start
Phy Set Ground Plane 0
AutoCam Off
Position Camera 0, 0, 0, -20
Make Object Box 1, 20, 10, 20
Position Object 1, 0, -10, 0
Phy Make Rigid Body Static Box 1
Make Object Cube 2, 5
Color Object 2, RGB( 255,0,0 )
Position Object 2, 0, -2.5, 0
Phy Make Rigid Body Dynamic Box 2
Make Object Cube 3, 5
Color Object 3, RGB( 0, 255, 0 )
Position Object 3, 0, 10, 0
Phy Make Rigid Body Dynamic Box 3
Phy Make Prismatic Joint 1, 2, 3, 0, 0, 0, Object Position X( 3 ), Object Position Y( 3 ), Object Position Z( 3 )
Phy Build Prismatic Joint 1
Latch = 0
While Not EscapeKey()
Text 1,1, "Press SHIFT to step, hold CONTROL to run."
If ShiftKey()
If Latch = 0
Phy Update
Latch = 1
EndIf
Else
Latch = 0
EndIf
If ControlKey()
Phy Update
Sleep RunSpeed
EndIf
Point Camera 0, Object Position X( 2 ), Object Position Y( 2 ), Object Position Z( 2 )
EndWhile
Phy End
Thanks in advance!
Foil wrapped for crunchiness