From 82d72bf976b43be95462bb78740a7c4b3cc595e5 Mon Sep 17 00:00:00 2001 From: Anders Gidenstam Date: Sun, 1 Aug 2010 21:13:18 +0200 Subject: [PATCH] Updated WalkView: Improved documentation. --- Aircraft/Generic/WalkView/walkview.nas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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] };