From c86bedd9128bc476cf9b12e607ad1cf6a0951f66 Mon Sep 17 00:00:00 2001 From: erikc Date: Sun, 31 Jan 2010 16:56:58 -0800 Subject: [PATCH] Missed a few changed --- extra/game/models/collada/collada-docs.factor | 6 +++++- extra/game/models/collada/collada.factor | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/extra/game/models/collada/collada-docs.factor b/extra/game/models/collada/collada-docs.factor index d5f727e303..32f2bcace1 100644 --- a/extra/game/models/collada/collada-docs.factor +++ b/extra/game/models/collada/collada-docs.factor @@ -31,7 +31,11 @@ HELP: HELP: string>numbers ( string -- number-seq ) { $values { "string" string } { "number-seq" sequence } } -{ $description "Splits a string on whitespace and converts the elements to a number sequence" } ; +{ $description "Splits a string on whitespace and converts the elements to a number sequence." } ; + +HELP: string>floats ( string -- float-seq ) +{ $values { "string" string } { "float-seq" sequence } } +{ $description "Splits a string on whitespace and converts the elements to a float sequence." } ; HELP: x-up { $class-description "Right-handed 3D coordinate system where X is up." } ; HELP: y-up { $class-description "Right-handed 3D coordinate system where Y is up." } ; diff --git a/extra/game/models/collada/collada.factor b/extra/game/models/collada/collada.factor index 6c5601ffd5..7f04aa992f 100644 --- a/extra/game/models/collada/collada.factor +++ b/extra/game/models/collada/collada.factor @@ -59,6 +59,9 @@ M: indexed-seq new-resizable : string>numbers ( string -- number-seq ) " \t\n" split [ "" = ] trim [ string>number ] map ; +: string>floats ( string -- float-seq ) + " \t\n" split [ "" = ] trim [ string>float ] map ; + : x/ ( tag child-name -- child-tag ) [ tag-named ] [ rot dup [ drop missing-child ] unless 2nip ] @@ -107,7 +110,7 @@ M: z-up >y-up-axis! : source>seq ( source-tag up-axis scale -- sequence ) rot - [ "float_array" x/ xt string>numbers [ * ] with map ] + [ "float_array" x/ xt string>floats [ * ] with map ] [ nip "technique_common" x/ "accessor" x/ "stride" x@ string>number ] 2bi group [ swap over length 2 > [ >y-up-axis! ] [ drop ] if ] with map ;