diff --git a/Aircraft/Generic/WalkView/walkview.nas b/Aircraft/Generic/WalkView/walkview.nas index 33df1e082..c44467216 100644 --- a/Aircraft/Generic/WalkView/walkview.nas +++ b/Aircraft/Generic/WalkView/walkview.nas @@ -12,6 +12,8 @@ # Global API. Automatically selects the right walker for the current view. # NOTE: Coordinates are always 3 component lists: [x, y, z]. +# The coordinate system is the same as the main 3d model one. +# X - back, Y - right and Z - up. # Set the forward speed of the active walker. # speed - walker speed in m/sec @@ -39,6 +41,17 @@ var side_step = func (speed) { } } +# Get the currently active walker. +# Returns the active walker object or nil otherwise. +var active_walker = func { + var cv = view.current.getPath(); + if (contains(walkers, cv)) { + return walkers[cv]; + } else { + return nil; + } +} + ############################################################################### # The walker class. # ============================================================================== @@ -77,6 +90,10 @@ var side_step = func (speed) { # [19.5, 0.3, -8.85]); # var walker = walkview.walker.new("Passenger View", constraint); # +# NOTES: +# Currently there can only be one view manager per view so the +# walk view should not have any other view manager. +# var walker = { new : func (view_name, constraints = nil) { var obj = { parents : [walker] };