Question Animate a nosecone

johnnymanly

Donator
Donator
Joined
Mar 17, 2008
Messages
179
Reaction score
116
Points
43
Location
Southwest Pennsylginia
Website
sites.google.com
I'm trying to animate a nosecone (for a docking port) using the ShuttleA as a guide and converting the code to Lua.
I have this so far:
Code:
function activate_nose(DoorStatus, action)

  local close = (action == DOOR_CLOSED or action == DOOR_CLOSING)
  nose_status = action
  if action <= DOOR_OPEN then
    nose_proc = (action == DOOR_CLOSED and 0.0 or 1.0)
    vi:set_animation(anim_Nose, nose_proc)
  end

end

function revert_nose()

  activate_nose(nose_status == DOOR_CLOSED or nose_status == DOOR_CLOSING and DOOR_OPENING or DOOR_CLOSING)

end

function clbk_poststep(simt,simdt,mjd)

  if nose_status >= DOOR_CLOSING then
    local da = simdt * NOSE_OPERATING_SPEED
    if nose_status == DOOR_CLOSING then
      if nose_proc > 0.0 then
        nose_proc = math.max(0.0, nose_proc - da)
      else
        nose_status = DOOR_CLOSED
      end
    else
      if nose_proc < 1.0 then
        nose_proc = math.min(1.0, nose_proc + da)
      else
        nose_status = DOOR_OPEN
      end
    end
    vi:set_animation(anim_Nose, nose_proc)
  end

end
But I don't know what to do with this:
Code:
enum DoorStatus { DOOR_CLOSED, DOOR_OPEN, DOOR_CLOSING, DOOR_OPENING }
        dock_status
from the ShuttleA header file.
Any help would be appreciated.:unsure:
 
Back
Top