1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata into Work

This commit is contained in:
Vivian Meazza 2010-08-01 22:45:43 +01:00
commit 8086d9bf8d

View file

@ -12,6 +12,8 @@
# Global API. Automatically selects the right walker for the current view. # Global API. Automatically selects the right walker for the current view.
# NOTE: Coordinates are always 3 component lists: [x, y, z]. # 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. # Set the forward speed of the active walker.
# speed - walker speed in m/sec # 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. # The walker class.
# ============================================================================== # ==============================================================================
@ -77,6 +90,10 @@ var side_step = func (speed) {
# [19.5, 0.3, -8.85]); # [19.5, 0.3, -8.85]);
# var walker = walkview.walker.new("Passenger View", constraint); # 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 = { var walker = {
new : func (view_name, constraints = nil) { new : func (view_name, constraints = nil) {
var obj = { parents : [walker] }; var obj = { parents : [walker] };