diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-09-06 09:24:23 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-09-06 09:24:23 -0400 |
commit | 02c79cc63c52c310aa1e96c7cac1f881055a2714 (patch) | |
tree | c135f2428e6ee77fb7a11ebacdf5630031f00b4a | |
parent | 931632def72f371ed30fda76189559c575980e4e (diff) |
render: scene: Add better printers for primitives, meshes, and scenes.
* chickadee/render/scene.scm (display-primitive, display-mesh,
display-scene-node): New procedures.
-rw-r--r-- | chickadee/render/scene.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chickadee/render/scene.scm b/chickadee/render/scene.scm index 279d4e6..8aa6f1f 100644 --- a/chickadee/render/scene.scm +++ b/chickadee/render/scene.scm @@ -149,6 +149,13 @@ (material primitive-material) (targets primitive-targets)) +(define (display-primitive primitive port) + (format port "#<primitive material: ~s targets: ~s>" + (primitive-material primitive) + (primitive-targets primitive))) + +(set-record-type-printer! <primitive> display-primitive) + (define* (make-primitive #:key vertex-array (material default-material) @@ -162,6 +169,11 @@ (primitives mesh-primitives) (weights mesh-weights)) +(define (display-mesh mesh port) + (format port "#<mesh name: ~s>" (mesh-name mesh))) + +(set-record-type-printer! <mesh> display-mesh) + (define* (make-mesh #:key (name "anonymous") primitives @@ -183,6 +195,11 @@ (translation scene-node-translation) (weights scene-node-weights)) +(define (display-scene-node scene port) + (format port "#<scene-node name: ~s>" (scene-node-name scene))) + +(set-record-type-printer! <scene-node> display-scene-node) + (define* (make-scene-node #:key (name "anonymous") (children #()) |