summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-05-10 06:35:31 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-05-10 06:35:31 -0400
commitae4c14ce01aeacea1db35d269832a20fc3925b91 (patch)
tree2ca325d12a26d214f44a2f5c47e1f631929eb045
parent8d2ff4adde8000e6c3175dd98941eba20ef6a1c8 (diff)
graphics: model: Rename <scene-node> to <model-node>.
-rw-r--r--chickadee/graphics/model.scm38
1 files changed, 19 insertions, 19 deletions
diff --git a/chickadee/graphics/model.scm b/chickadee/graphics/model.scm
index 5228db8..449bf87 100644
--- a/chickadee/graphics/model.scm
+++ b/chickadee/graphics/model.scm
@@ -157,31 +157,31 @@
;;;
-;;; Scene Node
+;;; Model Node
;;;
;; A tree of meshes with their own transformation matrices.
-(define-record-type <scene-node>
- (%make-scene-node name mesh matrix children)
- scene-node?
- (name scene-node-name)
- (mesh scene-node-mesh)
- (matrix scene-node-matrix)
- (children scene-node-children))
+(define-record-type <model-node>
+ (%make-model-node name mesh matrix children)
+ model-node?
+ (name model-node-name)
+ (mesh model-node-mesh)
+ (matrix model-node-matrix)
+ (children model-node-children))
-(define* (make-scene-node #:key
+(define* (make-model-node #:key
(name "anonymous")
mesh
(matrix (make-identity-matrix4))
(children '()))
- (%make-scene-node name mesh matrix children))
+ (%make-model-node name mesh matrix children))
-(define (draw-scene-node node state)
- (render-state-matrix-push-and-mult! state (scene-node-matrix node))
+(define (draw-model-node node state)
+ (render-state-matrix-push-and-mult! state (model-node-matrix node))
(for-each (lambda (child)
- (draw-scene-node child state))
- (scene-node-children node))
- (let ((mesh (scene-node-mesh node)))
+ (draw-model-node child state))
+ (model-node-children node))
+ (let ((mesh (model-node-mesh node)))
(when mesh
(draw-mesh mesh state)))
(render-state-matrix-pop! state))
@@ -213,7 +213,7 @@
(render-state-view-matrix-mult! state view-matrix)
(render-state-matrix-push-and-mult! state model-matrix)
;; TODO: Support drawing non-default scenes.
- (draw-scene-node (model-default-scene model) state))))
+ (draw-model-node (model-default-scene model) state))))
;;;
@@ -652,7 +652,7 @@
memo)))
'()
face-indices-map)))
- (scene (make-scene-node #:name model-name
+ (scene (make-model-node #:name model-name
#:mesh mesh)))
(make-model #:name model-name
#:scenes (list scene)
@@ -1045,7 +1045,7 @@
(vector->list
(or (array-ref/optional obj "children")
#())))))
- (make-scene-node #:name name
+ (make-model-node #:name name
#:children children
#:matrix matrix
#:mesh mesh)))
@@ -1069,7 +1069,7 @@
(vector->list
(or (number-array-ref/optional obj "nodes")
#())))))
- (make-scene-node #:name name #:children children)))
+ (make-model-node #:name name #:children children)))
(define (vector-map proc v)
(let ((new-v (make-vector (vector-length v))))
(for-range ((i (vector-length v)))