Hello!
Having fun with AGKVR.
Moving a physics object gradually to a desired position is working perfectly. (Like a Jedi using the force
)
// target position
opos_x# = GetObjectX( my_object )
opos_y# = GetObjectY( my_object )
opos_z# = GetObjectZ( my_object )
tpos_x# = AGKVR.GetLeftHandX()
tpos_y# = AGKVR.GetLeftHandY()
tpos_z# = AGKVR.GetLeftHandZ()
x_diff# = tpos_x# - opos_x#
y_diff# = tpos_y# - opos_y#
z_diff# = tpos_z# - opos_z#
direction = CreateVector3( x_diff#, y_diff#, z_diff# )
object_pos = CreateVector3( opos_x#, opos_y#, opos_z# )
target_pos = CreateVector3( tpos_x#, tpos_y#, tpos_z# )
SetObject3DPhysicsLinearVelocity( my_object, direction, GetVector3Distance( object_pos, target_pos ) * 10 )
However I'm having trouble rotating the physics object to a desired angle.
I seem to encounter gimbal lock issues and the object rotation begins to twitch erratically.
Any ideas on how to do it?
If at first you don\'t succeed, sky-diving isn\'t for you.